diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2022-03-31 17:49:39 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2022-06-17 19:33:46 +0000 |
commit | ccbef519e0c69cc19af2e56bd7ce307ca6daefee (patch) | |
tree | 54b0c68c2e0471cd434eb56026c5e6bf3181b893 | |
parent | 65d3f90d13b65087c3f8df1ed28bed5414d94e3b (diff) |
linux(4): wait4() returns ESRCH if pid is INT_MIN.
Weird and undocumented patch was added to the Linux kernel in 2017,
fixes wait403 LTP test.
MFC after: 2 weeks
(cherry picked from commit 9103c5582a2d271fa8f4df136ae511da572c660f)
-rw-r--r-- | sys/compat/linux/linux_misc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index ea7dafec0849..fa7d364681dc 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1054,6 +1054,10 @@ linux_wait4(struct thread *td, struct linux_wait4_args *args) LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) return (EINVAL); + /* -INT_MIN is not defined. */ + if (args->pid == INT_MIN) + return (ESRCH); + options = 0; linux_to_bsd_waitopts(args->options, &options); |