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]
Message-ID: <20080327210122.GA22823@elte.hu>
Date:	Thu, 27 Mar 2008 22:01:22 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Harvey Harrison <harvey.harrison@...il.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [git pull] x86 fixes


* Ingo Molnar <mingo@...e.hu> wrote:

> i suspect we would be fine with a simple:
> 
> 	if (error_code & PF_INSTR)
>   		return 0;
> 
> because if we get a fault on an instruction fetch then it clearly 
> cannot be a prefetch erratum ... The NX condition simply comes from a 
> cautious 32-bit workaround. (on 64-bit we always have NX - at least on 
> AMD which has this erratum.)
> 
> and thus the currently pulled code is not incorrect, just ugly and 
> nonsensical.

i.e. the patch below, which is even simpler. The comments were a bit 
confusing as well - in this function we decide whether to ignore a 
fault, so returning 0 means we do _not_ ignore a fault (but process it 
to the bitter end most likely).

	Ingo

-------------->
Subject: x86: prefetch fix #2
From: Ingo Molnar <mingo@...e.hu>
Date: Thu Mar 27 21:29:09 CET 2008

Linus noticed a second bug and an uncleanliness:

 - we'd return on any instruction fetch fault

 - we'd use both the value of 16 and the PF_INSTR symbol which are
   the same and make no sense

the cleanup nicely unifies this piece of logic.

Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 arch/x86/mm/fault.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Index: linux-x86.q/arch/x86/mm/fault.c
===================================================================
--- linux-x86.q.orig/arch/x86/mm/fault.c
+++ linux-x86.q/arch/x86/mm/fault.c
@@ -103,13 +103,10 @@ static int is_prefetch(struct pt_regs *r
 	int prefetch = 0;
 	unsigned char *max_instr;
 
-#ifdef CONFIG_X86_32
-	/* Catch an obscure case of prefetch inside an NX page: */
-	if ((__supported_pte_mask & _PAGE_NX) && (error_code & 16))
-		return 0;
-#endif
-
-	/* If it was a exec fault on NX page, ignore */
+	/*
+	 * If it was a exec (instruction fetch) fault on NX page, then
+	 * do not ignore the fault:
+	 */
 	if (error_code & PF_INSTR)
 		return 0;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ