[PATCH 1/3] arm64: uapi: Provide correct __BITS_PER_LONG for the compat vDSO

John Stultz jstultz at google.com
Thu Aug 21 10:09:47 PDT 2025


On Thu, Aug 21, 2025 at 12:56 AM Thomas Weißschuh
<thomas.weissschuh at linutronix.de> wrote:
>
> The generic vDSO library uses the UAPI headers. On arm64 __BITS_PER_LONG is
> always '64' even when used from the compat vDSO. In that case __GENMASK()
> does an illegal bitshift, invoking undefined behaviour.
>
> Change __BITS_PER_LONG to also work when used from the comapt vDSO.
> To not confuse real userspace, only do this when building the kernel.
>
> Reported-by: John Stultz <jstultz at google.com>
> Closes: https://lore.kernel.org/lkml/CANDhNCqvKOc9JgphQwr0eDyJiyG4oLFS9R8rSFvU0fpurrJFDg@mail.gmail.com/
> Fixes: cd3557a7618b ("vdso/gettimeofday: Add support for auxiliary clocks")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>

Tested-by: John Stultz <jstultz at google.com>

Thank you so much for the quick fix!
-john



More information about the linux-arm-kernel mailing list