summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/brand/lx/syscall/lx_futex.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_futex.c b/usr/src/uts/common/brand/lx/syscall/lx_futex.c
index 3642b006c0..2a804dbcfe 100644
--- a/usr/src/uts/common/brand/lx/syscall/lx_futex.c
+++ b/usr/src/uts/common/brand/lx/syscall/lx_futex.c
@@ -24,7 +24,7 @@
*/
/*
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
*/
#include <sys/types.h>
@@ -408,6 +408,17 @@ futex_wait(memid_t *memid, caddr_t addr,
goto out;
}
+ /*
+ * We can't have hrtime and a timeout of 0. See below about
+ * CLOCK_REALTIME.
+ * On Linux this is is an invalid state anyway, so we'll short cut
+ * this early to avoid a panic from passing a null pointer to ts2hrt().
+ */
+ if (hrtime && timeout == NULL) {
+ err = set_errno(EINVAL);
+ goto out;
+ }
+
futex_hashin(fwp);
err = 0;