Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288233
b: refs/heads/master
c: f986a49
h: refs/heads/master
i:
  288231: cc3b478
v: v3
  • Loading branch information
Prashanth Nageshappa authored and Linus Torvalds committed Mar 5, 2012
1 parent abf2ecd commit fc234a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: c22ab332902333f83766017478c1ef6607ace681
refs/heads/master: f986a499ef6f317d906e6f6f281be966e1237a10
12 changes: 7 additions & 5 deletions trunk/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,8 +1334,10 @@ int __kprobes register_kprobe(struct kprobe *p)
if (!kernel_text_address((unsigned long) p->addr) ||
in_kprobes_functions((unsigned long) p->addr) ||
ftrace_text_reserved(p->addr, p->addr) ||
jump_label_text_reserved(p->addr, p->addr))
goto fail_with_jump_label;
jump_label_text_reserved(p->addr, p->addr)) {
ret = -EINVAL;
goto cannot_probe;
}

/* User can pass only KPROBE_FLAG_DISABLED to register_kprobe */
p->flags &= KPROBE_FLAG_DISABLED;
Expand All @@ -1352,7 +1354,7 @@ int __kprobes register_kprobe(struct kprobe *p)
* its code to prohibit unexpected unloading.
*/
if (unlikely(!try_module_get(probed_mod)))
goto fail_with_jump_label;
goto cannot_probe;

/*
* If the module freed .init.text, we couldn't insert
Expand All @@ -1361,7 +1363,7 @@ int __kprobes register_kprobe(struct kprobe *p)
if (within_module_init((unsigned long)p->addr, probed_mod) &&
probed_mod->state != MODULE_STATE_COMING) {
module_put(probed_mod);
goto fail_with_jump_label;
goto cannot_probe;
}
/* ret will be updated by following code */
}
Expand Down Expand Up @@ -1409,7 +1411,7 @@ int __kprobes register_kprobe(struct kprobe *p)

return ret;

fail_with_jump_label:
cannot_probe:
preempt_enable();
jump_label_unlock();
return ret;
Expand Down

0 comments on commit fc234a4

Please sign in to comment.