Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat Oops, fix a silly mistake in the Linux futex sysc...
details: https://anonhg.NetBSD.org/src/rev/4788515f0426
branches: trunk
changeset: 1009622:4788515f0426
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Apr 29 01:44:03 2020 +0000
description:
Oops, fix a silly mistake in the Linux futex syscall stubs -- we also
copy in the timeout for FUTEX_WAIT_BITSET.
diffstat:
sys/compat/linux/common/linux_futex.c | 10 ++++++----
sys/compat/linux32/common/linux32_misc.c | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diffs (64 lines):
diff -r 3a2e2cff0a72 -r 4788515f0426 sys/compat/linux/common/linux_futex.c
--- a/sys/compat/linux/common/linux_futex.c Tue Apr 28 22:29:32 2020 +0000
+++ b/sys/compat/linux/common/linux_futex.c Wed Apr 29 01:44:03 2020 +0000
@@ -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 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 -r 3a2e2cff0a72 -r 4788515f0426 sys/compat/linux32/common/linux32_misc.c
--- a/sys/compat/linux32/common/linux32_misc.c Tue Apr 28 22:29:32 2020 +0000
+++ b/sys/compat/linux32/common/linux32_misc.c Wed Apr 29 01:44:03 2020 +0000
@@ -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 @@
/*
* 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) {
Home |
Main Index |
Thread Index |
Old Index