Re: [PATCH] fork/pid: Fix use-after-free in __task_pid_nr_ns

From: Oleg Nesterov

Date: Wed Jan 07 2026 - 09:54:26 EST


On 01/07, Qing Wang wrote:
>
> I agree with your idea. But we don't need to fix this issue anymore,
> because after reviewing the current mainline code, I found that it has
> already been resolved(c418d8b4d7a4 "perf/core: Fix missing read event
> generation on task exit") by moving sync_child_event() from
> perf_child_detach() into perf_event_exit_event().
>
> Here https://patch.msgid.link/20251209041600.963586-1-thaumy.love@xxxxxxxxx
>
> As a result, perf_event_read_event() no longer occurs on the problematic
> path reported (i.e., the close()->perf_release() path).

Great, thanks. So we can forget this problem ;)

Oleg.