diff options
| author | Sami Tolvanen <[email protected]> | 2023-09-27 22:48:02 +0000 |
|---|---|---|
| committer | Palmer Dabbelt <[email protected]> | 2023-10-27 21:43:08 +0000 |
| commit | d1584d791a297aa8ed93503382a682a6ecfc4218 (patch) | |
| tree | 371b56adbd1d77f436e143555ab9fb47b4ad50c0 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
| parent | riscv: Move global pointer loading to a macro (diff) | |
| download | kernel-d1584d791a297aa8ed93503382a682a6ecfc4218.tar.gz kernel-d1584d791a297aa8ed93503382a682a6ecfc4218.zip | |
riscv: Implement Shadow Call Stack
Implement CONFIG_SHADOW_CALL_STACK for RISC-V. When enabled, the
compiler injects instructions to all non-leaf C functions to
store the return address to the shadow stack and unconditionally
load it again before returning, which makes it harder to corrupt
the return address through a stack overflow, for example.
The active shadow call stack pointer is stored in the gp
register, which makes SCS incompatible with gp relaxation. Use
--no-relax-gp to ensure gp relaxation is disabled and disable
global pointer loading. Add SCS pointers to struct thread_info,
implement SCS initialization, and task switching
Signed-off-by: Sami Tolvanen <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions
