* [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests
@ 2017-02-03 18:51 Dave Hansen
2017-02-03 18:51 ` [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning Dave Hansen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dave Hansen @ 2017-02-03 18:51 UTC (permalink / raw)
To: linux-kernel; +Cc: x86, shuahkh, Dave Hansen
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.
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning
2017-02-03 18:51 [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Dave Hansen
@ 2017-02-03 18:51 ` Dave Hansen
2017-02-03 18:51 ` [PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo Dave Hansen
2017-02-08 18:18 ` [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Shuah Khan
2 siblings, 0 replies; 4+ messages in thread
From: Dave Hansen @ 2017-02-03 18:51 UTC (permalink / raw)
To: linux-kernel; +Cc: x86, shuahkh, Dave Hansen, mingo
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);
_
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo
2017-02-03 18:51 [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Dave Hansen
2017-02-03 18:51 ` [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning Dave Hansen
@ 2017-02-03 18:51 ` Dave Hansen
2017-02-08 18:18 ` [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Shuah Khan
2 siblings, 0 replies; 4+ messages in thread
From: Dave Hansen @ 2017-02-03 18:51 UTC (permalink / raw)
To: linux-kernel; +Cc: x86, shuahkh, Dave Hansen, mingo
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
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests
2017-02-03 18:51 [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Dave Hansen
2017-02-03 18:51 ` [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning Dave Hansen
2017-02-03 18:51 ` [PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo Dave Hansen
@ 2017-02-08 18:18 ` Shuah Khan
2 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2017-02-08 18:18 UTC (permalink / raw)
To: Dave Hansen, linux-kernel; +Cc: x86, linux-kselftest, Shuah Khan
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-08 18:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03 18:51 [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Dave Hansen
2017-02-03 18:51 ` [PATCH 1/2] selftests, x86, protection_keys: fix uninitialized variable warning Dave Hansen
2017-02-03 18:51 ` [PATCH 2/2] selftests, x86, protection_keys: fix wrong offset in siginfo Dave Hansen
2017-02-08 18:18 ` [PATCH 0/2] selftests, x86: updates for x86 protection keys self tests Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®