Merge tag 'perf-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull uprobes fix from Ingo Molnar:

 - Fix uretprobes race that can crash the kernel (Breno Leitao)

* tag 'perf-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  uprobes: Fix NULL pointer dereference in hprobe_expire()
This commit is contained in:
Linus Torvalds
2026-08-02 11:32:42 -07:00

View File

@@ -830,7 +830,7 @@ static struct uprobe *hprobe_expire(struct hprobe *hprobe, bool get)
if (try_cmpxchg(&hprobe->state, &hstate, uprobe ? HPROBE_STABLE : HPROBE_GONE)) {
/* We won the race, we are the ones to unlock SRCU */
__srcu_read_unlock(&uretprobes_srcu, hprobe->srcu_idx);
return get ? get_uprobe(uprobe) : uprobe;
return get && uprobe ? get_uprobe(uprobe) : uprobe;
}
/*