diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-10-30 13:34:18 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-01 10:27:36 +0200 |
| commit | f139fff6ae7063c1965fa3085bb2585d7d838d72 (patch) | |
| tree | 7ee9f7c6a1ee09dba93c086cd66861474b821c97 /arch/riscv64/kernel/entry.S | |
| parent | b576c1d477bf476f277d32ecf60c312e4a97490d (diff) | |
| download | kmi-f139fff6ae7063c1965fa3085bb2585d7d838d72.tar.gz kmi-f139fff6ae7063c1965fa3085bb2585d7d838d72.zip | |
rpc actually marks and unmarks stack regions
+ Processes won't be able to read previous stack frames etc
Diffstat (limited to 'arch/riscv64/kernel/entry.S')
| -rw-r--r-- | arch/riscv64/kernel/entry.S | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/entry.S b/arch/riscv64/kernel/entry.S index f894e0d..48851d4 100644 --- a/arch/riscv64/kernel/entry.S +++ b/arch/riscv64/kernel/entry.S @@ -92,6 +92,9 @@ continue_trap: save_callee save_caller + csrr t0, CSR_SEPC + sr t0, offsetof_exec(tp) + mv a0, s10 /* get actual kernel stack into sp */ mv sp, tp @@ -117,6 +120,7 @@ handle_exception: csrr a0, CSR_SEPC csrr a1, CSR_STVAL csrr a2, CSR_SCAUSE + sr a0, offsetof_exec(tp) mv sp, tp call riscv_handle_exception |
