git: d7e1e138ec66 - main - linux(4): Fixup options value validation in linux_waitid().
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 31 Mar 2022 17:50:37 UTC
The branch main has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=d7e1e138ec66e410f525413b0caed089139f3cc0
commit d7e1e138ec66e410f525413b0caed089139f3cc0
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-03-31 17:41:19 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-03-31 17:41:19 +0000
linux(4): Fixup options value validation in linux_waitid().
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D31554
MFC after: 2 weeks
---
sys/compat/linux/linux_misc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 0d7f9b156f9b..e2c231ed3460 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1090,12 +1090,13 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args)
idtype_t idtype;
int error, options;
+ if (args->options & ~(LINUX_WNOHANG | LINUX_WNOWAIT | LINUX_WEXITED |
+ LINUX_WSTOPPED | LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL))
+ return (EINVAL);
+
options = 0;
linux_to_bsd_waitopts(args->options, &options);
- if (options & ~(WNOHANG | WNOWAIT | WEXITED | WUNTRACED | WCONTINUED))
- return (EINVAL);
-
switch (args->idtype) {
case LINUX_P_ALL:
idtype = P_ALL;