lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Apr 2017 00:31:29 -0700
From:   tip-bot for Joerg Roedel <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     dvlasenk@...hat.com, shuah@...nel.org, hpa@...or.com,
        peterz@...radead.org, bp@...en8.de, torvalds@...ux-foundation.org,
        dave.hansen@...ux.intel.com, jroedel@...e.de, brgerst@...il.com,
        linux-kernel@...r.kernel.org, mingo@...nel.org, luto@...nel.org,
        tglx@...utronix.de, jpoimboe@...hat.com
Subject: [tip:x86/mm] x86/mpx, selftests: Only check bounds-vs-shadow when
 we keep shadow

Commit-ID:  5f2173e056b2a5c215b862f136192744c447844e
Gitweb:     http://git.kernel.org/tip/5f2173e056b2a5c215b862f136192744c447844e
Author:     Joerg Roedel <jroedel@...e.de>
AuthorDate: Thu, 6 Apr 2017 16:23:18 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Wed, 12 Apr 2017 08:40:59 +0200

x86/mpx, selftests: Only check bounds-vs-shadow when we keep shadow

The check between the hardware state and our shadow of it is
checked in the signal handler for all bounds exceptions,
even for the ones where we don't keep the shadow up2date.
This is a problem because when no shadow is kept the handler
fails at this point and hides the real reason of the
exception.

Move the check into the code-path evaluating normal bounds
exceptions to prevent this.

Signed-off-by: Joerg Roedel <jroedel@...e.de>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Shuah Khan <shuah@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kselftest@...r.kernel.org
Link: http://lkml.kernel.org/r/1491488598-27346-1-git-send-email-joro@8bytes.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 tools/testing/selftests/x86/mpx-mini-test.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/x86/mpx-mini-test.c b/tools/testing/selftests/x86/mpx-mini-test.c
index 616ee96..a8df159 100644
--- a/tools/testing/selftests/x86/mpx-mini-test.c
+++ b/tools/testing/selftests/x86/mpx-mini-test.c
@@ -404,8 +404,6 @@ void handler(int signum, siginfo_t *si, void *vucontext)
 		dprintf2("info->si_lower: %p\n", __si_bounds_lower(si));
 		dprintf2("info->si_upper: %p\n", __si_bounds_upper(si));
 
-		check_siginfo_vs_shadow(si);
-
 		for (i = 0; i < 8; i++)
 			dprintf3("[%d]: %p\n", i, si_addr_ptr[i]);
 		switch (br_reason) {
@@ -416,6 +414,9 @@ void handler(int signum, siginfo_t *si, void *vucontext)
 			exit(5);
 		case 1: /* #BR MPX bounds exception */
 			/* these are normal and we expect to see them */
+
+			check_siginfo_vs_shadow(si);
+
 			dprintf1("bounds exception (normal): status 0x%jx at %p si_addr: %p\n",
 				status, (void *)ip, si->si_addr);
 			num_bnd_chk++;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ