summaryrefslogtreecommitdiffstats
path: root/kernel/kprobes.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2022-08-23 01:53:21 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-08-23 01:53:21 +0200
commit1d9e325793db26a5f816cdc54346eeaed2af31a3 (patch)
tree4663a2a88ea1100335fcd636abefedbcded041dc /kernel/kprobes.c
parentMerge tag 'nfs-for-5.20-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs (diff)
parentkprobes: don't call disarm_kprobe() for disabled kprobes (diff)
downloadlinux-1d9e325793db26a5f816cdc54346eeaed2af31a3.tar.xz
linux-1d9e325793db26a5f816cdc54346eeaed2af31a3.zip
Merge branch 'mm-hotfixes-stable'
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r--kernel/kprobes.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 80697e5e03e4..08350e35aba2 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1707,11 +1707,12 @@ static struct kprobe *__disable_kprobe(struct kprobe *p)
/* Try to disarm and disable this/parent probe */
if (p == orig_p || aggr_kprobe_disabled(orig_p)) {
/*
- * If 'kprobes_all_disarmed' is set, 'orig_p'
- * should have already been disarmed, so
- * skip unneed disarming process.
+ * Don't be lazy here. Even if 'kprobes_all_disarmed'
+ * is false, 'orig_p' might not have been armed yet.
+ * Note arm_all_kprobes() __tries__ to arm all kprobes
+ * on the best effort basis.
*/
- if (!kprobes_all_disarmed) {
+ if (!kprobes_all_disarmed && !kprobe_disabled(orig_p)) {
ret = disarm_kprobe(orig_p, true);
if (ret) {
p->flags &= ~KPROBE_FLAG_DISABLED;