[(take 2)patch 6/7] Kprobes registers for notify page fault

Anil S Keshavamurthy
2006-04-20T23:52:47Z

[-- Attachment #1: notify_page_fault_kprobes.patch --]
[-- Type: text/plain, Size: 898 bytes --]

---
kernel/kprobes.c | 8 ++++++++
1 file changed, 8 insertions(+)

Index: linux-2.6.17-rc1-mm3/kernel/kprobes.c
===================================================================
--- linux-2.6.17-rc1-mm3.orig/kernel/kprobes.c
+++ linux-2.6.17-rc1-mm3/kernel/kprobes.c
@@ -544,6 +544,11 @@ static struct notifier_block kprobe_exce
.priority = 0x7fffffff /* we need to notified first */
};

+static struct notifier_block kprobe_page_fault_nb = {
+ .notifier_call = kprobe_exceptions_notify,
+ .priority = 0x7fffffff /* we need to notified first */
+};
+
int __kprobes register_jprobe(struct jprobe *jp)
{
/* Todo: Verify probepoint is a function entry point */
@@ -654,6 +659,9 @@ static int __init init_kprobes(void)
if (!err)
err = register_die_notifier(&kprobe_exceptions_nb);

+ if (!err)
+ err = register_page_fault_notifier(&kprobe_page_fault_nb);
+
return err;
}

--