mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>
Subject: [PATCH 4/4] selftests, x86, protection_keys: fix wrong offset in siginfo
Date: Thu, 02 Feb 2017 15:28:48 -0800	[thread overview]
Message-ID: <20170202232848.A499B430@viggo.jf.intel.com> (raw)
In-Reply-To: <20170202232842.C3C30DB2@viggo.jf.intel.com>


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>
---

 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:27:14.185168666 -0800
+++ b/tools/testing/selftests/x86/protection_keys.c	2017-02-02 15:27:14.188168801 -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
_

      parent reply	other threads:[~2017-02-02 23:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 23:28 [PATCH 0/4] selftests, x86: updates for x86 protection keys self tests Dave Hansen
2017-02-02 23:28 ` [PATCH 1/4] selftests, x86, protection_keys: fix unused variable compile warnings Dave Hansen
2017-02-02 23:36   ` Shuah Khan
2017-02-02 23:45     ` Dave Hansen
2017-02-02 23:49       ` Shuah Khan
2017-02-03  6:43         ` Ingo Molnar
2017-02-02 23:28 ` [PATCH 2/4] selftests, x86, protection_keys: remove dead code Dave Hansen
2017-02-02 23:36   ` Shuah Khan
2017-02-02 23:28 ` [PATCH 3/4] selftests, x86, protection_keys: fix uninitialized variable warning Dave Hansen
2017-02-02 23:28 ` Dave Hansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170202232848.A499B430@viggo.jf.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®