Re: [PATCH] pidfd: Add warning if exit_state is 0 during notification
From: Christian Brauner
Date: Wed Jul 24 2019 - 12:53:52 EST
On July 24, 2019 6:48:16 PM GMT+02:00, "Joel Fernandes (Google)" <joel@xxxxxxxxxxxxxxxxx> wrote:
>Previously a condition got missed where the pidfd waiters are awakened
>before the exit_state gets set. This can result in a missed
> 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
>Signed-off-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
> kernel/signal.c | 1 +
> 1 file changed, 1 insertion(+)
>diff --git a/kernel/signal.c b/kernel/signal.c
>index 91b789dd6e72..349f5a67f100 100644
>@@ -1885,6 +1885,7 @@ static void do_notify_pidfd(struct task_struct
> struct pid *pid;
>+ WARN_ON(task->exit_state == 0);
> pid = task_pid(task);
Makes sense to me.
I'm picking this up unless someone sees a problem with this patch.
Reviewed-by: Christian Brauner <christian@xxxxxxxxxx>