Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182452
b: refs/heads/master
c: 4554dbc
h: refs/heads/master
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Feb 4, 2010
1 parent 7c95382 commit 1ae776c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cfa19780d61740f65790c5bae363b759d7c96fa
refs/heads/master: 4554dbcb85a4ed2abaa2b6fa15649b796699ec89
3 changes: 3 additions & 0 deletions trunk/arch/x86/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)

int __kprobes arch_prepare_kprobe(struct kprobe *p)
{
if (alternatives_text_reserved(p->addr, p->addr))
return -EINVAL;

if (!can_probe((unsigned long)p->addr))
return -EILSEQ;
/* insn: must be on special executable page on x86. */
Expand Down
4 changes: 3 additions & 1 deletion trunk/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <linux/debugfs.h>
#include <linux/kdebug.h>
#include <linux/memory.h>
#include <linux/ftrace.h>

#include <asm-generic/sections.h>
#include <asm/cacheflush.h>
Expand Down Expand Up @@ -703,7 +704,8 @@ int __kprobes register_kprobe(struct kprobe *p)

preempt_disable();
if (!kernel_text_address((unsigned long) p->addr) ||
in_kprobes_functions((unsigned long) p->addr)) {
in_kprobes_functions((unsigned long) p->addr) ||
ftrace_text_reserved(p->addr, p->addr)) {
preempt_enable();
return -EINVAL;
}
Expand Down

0 comments on commit 1ae776c

Please sign in to comment.