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

From: Dave Hansen
Date: Thu Feb 03 2022 - 17:42:44 EST


On 1/30/22 13:18, Rick Edgecombe wrote:
> Add a simple selftest for exercising the new map_shadow_stack syscall.

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.

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.