Message ID | 20180719083756.25221-2-colin.king@canonical.com |
---|---|
State | New |
Headers | show |
Series | kernel/exit.c: avoid undefined behaviour when calling wait4() | expand |
diff --git a/kernel/exit.c b/kernel/exit.c index 81b3d67..9edcf2d 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1639,6 +1639,10 @@ SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, __WNOTHREAD|__WCLONE|__WALL)) return -EINVAL; + /* -INT_MIN is not defined */ + if (upid == INT_MIN) + return -ESRCH; + if (upid == -1) type = PIDTYPE_MAX; else if (upid < 0) {