Re: [tip:x86/mm] x86, mm: NX protection for kernel data

From: castet . matthieu
Date: Tue Mar 02 2010 - 11:23:46 EST




> At this point I need some help and guidance on how to track down what
> exactly happens there, as I am not very familiar with what goes into
> .data and why are we trying to execute it.
Can't you add debug printk in the fault handler before any exception processing

Something like that.

Matthieu

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index f627779..578ba52 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -629,6 +629,8 @@ no_context(struct pt_regs *regs, unsigned long error_code,
unsigned long flags;
int sig;

+ if (error_code & PF_INSTR)
+ printk("exec on NX\n");
/* Are we prepared to handle this kernel fault? */
if (fixup_exception(regs))
return;