Re: [PATCH v6 37/41] selftests/x86: Add shadow stack test
From: Kees Cook <hidden>
Date: 2023-02-19 20:47:25
Also in:
linux-arch, linux-doc, linux-mm, lkml
From: Kees Cook <hidden>
Date: 2023-02-19 20:47:25
Also in:
linux-arch, linux-doc, linux-mm, lkml
On Sat, Feb 18, 2023 at 01:14:29PM -0800, Rick Edgecombe wrote:
Add a simple selftest for exercising some shadow stack behavior: - map_shadow_stack syscall and pivot - Faulting in shadow stack memory - Handling shadow stack violations - GUP of shadow stack memory - mprotect() of shadow stack memory - Userfaultfd on shadow stack memory Since this test exercises a recently added syscall manually, it needs to find the automatically created __NR_foo defines. Per the selftest documentation, KHDR_INCLUDES can be used to help the selftest Makefile's find the headers from the kernel source. This way the new selftest can be built inside the kernel source tree without installing the headers to the system. So also add KHDR_INCLUDES as described in the selftest docs, to facilitate this. Tested-by: Pengfei Xu <redacted> Tested-by: John Allen <john.allen@amd.com> Co-developed-by: Yu-cheng Yu <redacted> Signed-off-by: Yu-cheng Yu <redacted> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
I'll get some test hardware and run this myself too, but overall, ignoring the lack of kselftest_harness.h, it looks good: Reviewed-by: Kees Cook <redacted> -- Kees Cook