diff mbox series

[24/33] riscv/kernel: update __show_regs to print shadow stack register

Message ID 20241001-v5_user_cfi_series-v1-24-3ba65b6e550f@rivosinc.com (mailing list archive)
State Superseded
Headers show
Series riscv control-flow integrity for usermode | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail PR summary
conchuod/patch-24-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 98.82s
conchuod/patch-24-test-2 fail .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 963.73s
conchuod/patch-24-test-3 fail .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1157.56s
conchuod/patch-24-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 15.83s
conchuod/patch-24-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 17.34s
conchuod/patch-24-test-6 warning .github/scripts/patches/tests/checkpatch.sh took 0.34s
conchuod/patch-24-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 35.79s
conchuod/patch-24-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-24-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.45s
conchuod/patch-24-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-24-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-24-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.02s

Commit Message

Deepak Gupta Oct. 1, 2024, 4:06 p.m. UTC
Updating __show_regs to print captured shadow stack pointer as well.
On tasks where shadow stack is disabled, it'll simply print 0.

Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 arch/riscv/kernel/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index 5207f018415c..6db0fde3701e 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -89,8 +89,8 @@  void __show_regs(struct pt_regs *regs)
 		regs->s8, regs->s9, regs->s10);
 	pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n",
 		regs->s11, regs->t3, regs->t4);
-	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n",
-		regs->t5, regs->t6);
+	pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT " ssp : " REG_FMT "\n",
+		regs->t5, regs->t6, get_active_shstk(current));
 
 	pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n",
 		regs->status, regs->badaddr, regs->cause);