summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-11-04 08:58:36 +0900
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-11-05 09:09:41 +0900
commit2053bac1d6e47b33fa2e570c87518395e64f7da0 (patch)
tree41368fe0d32186d58d6c5f73e3196a5d76750557 /include/linux/timerqueue.h
parent6a658cc2d605e5acf35e638c62f480460d5939cd (diff)
kprobes: Fix double free and NULL deref in unregister_kretprobes()
In unregister_kretprobes(), if __unregister_kprobe_top() returns an error (e.g., if the kretprobe was not registered or was already unregistered), rethook_free(rps[i]->rh) or rcu_assign_pointer(rps[i]->rph->rp, NULL) is still executed. For rethook-based kretprobes, calling rethook_free() on an already-freed rethook causes a double-free / list corruption in RCU. For legacy kretprobes, rps[i]->rph is NULL after previous cleanup, resulting in a NULL pointer dereference. Skip rethook_free() and rph cleanup if __unregister_kprobe_top() fails, and clear rps[i]->rh after synchronize_rcu() has waited for in-flight pre_handler_kretprobe() invocations to complete. Link: https://lore.kernel.org/all/179375031660.247640.6349602689169856649.stgit@devnote2/ Fixes: 73f9b911faa7 ("kprobes: Use rethook for kretprobe if possible") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions