aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/mm/protection_keys.c
diff options
context:
space:
mode:
authorMuhammad Usama Anjum <usama.anjum@collabora.com>2023-06-12 14:53:47 +0500
committerAndrew Morton <akpm@linux-foundation.org>2023-06-19 16:19:25 -0700
commit0183d777c29ab12c2b0c19f3d4f5c6df016815fb (patch)
treeee1484b23d7d06785b06a12990aa0ca3e4b49972 /tools/testing/selftests/mm/protection_keys.c
parentselftests: mm: remove wrong kernel header inclusion (diff)
downloadwireguard-linux-0183d777c29ab12c2b0c19f3d4f5c6df016815fb.tar.xz
wireguard-linux-0183d777c29ab12c2b0c19f3d4f5c6df016815fb.zip
selftests: mm: remove duplicate unneeded defines
Remove all defines which aren't needed after correctly including the kernel header files. Link: https://lkml.kernel.org/r/20230612095347.996335-2-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: David Hildenbrand <david@redhat.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Stefan Roesch <shr@devkernel.io> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/mm/protection_keys.c')
-rw-r--r--tools/testing/selftests/mm/protection_keys.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c
index 0381c34fdd56..48dc151f8fca 100644
--- a/tools/testing/selftests/mm/protection_keys.c
+++ b/tools/testing/selftests/mm/protection_keys.c
@@ -294,15 +294,6 @@ void pkey_access_deny(int pkey)
pkey_disable_set(pkey, PKEY_DISABLE_ACCESS);
}
-/* Failed address bound checks: */
-#ifndef SEGV_BNDERR
-# define SEGV_BNDERR 3
-#endif
-
-#ifndef SEGV_PKUERR
-# define SEGV_PKUERR 4
-#endif
-
static char *si_code_str(int si_code)
{
if (si_code == SEGV_MAPERR)
@@ -476,7 +467,7 @@ int sys_mprotect_pkey(void *ptr, size_t size, unsigned long orig_prot,
ptr, size, orig_prot, pkey);
errno = 0;
- sret = syscall(SYS_mprotect_key, ptr, size, orig_prot, pkey);
+ sret = syscall(__NR_pkey_mprotect, ptr, size, orig_prot, pkey);
if (errno) {
dprintf2("SYS_mprotect_key sret: %d\n", sret);
dprintf2("SYS_mprotect_key prot: 0x%lx\n", orig_prot);
@@ -1684,7 +1675,7 @@ void test_mprotect_pkey_on_unsupported_cpu(int *ptr, u16 pkey)
return;
}
- sret = syscall(SYS_mprotect_key, ptr, size, PROT_READ, pkey);
+ sret = syscall(__NR_pkey_mprotect, ptr, size, PROT_READ, pkey);
pkey_assert(sret < 0);
}