Re: [RFC][PATCHSET] wait4()/waitid() cleanups

From: Eric W. Biederman
Date: Wed May 17 2017 - 16:03:56 EST


Al Viro <viro@xxxxxxxxxxxxxxxxxx> writes:

> This series switches compat wait4() and waitid() variants away
> from set_fs() use. A couple of helpers (kernel_wait4() and kernel_waitid())
> are introduced, copying siginfo/rusage to userland is taken to sys_wait...().
> That allows both to simplify the guts of do_wait() machinery and avoid
> messing with set_fs() in compat variants of these syscalls.
>
> Lightly tested, seems to survive without regressions. Please,
> review.

A quick heads up. I have a patchset that is almost ready to go that is
also extensively touching wait. The point of that patchset is to get
the logic correct in the intersection ptrace, threads, signals, and wait.

As an example of things that are obviously wrong today. In the case of
a ptrace stop we can set si_code to either CLD_STOPPED or CLD_TRAPPED
but in waitid we always return for the same set of conditions
CLD_TRAPPED.

I don't believe we have any fundamental conflicts but if we aren't
careful we could have a nasty merge conflict.

Eric