Re: crashme fault

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Monday, September 17, 2007 - 7:53 am

On Mon, 17 Sep 2007, Randy Dunlap wrote:

Well, duh.

That's because I forgot to do the "error_code & PF_USER" => 
"user_mode_vm(regs)" thing in the most common case - the 
"bad_area_nosemaphore" if-statement.

But thinking more about it, it's actually just easier and more 
straightforward to just take the same approach that my original hack did, 
namely to just set PF_USER if the register state implies it was in user  
mode.

So ignore that patch. You're better off with my original one that also 
gave debugging info, and if we decide that this really looks like a CPU 
buglet, the patch to actually commit would be a simplified version of that 
(appended, just FYI).

Also, I changed my mind on the microcode update - if you have a newer 
microcode, go ahead and try it, because if that fixes the issue, then we 
can really just close this as a "unimportant CPU bug" with the patch 
below.

		Linus

---
 arch/x86_64/mm/fault.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 327c9f2..54816ad 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -374,6 +374,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
 	if (unlikely(in_atomic() || !mm))
 		goto bad_area_nosemaphore;
 
+	/*
+	 * User-mode registers count as a user access even for any
+	 * potential system fault or CPU buglet.
+	 */
+	if (user_mode_vm(regs))
+		error_code |= PF_USER;
+
  again:
 	/* When running in the kernel we expect faults to occur only to
 	 * addresses in user space.  All other faults represent errors in the
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
crashme fault, Randy Dunlap, (Wed Sep 12, 10:21 pm)
Re: crashme fault, Linus Torvalds, (Fri Sep 14, 9:28 pm)
Re: crashme fault, Randy Dunlap, (Fri Sep 14, 10:05 pm)
Re: crashme fault, Randy Dunlap, (Fri Sep 14, 10:21 pm)
Re: crashme fault, Andi Kleen, (Sat Sep 15, 11:34 am)
Re: crashme fault, Randy Dunlap, (Sat Sep 15, 11:40 am)
Re: crashme fault, Linus Torvalds, (Sat Sep 15, 12:44 pm)
Re: crashme fault, Randy Dunlap, (Sat Sep 15, 12:53 pm)
Re: crashme fault, Linus Torvalds, (Sat Sep 15, 3:15 pm)
Re: crashme fault, Linus Torvalds, (Sat Sep 15, 3:47 pm)
Re: crashme fault, Randy Dunlap, (Sat Sep 15, 4:47 pm)
Re: crashme fault, Linus Torvalds, (Sat Sep 15, 5:34 pm)
Re: crashme fault, Andi Kleen, (Sat Sep 15, 8:10 pm)
Re: crashme fault, Andrea Arcangeli, (Sun Sep 16, 8:53 am)
Re: crashme fault, Randy Dunlap, (Sun Sep 16, 9:17 am)
Re: crashme fault, Randy Dunlap, (Sun Sep 16, 9:40 am)
Re: crashme fault, Linus Torvalds, (Sun Sep 16, 10:14 am)
Re: crashme fault, Linus Torvalds, (Sun Sep 16, 11:12 am)
Re: crashme fault, Andi Kleen, (Sun Sep 16, 11:28 am)
Re: crashme fault, Randy Dunlap, (Sun Sep 16, 10:06 pm)
Re: crashme fault, Linus Torvalds, (Sun Sep 16, 10:28 pm)
Re: crashme fault, Randy Dunlap, (Mon Sep 17, 7:29 am)
Re: crashme fault, Linus Torvalds, (Mon Sep 17, 7:53 am)
Re: crashme fault, Randy Dunlap, (Mon Sep 17, 1:05 pm)