summaryrefslogtreecommitdiff
path: root/sys/compat/linux32
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2020-04-29 01:44:03 +0000
committerthorpej <thorpej@NetBSD.org>2020-04-29 01:44:03 +0000
commit862162e18b6fa2cd41dd30820570ba2c92aa466b (patch)
tree9935e505e70bdbce14db423a674f3cd8a44d70cd /sys/compat/linux32
parentbc1aa3a4dca16e3ef7127750aee1de7ae908668b (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/compat/linux32')
-rw-r--r--sys/compat/linux32/common/linux32_misc.c10
1 files changed, 6 insertions, 4 deletions
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),
&lts, sizeof(lts))) != 0) {