From 656588f1c842bc2093c38104ee4f0e9642c56d8d Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Wed, 23 Aug 2023 11:12:44 +0800 Subject: [PATCH] cet/shstk_alloc.c: unable to show content of switched ssp content due to kernel protection Since the v6.5 cycle latest cet userspace shstk patch improvements, switched ssp content will be protected and it makes sense, if code wants to show the switched ssp content, it will get fake segfault like this: " ssp0 & (-8): 7f5d4efffff8 Segmentation fault (core dumped) " Dmesg shows the segfault as following: " shstk_alloc[3080]: segfault at 7f5d4e7ff000 ip 0000000000401258 sp 00007ffcd214f180 error 4 in shstk_alloc[401000+1000] likely on CPU 15 (core 3, socket 0) " So code should not show worked and switched ssp content to avoid fake failure. Signed-off-by: Pengfei Xu --- cet/shstk_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cet/shstk_alloc.c b/cet/shstk_alloc.c index 74ed097..744f5d5 100644 --- a/cet/shstk_alloc.c +++ b/cet/shstk_alloc.c @@ -109,7 +109,7 @@ void try_shstk(unsigned long new_ssp) asm volatile("rstorssp (%0)\n":: "r" (new_ssp)); asm volatile("saveprevssp"); ssp1 = get_ssp(); - printf("ssp is now %lx, *ssp:%lx\n", ssp1, *((unsigned long *)ssp1)); + printf("ssp is now %lx\n", ssp1); ssp0 -= 8; asm volatile("rstorssp (%0)\n":: "r" (ssp0));