lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABeuJB3QYKqEb2YZjCicGVFkrZTCgdU+dMM90B6OHUuvUSrWaA@mail.gmail.com>
Date: Tue, 1 Jul 2025 15:31:05 +0100
From: Terry Tritton <terry.tritton@...aro.org>
To: Thomas Gleixner <tglx@...utronix.de>, Shuah Khan <shuah@...nel.org>, Ingo Molnar <mingo@...hat.com>, 
	Peter Zijlstra <peterz@...radead.org>, Darren Hart <dvhart@...radead.org>, 
	Davidlohr Bueso <dave@...olabs.net>, André Almeida <andrealmeid@...lia.com>
Cc: ttritton@...gle.com, linux-kselftest@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Wei Gao <wegao@...e.com>
Subject: Re: [PATCH v2] selftests/futex: Convert 32bit timespec struct to
 64bit version for 32bit compatibility mode

Sorry forgot to save the change log before sending.
v2: fix Signed-off-by chain

On Tue, 1 Jul 2025 at 15:23, Terry Tritton <terry.tritton@...aro.org> wrote:
>
> Futex_waitv can not accept old_timespec32 struct, so userspace should
> convert it from 32bit to 64bit before syscall in 32bit compatible mode.
>
> This fix is based off [1]
>
> Link: https://lore.kernel.org/all/20231203235117.29677-1-wegao@suse.com/ [1]
>
> Signed-off-by: Wei Gao <wegao@...e.com>
> Signed-off-by: Terry Tritton <terry.tritton@...aro.org>
> ---
>  .../testing/selftests/futex/include/futex2test.h  | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/tools/testing/selftests/futex/include/futex2test.h b/tools/testing/selftests/futex/include/futex2test.h
> index ea79662405bc..6780e51eb2d6 100644
> --- a/tools/testing/selftests/futex/include/futex2test.h
> +++ b/tools/testing/selftests/futex/include/futex2test.h
> @@ -55,6 +55,13 @@ struct futex32_numa {
>         futex_t numa;
>  };
>
> +#if !defined(__LP64__)
> +struct timespec64 {
> +       int64_t tv_sec;
> +       int64_t tv_nsec;
> +};
> +#endif
> +
>  /**
>   * futex_waitv - Wait at multiple futexes, wake on any
>   * @waiters:    Array of waiters
> @@ -65,7 +72,15 @@ 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)
>  {
> +#if !defined(__LP64__)
> +       struct timespec64 timo64 = {0};
> +
> +       timo64.tv_sec = timo->tv_sec;
> +       timo64.tv_nsec = timo->tv_nsec;
> +       return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, &timo64, clockid);
> +#else
>         return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
> +#endif
>  }
>
>  /*
> --
> 2.39.5
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ