diff options
author | bibo,mao <bibo.mao@intel.com> | 2006-03-26 04:38:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:04 -0500 |
commit | 2326c77017c79fd6d55c69d8a49a57a252921bcd (patch) | |
tree | 5a2cafc7452953a4d5c8a8e8eaa0ae34fe306f74 /arch/x86_64 | |
parent | c6fd91f0bdcd294a0ae0ba2b2a7f7456ef4b7144 (diff) |
[PATCH] kprobe handler: discard user space trap
Currently kprobe handler traps only happen in kernel space, so function
kprobe_exceptions_notify should skip traps which happen in user space.
This patch modifies this, and it is based on 2.6.16-rc4.
Signed-off-by: bibo mao <bibo.mao@intel.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>
Cc: <hiramatu@sdl.hitachi.co.jp>
Signed-off-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/kprobes.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c index 14f0ced613b6..218e015c3195 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86_64/kernel/kprobes.c | |||
@@ -601,6 +601,9 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
601 | struct die_args *args = (struct die_args *)data; | 601 | struct die_args *args = (struct die_args *)data; |
602 | int ret = NOTIFY_DONE; | 602 | int ret = NOTIFY_DONE; |
603 | 603 | ||
604 | if (args->regs && user_mode(args->regs)) | ||
605 | return ret; | ||
606 | |||
604 | switch (val) { | 607 | switch (val) { |
605 | case DIE_INT3: | 608 | case DIE_INT3: |
606 | if (kprobe_handler(args->regs)) | 609 | if (kprobe_handler(args->regs)) |