diff options
| author | thorpej <thorpej@NetBSD.org> | 2020-04-29 01:44:03 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2020-04-29 01:44:03 +0000 |
| commit | 862162e18b6fa2cd41dd30820570ba2c92aa466b (patch) | |
| tree | 9935e505e70bdbce14db423a674f3cd8a44d70cd /sys | |
| parent | bc1aa3a4dca16e3ef7127750aee1de7ae908668b (diff) | |
Oops, fix a silly mistake in the Linux futex syscall stubs -- we also
copy in the timeout for FUTEX_WAIT_BITSET.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/compat/linux/common/linux_futex.c | 10 | ||||
| -rw-r--r-- | sys/compat/linux32/common/linux32_misc.c | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/compat/linux/common/linux_futex.c b/sys/compat/linux/common/linux_futex.c index 36a014a3506..ae6f87eee8b 100644 --- a/sys/compat/linux/common/linux_futex.c +++ b/sys/compat/linux/common/linux_futex.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_futex.c,v 1.39 2020/04/26 18:53:33 thorpej Exp $ */ +/* $NetBSD: linux_futex.c,v 1.40 2020/04/29 01:44:03 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.39 2020/04/26 18:53:33 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: linux_futex.c,v 1.40 2020/04/29 01:44:03 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -66,9 +66,11 @@ linux_sys_futex(struct lwp *l, const struct linux_sys_futex_args *uap, /* * Linux overlays the "timeout" field and the "val2" field. - * "timeout" is only valid for FUTEX_WAIT on Linux. + * "timeout" is only valid for FUTEX_WAIT and FUTEX_WAIT_BITSET + * on Linux. */ - if ((SCARG(uap, op) & FUTEX_CMD_MASK) == FUTEX_WAIT && + const int op = (SCARG(uap, op) & FUTEX_CMD_MASK); + if ((op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET) && SCARG(uap, timeout) != NULL) { if ((error = copyin(SCARG(uap, timeout), <s, sizeof(lts))) != 0) { diff --git a/sys/compat/linux32/common/linux32_misc.c b/sys/compat/linux32/common/linux32_misc.c index 83a1ac94307..d72b0cd7b5c 100644 --- a/sys/compat/linux32/common/linux32_misc.c +++ b/sys/compat/linux32/common/linux32_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_misc.c,v 1.28 2020/04/26 18:53:33 thorpej Exp $ */ +/* $NetBSD: linux32_misc.c,v 1.29 2020/04/29 01:44:03 thorpej Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.28 2020/04/26 18:53:33 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.29 2020/04/29 01:44:03 thorpej Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -250,9 +250,11 @@ linux32_sys_futex(struct lwp *l, /* * Linux overlays the "timeout" field and the "val2" field. - * "timeout" is only valid for FUTEX_WAIT on Linux. + * "timeout" is only valid for FUTEX_WAIT and FUTEX_WAIT_BITSET + * on Linux. */ - if ((SCARG(uap, op) & FUTEX_CMD_MASK) == FUTEX_WAIT && + const int op = (SCARG(uap, op) & FUTEX_CMD_MASK); + if ((op == FUTEX_WAIT || op == FUTEX_WAIT_BITSET) && SCARG_P32(uap, timeout) != NULL) { if ((error = copyin(SCARG_P32(uap, timeout), <s, sizeof(lts))) != 0) { |
