- i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     i386: Fix machine_check entry point in entry.S to not dereference kernel memory from user space context
has been removed from the -mm tree.  Its filename was
     i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context.patch

This patch was dropped because it was nacked by the maintainer

------------------------------------------------------
Subject: i386: Fix machine_check entry point in entry.S to not dereference kernel memory from user space context
From: Neil Horman <nhorman@xxxxxxxxxxxxx>

It appears that when the i386 arch traps on a machine check, the code in
entry.S loads the vector pointed to by the machine_check_vector kernel
varialbe.  Since this happens before the switch to the kernel context in
error_code, the result is an oops, if the reverenced address is unmapped,
or silent memory corruption if the address is mapped.

This patch corrects that, by jumping instead to a statically allocated
kernel function instead, allowing us to load a static value, rather than
the contents of a memory address before the switch to kernel context, like
all of our other entry points do.

Signed-off-by: Neil Horman <nhorman@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/kernel/cpu/mcheck/mce.c |    5 +++++
 arch/i386/kernel/cpu/mcheck/mce.h |    1 +
 arch/i386/kernel/entry.S          |    2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff -puN arch/i386/kernel/cpu/mcheck/mce.c~i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context arch/i386/kernel/cpu/mcheck/mce.c
--- a/arch/i386/kernel/cpu/mcheck/mce.c~i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context
+++ a/arch/i386/kernel/cpu/mcheck/mce.c
@@ -29,6 +29,11 @@ static fastcall void unexpected_machine_
 /* Call the installed machine check handler for this CPU setup. */
 void fastcall (*machine_check_vector)(struct pt_regs *, long error_code) = unexpected_machine_check;
 
+asmlinkage void do_machine_check(struct pt_regs *regs, long error_code)
+{
+	machine_check_vector(regs, error_code);
+}
+
 /* This has to be run for each processor */
 void mcheck_init(struct cpuinfo_x86 *c)
 {
diff -puN arch/i386/kernel/cpu/mcheck/mce.h~i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context arch/i386/kernel/cpu/mcheck/mce.h
--- a/arch/i386/kernel/cpu/mcheck/mce.h~i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context
+++ a/arch/i386/kernel/cpu/mcheck/mce.h
@@ -8,6 +8,7 @@ void winchip_mcheck_init(struct cpuinfo_
 
 /* Call the installed machine check handler for this CPU setup. */
 extern fastcall void (*machine_check_vector)(struct pt_regs *, long error_code);
+extern asmlinkage void do_machine_check(struct pt_regs *, long error_code);
 
 extern int mce_disabled;
 extern int nr_mce_banks;
diff -puN arch/i386/kernel/entry.S~i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context arch/i386/kernel/entry.S
--- a/arch/i386/kernel/entry.S~i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context
+++ a/arch/i386/kernel/entry.S
@@ -964,7 +964,7 @@ ENTRY(machine_check)
 	RING0_INT_FRAME
 	pushl $0
 	CFI_ADJUST_CFA_OFFSET 4
-	pushl machine_check_vector
+	pushl $do_machine_check
 	CFI_ADJUST_CFA_OFFSET 4
 	jmp error_code
 	CFI_ENDPROC
_

Patches currently in -mm which might be from nhorman@xxxxxxxxxxxxx are

i386-fix-machine_check-entry-point-in-entrys-to-not-dereference-kernel-memory-from-user-space-context.patch
correct-misc_register-return-code-handling-in-several-drivers.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux