Pull perf fix from Borislav Petkov: - Fix a #GP in the perf user callchain code caused by a race between uprobe freeing the task and the bpf profiler unwinding the task's user stack * tag 'perf_urgent_for_v6.13_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: uprobes: Fix race in uprobe_free_utask
Unified · Split
| @@ -1915,6 +1915,7 @@ void uprobe_free_utask(struct task_struct *t) · 1914 unmodified lines | ||
| 1915 | 1915 | if (!utask) |
| 1916 | 1916 | return; |
| 1917 | 1917 | |
| 1918 | + t->utask = NULL; | |
| 1918 | 1919 | WARN_ON_ONCE(utask->active_uprobe || utask->xol_vaddr); |
| 1919 | 1920 | |
| 1920 | 1921 | timer_delete_sync(&utask->ri_timer); |
| @@ -1924,7 +1925,6 @@ void uprobe_free_utask(struct task_struct *t) · 3 unmodified lines | ||
| 1924 | 1925 | ri = free_ret_instance(ri, true /* cleanup_hprobe */); |
| 1925 | 1926 | |
| 1926 | 1927 | kfree(utask); |
| 1927 | − t->utask = NULL; | |
| 1928 | 1928 | } |
| 1929 | 1929 | |
| 1930 | 1930 | #define RI_TIMER_PERIOD (HZ / 10) /* 100 ms */ |