Skip to content

Commit

Permalink
Merge tag 'perf_urgent_for_v6.13_rc7' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

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
  • Loading branch information
Linus Torvalds committed Jan 12, 2025
2 parents f31acae + b583ef8 commit a603abe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,7 @@ void uprobe_free_utask(struct task_struct *t)
if (!utask)
return;

t->utask = NULL;
WARN_ON_ONCE(utask->active_uprobe || utask->xol_vaddr);

timer_delete_sync(&utask->ri_timer);
Expand All @@ -1924,7 +1925,6 @@ void uprobe_free_utask(struct task_struct *t)
ri = free_ret_instance(ri, true /* cleanup_hprobe */);

kfree(utask);
t->utask = NULL;
}

#define RI_TIMER_PERIOD (HZ / 10) /* 100 ms */
Expand Down

0 comments on commit a603abe

Please sign in to comment.