Skip to content

Commit

Permalink
cet/shstk_alloc.c: unable to show content of switched ssp content due…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
  • Loading branch information
xupengfe committed Aug 23, 2023
1 parent d9bca91 commit 656588f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cet/shstk_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 656588f

Please sign in to comment.