diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 3e7f12009e9e..911c77ef5bbc 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -2122,6 +2122,10 @@ int register_kretprobe(struct kretprobe *rp) if (ret) return ret; + /* If only rp->kp.addr is specified, check reregistering kprobes */ + if (rp->kp.addr && check_kprobe_rereg(&rp->kp)) + return -EINVAL; + if (kretprobe_blacklist_size) { addr = kprobe_addr(&rp->kp); if (IS_ERR(addr))