Skip to content

Commit 1caf7d5

Browse files
joelagnelbrauner
authored andcommitted
pidfd: Add warning if exit_state is 0 during notification
Previously a condition got missed where the pidfd waiters are awakened before the exit_state gets set. This can result in a missed notification [1] and the polling thread waiting forever. It is fixed now, however it would be nice to avoid this kind of issue going unnoticed in the future. So just add a warning to catch it in the future. /* References */ [1]: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Joel Fernandes (Google) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 3884ae4 commit 1caf7d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/signal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,7 @@ static void do_notify_pidfd(struct task_struct *task)
18851885
{
18861886
struct pid *pid;
18871887

1888+
WARN_ON(task->exit_state == 0);
18881889
pid = task_pid(task);
18891890
wake_up_all(&pid->wait_pidfd);
18901891
}

0 commit comments

Comments
 (0)