Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573375

[PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo

From Dave Hansen <dave.hansen@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo
Date 2017-02-03 20:00 +0100
Message-ID <t6Rfs-5wT-15@gated-at.bofh.it> (permalink)
References <t6Rfs-5wT-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Dave Hansen <dave.hansen@linux.intel.com>

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 <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
---

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

diff -puN tools/testing/selftests/x86/protection_keys.c~pkeys-selftest-fix-32bit-offset tools/testing/selftests/x86/protection_keys.c
--- a/tools/testing/selftests/x86/protection_keys.c~pkeys-selftest-fix-32bit-offset	2017-02-02 15:45:07.613423502 -0800
+++ b/tools/testing/selftests/x86/protection_keys.c	2017-02-02 15:45:07.616423637 -0800
@@ -192,7 +192,7 @@ void lots_o_noops_around_write(int *writ
 #define SYS_pkey_alloc	 381
 #define SYS_pkey_free	 382
 #define REG_IP_IDX REG_EIP
-#define si_pkey_offset 0x18
+#define si_pkey_offset 0x14
 #else
 #define SYS_mprotect_key 329
 #define SYS_pkey_alloc	 330
_

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Dave Hansen <dave.hansen@linux.intel.com> - 2017-02-03 20:00 +0100
  [PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo Dave Hansen <dave.hansen@linux.intel.com> - 2017-02-03 20:00 +0100
  [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning Dave Hansen <dave.hansen@linux.intel.com> - 2017-02-03 20:00 +0100
  Re: [PATCH 0/2] selftests, x86: updates for x86 protection keys self  tests Shuah Khan <shuahkh@osg.samsung.com> - 2017-02-08 19:20 +0100

csiph-web