Re: [PATCH 3/4] perf: Fix event leak upon exit

From: Sebastian Andrzej Siewior
Date: Thu Jun 06 2024 - 06:09:00 EST


On 2024-05-16 16:09:35 [+0200], Frederic Weisbecker wrote:
> When a task is scheduled out, pending sigtrap deliveries are deferred
> to the target task upon resume to userspace via task_work.
>
> However failures while adding en event's callback to the task_work
an
> engine are ignored. And since the last call for events exit happen
> after task work is eventually closed, there is a small window during
> which pending sigtrap can be queued though ignored, leaking the event
> refcount addition such as in the following scenario:

Sebastian