From fc234a4be7957691aa5c77a740971d95c22263ab Mon Sep 17 00:00:00 2001 From: Prashanth Nageshappa Date: Mon, 5 Mar 2012 14:59:12 -0800 Subject: [PATCH] --- yaml --- r: 288233 b: refs/heads/master c: f986a499ef6f317d906e6f6f281be966e1237a10 h: refs/heads/master i: 288231: cc3b478d3c231b7f79fcbea2d5f9683131b10905 v: v3 --- [refs] | 2 +- trunk/kernel/kprobes.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index b221ddc33da4..49fe1d1985a3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c22ab332902333f83766017478c1ef6607ace681 +refs/heads/master: f986a499ef6f317d906e6f6f281be966e1237a10 diff --git a/trunk/kernel/kprobes.c b/trunk/kernel/kprobes.c index 9788c0ec6f43..c62b8546cc90 100644 --- a/trunk/kernel/kprobes.c +++ b/trunk/kernel/kprobes.c @@ -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; @@ -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 @@ -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 */ } @@ -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;