[lkml]   [2018]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.9 60/67] selftests, x86, protection_keys: fix wrong offset in siginfo
4.9-stable review patch.  If anyone has any objections, please let me know.


From: Dave Hansen <>

commit 2195bff041486eb7fcceaf058acaedcd057efbdc upstream.

The siginfo contains a bunch of information about the fault.
For protection keys, it tells us which protection key's
permissions were violated.

The wrong offset in here leads to reading garbage and thus
failures in the tests.

We should probably eventually move this over to using the
kernel's headers defining the siginfo instead of a hard-coded
offset. But, for now, just do the simplest fix.

Signed-off-by: Dave Hansen <>
Cc: Ingo Molnar <>
Cc: Shuah Khan <>
Signed-off-by: Shuah Khan <>
Signed-off-by: Greg Kroah-Hartman <>

tools/testing/selftests/x86/protection_keys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/testing/selftests/x86/protection_keys.c
+++ b/tools/testing/selftests/x86/protection_keys.c
@@ -192,7 +192,7 @@ void lots_o_noops_around_write(int *writ
#define SYS_pkey_alloc 381
#define SYS_pkey_free 382
-#define si_pkey_offset 0x18
+#define si_pkey_offset 0x14
#define SYS_mprotect_key 329
#define SYS_pkey_alloc 330

 \ /
  Last update: 2018-03-27 19:46    [W:0.278 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site