Skip to content

Commit 92329d5

Browse files
committed
Merge tag 'locking-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Thomas Gleixner: "A single fix for the futex selftest code to make 32-bit user space work correctly on 64-bit kernels. sys_futex_wait() expects a struct __kernel_timespec for the timeout, but the selftest uses struct timespec, which is the original 32-bit non 2038 compliant variant. Fix it up by converting the callsite supplied timespec to a __kernel_timespec and hand that into the syscall" * tag 'locking-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: selftests/futex: Convert 32-bit timespec to 64-bit version for 32-bit compatibility mode
2 parents 62347e2 + d0a48dc commit 92329d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/testing/selftests/futex/include/futex2test.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
* Copyright 2021 Collabora Ltd.
66
*/
7+
#include <linux/time_types.h>
78
#include <stdint.h>
89

910
#define u64_to_ptr(x) ((void *)(uintptr_t)(x))
@@ -65,7 +66,12 @@ struct futex32_numa {
6566
static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
6667
unsigned long flags, struct timespec *timo, clockid_t clockid)
6768
{
68-
return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
69+
struct __kernel_timespec ts = {
70+
.tv_sec = timo->tv_sec,
71+
.tv_nsec = timo->tv_nsec,
72+
};
73+
74+
return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, &ts, clockid);
6975
}
7076

7177
/*

0 commit comments

Comments
 (0)