From fd32cb3a9c9f9399421408e8734cd8a6d9d1a09f Mon Sep 17 00:00:00 2001 From: Keshavamurthy Anil S Date: Mon, 25 Sep 2006 16:32:20 -0700 Subject: [IA64] kprobes: fixup the pagefault exception caused by probehandlers If the user-specified kprobe handler causes the page fault when accessing user space address, fixup this fault since do_page_fault() should not continue as the kprobe handler are run with preemption disabled. Signed-off-by: Anil S Keshavamurthy Signed-off-by: Andrew Morton Signed-off-by: Tony Luck --- arch/ia64/kernel/kprobes.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/ia64') diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index 320cb7a91c9d..169ec3a7156c 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -771,6 +771,12 @@ static int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr) */ if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr)) return 1; + /* + * In case the user-specified fault handler returned + * zero, try to fix up. + */ + if (ia64_done_with_exception(regs)) + return 1; /* * Let ia64_do_page_fault() fix it. -- cgit v1.2.3