[PATCH 2/2] i386: Disallow kprobes on NMI handlers

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

 



A kprobe executes IRET early and that could cause NMI recursion and stack
corruption.

Note: This problem was originally identified by Andi Kleen. This patch
      adds fixes not included in his original patch.

Signed-off-by: Fernando Vazquez <[email protected]>
---

diff -urNp linux-2.6.18-rc4-orig/arch/i386/kernel/mca.c linux-2.6.18-rc4/arch/i386/kernel/mca.c
--- linux-2.6.18-rc4-orig/arch/i386/kernel/mca.c	2006-08-10 17:24:15.000000000 +0900
+++ linux-2.6.18-rc4/arch/i386/kernel/mca.c	2006-08-10 19:34:37.000000000 +0900
@@ -414,7 +414,8 @@ subsys_initcall(mca_init);
 
 /*--------------------------------------------------------------------*/
 
-static void mca_handle_nmi_device(struct mca_device *mca_dev, int check_flag)
+static __kprobes void
+mca_handle_nmi_device(struct mca_device *mca_dev, int check_flag)
 {
 	int slot = mca_dev->slot;
 
@@ -444,7 +445,7 @@ static void mca_handle_nmi_device(struct
 
 /*--------------------------------------------------------------------*/
 
-static int mca_handle_nmi_callback(struct device *dev, void *data)
+static int __kprobes mca_handle_nmi_callback(struct device *dev, void *data)
 {
 	struct mca_device *mca_dev = to_mca_device(dev);
 	unsigned char pos5;
@@ -462,7 +463,7 @@ static int mca_handle_nmi_callback(struc
 	return 0;
 }
 
-void mca_handle_nmi(void)
+void __kprobes mca_handle_nmi(void)
 {
 	/* First try - scan the various adapters and see if a specific
 	 * adapter was responsible for the error.


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux