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
This commit is contained in:
Linus Torvalds
2025-07-20 11:22:05 -07:00

View File

@@ -4,6 +4,7 @@
*
* Copyright 2021 Collabora Ltd.
*/
#include <linux/time_types.h>
#include <stdint.h>
#define u64_to_ptr(x) ((void *)(uintptr_t)(x))
@@ -65,7 +66,12 @@ struct futex32_numa {
static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
unsigned long flags, struct timespec *timo, clockid_t clockid)
{
return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
struct __kernel_timespec ts = {
.tv_sec = timo->tv_sec,
.tv_nsec = timo->tv_nsec,
};
return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, &ts, clockid);
}
/*