Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 5 Feb 2018 15:44:32 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] re-fix child reaping in wordexp

On Mon, Feb 05, 2018 at 11:18:45PM +0300, Alexander Monakov wrote:
> On Mon, 5 Feb 2018, Rich Felker wrote:
> > OK, that makes sense -- it's a matter of tiny window vs
> > unboundedly-large window. And in this case EINTR is not relevant; the
> > same unboundedly-large window can happen if you have a long-running
> > signal handler with SA_RESTART.
> 
> Hm, not sure I follow - can you elaborate? What is the timeline of events
> leading to an issue?

1. waitpid starts waiting for pid 42
2. signal arrives and handler begins running
3. pid 42 exits, gets reaped, and a new child with pid 42 appears
4. signal handler returns
5. waitpid resumes waiting for pid 42

For step 3, think of the signal handler as handling SIGCHLD, reaping
the child, and then doing some operation that might block, and the new
child with pid 42 getting created concurrently from another thread.

Rich

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.