Thread (148 messages) 148 messages, 17 authors, 2022-06-09

Re: [PATCH 33/35] selftests/x86: Add map_shadow_stack syscall test

From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Date: 2022-02-04 01:23:01
Also in: linux-arch, linux-doc, linux-mm, lkml

On Thu, 2022-02-03 at 14:42 -0800, Dave Hansen wrote:
This is a good start for the selftest.  But, it would be really nice
to
see a few additional smoke tests in here that are independent of the
library support.
Sure. I had actually included this just because the "adding a syscall"
docs said to make sure to include a test for the syscall. There are
some other tests that were being planned as a follow up.
For instance, it would be nice to have tests that:

1. Write to the shadow stack with normal instructions (and recover
from
   the inevitable SEGV).  Make sure the siginfo looks like we expect.
2. Corrupt the regular stack, or maybe just use a retpoline
   do induce a shadow stack exception.  Ditto on checking the siginfo
3. Do enough CALLs that will likely trigger a fault and an on-demand
   shadow stack page allocation.

That will test the *basics* and should be pretty simple to write.
Most of this already exists in the private tests. I'll combine it into
a single selftest. Having wrss now nicely made it a bit easier because
those writes are treated as shadow stack accesses, so we can do these
operations directly without too much calling acrobatics.

Thanks,

Rick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help