selftests/vm/pkeys: Add a regression test for setting PKRU through ptrace
authorKyle Huey <me@kylehuey.com>
Tue, 15 Nov 2022 23:09:32 +0000 (15:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Jan 2023 09:33:42 +0000 (10:33 +0100)
commit29fbaa434c223f29917e8de054cc48a96e6c0ed4
treef72c7edb1cf476ea08abd966d472624804f062f8
parentd2602da3da87a1832f708c8639b0afbfb5704cd4
selftests/vm/pkeys: Add a regression test for setting PKRU through ptrace

commit 6ea25770b043c7997ab21d1ce95ba5de4d3d85d9 upstream.

This tests PTRACE_SETREGSET with NT_X86_XSTATE modifying PKRU directly and
removing the PKRU bit from XSTATE_BV.

Signed-off-by: Kyle Huey <me@kylehuey.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20221115230932.7126-7-khuey%40kylehuey.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/vm/pkey-x86.h
tools/testing/selftests/vm/protection_keys.c