pidfd: Add warning if exit_state is 0 during notification
PATCH 1/1 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.
[1] https://lore.kernel.org/lkml/[email protected]/
--- kernel/signal.c | 1 + 1 file changed, 1 insertion(+)
kernel/signal.c +1 -0
@@ -1885,6 +1885,7 @@ static void do_notify_pidfd(struct task_struct *task) {struct pid *pid; +WARN_ON (task->exit_state ==0 ); pid =task_pid (task);wake_up_all (&pid->wait_pidfd); }
Signature · 1 line
2.22.0.657.g960e92d24f-goog
Quoted 29 lines · Joel Fernandes (Google)
Previously a condition got missed where the pidfd waiters are awakened before the
exit_stategets 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.
[1]
https://lore.kernel.org/lkml/[email protected]/Signed-off-by Joel Fernandes (Google) <[email protected]>---
kernel/signal.c| 1 +1 file changed, 1 insertion(+)kernel/signal.c +1
-0@@ -1885,6 +1885,7 @@ static void do_notify_pidfd(struct task_struct *task) {struct pid *pid; +WARN_ON (task->exit_state ==0 ); pid =task_pid (task);wake_up_all (&pid->wait_pidfd);
Quoted 1 line
}
Makes sense to me.
I'm picking this up unless someone sees a problem with this patch.