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


Groups > linux.kernel > #1573374 > unrolled thread

[PATCH 0/2] selftests, x86: updates for x86 protection keys self tests

Started byDave Hansen <dave.hansen@linux.intel.com>
First post2017-02-03 20:00 +0100
Last post2017-02-08 19:20 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1573374 — [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests

FromDave Hansen <dave.hansen@linux.intel.com>
Date2017-02-03 20:00 +0100
Subject[PATCH 0/2] selftests, x86: updates for x86 protection keys self tests
Message-ID<t6Rfs-5wT-3@gated-at.bofh.it>
The memory protection keys selftests are spewing an uninitialized
variable warning

I also included a fix that affected the 32-bit version of the
pkeys test case.  It was parsing the siginfo incorrectly.

[toc] | [next] | [standalone]


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

FromDave Hansen <dave.hansen@linux.intel.com>
Date2017-02-03 20:00 +0100
Subject[PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo
Message-ID<t6Rfs-5wT-15@gated-at.bofh.it>
In reply to#1573374
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
_

[toc] | [prev] | [next] | [standalone]


#1573376 — [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning

FromDave Hansen <dave.hansen@linux.intel.com>
Date2017-02-03 20:00 +0100
Subject[PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning
Message-ID<t6Rfs-5wT-5@gated-at.bofh.it>
In reply to#1573374
From: Dave Hansen <dave.hansen@linux.intel.com>

'orig_pkru' might have been uninitialized here.  Fix it.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.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-selftests-cleanrup-4-10-ish tools/testing/selftests/x86/protection_keys.c
--- a/tools/testing/selftests/x86/protection_keys.c~pkeys-selftests-cleanrup-4-10-ish	2017-02-02 15:27:13.758149477 -0800
+++ b/tools/testing/selftests/x86/protection_keys.c	2017-02-02 15:27:13.762149656 -0800
@@ -462,7 +462,7 @@ void pkey_disable_set(int pkey, int flag
 	unsigned long syscall_flags = 0;
 	int ret;
 	int pkey_rights;
-	u32 orig_pkru;
+	u32 orig_pkru = rdpkru();
 
 	dprintf1("START->%s(%d, 0x%x)\n", __func__,
 		pkey, flags);
_

[toc] | [prev] | [next] | [standalone]


#1576796 — Re: [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-02-08 19:20 +0100
SubjectRe: [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests
Message-ID<t8F0u-3Hv-7@gated-at.bofh.it>
In reply to#1573374
On 02/03/2017 11:51 AM, Dave Hansen wrote:
> The memory protection keys selftests are spewing an uninitialized
> variable warning
> 
> I also included a fix that affected the 32-bit version of the
> pkeys test case.  It was parsing the siginfo incorrectly.
> 

Dave,

Thanks. Applied to linux-kselftest next for 4.11-rc1

-- Shuah

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web