Re: [GIT PULL] Please pull proc and exec work for 5.7-rc1

From: Eric W. Biederman
Date: Thu Apr 09 2020 - 17:03:39 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> On Thu, Apr 9, 2020 at 12:57 PM Bernd Edlinger
> <bernd.edlinger@xxxxxxxxxx> wrote:
>>
>> The use case where this may happen with strace
>> when you call strace with lots of -p <pid> arguments,
>> and one of them is a bomb. strace stuck.
>
> Yeah, so from a convenience angle I do agree that it would be nicer to
> just not count dead threads.
>
> You can test that by just moving the
>
> /* Don't bother with already dead threads */
> if (t->exit_state)
> continue;
>
> test in zap_other_threads() to above the
>
> count++;
>
> line instead.

That looks like a legitimate race, and something worth addressing. It
doesn't look like t->exit_state has siglock protection so I don't think
testing it under siglock would fix that race. But something like that
certainly should.

But no. While you are goind a good job at spotting odd corner
cases that need to be fixed. This also is not the cause of the
deadlock. It is nothing that subtle.

Eric