wait: allow sys_waitid() to accept __WNOTHREAD/__WCLONE/__WALL
authorOleg Nesterov <[email protected]>
Mon, 23 May 2016 23:23:53 +0000 (16:23 -0700)
committerLinus Torvalds <[email protected]>
Tue, 24 May 2016 00:04:14 +0000 (17:04 -0700)
I see no reason why waitid() can't support other linux-specific flags
allowed in sys_wait4().

In particular this change can help if we reconsider the previous change
("wait/ptrace: assume __WALL if the child is traced") which adds the
"automagical" __WALL for debugger.

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Jan Kratochvil <[email protected]>
Cc: "Michael Kerrisk (man-pages)" <[email protected]>
Cc: Pedro Alves <[email protected]>
Cc: Roland McGrath <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/exit.c

index 44fbe6edd7feb5c29c48a004ceda91d8dad2097b..9e6e1356e6bbc2dbb2aeb9ef5b2b02d05961ad3c 100644 (file)
@@ -1535,7 +1535,8 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
        enum pid_type type;
        long ret;
 
-       if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED))
+       if (options & ~(WNOHANG|WNOWAIT|WEXITED|WSTOPPED|WCONTINUED|
+                       __WNOTHREAD|__WCLONE|__WALL))
                return -EINVAL;
        if (!(options & (WEXITED|WSTOPPED|WCONTINUED)))
                return -EINVAL;