Re: [PATCH 1/3] arm64: uapi: Provide correct __BITS_PER_LONG for the compat vDSO
From: John Stultz
Date: Thu Aug 21 2025 - 13:10:10 EST
On Thu, Aug 21, 2025 at 12:56 AM Thomas Weißschuh
<thomas.weissschuh@xxxxxxxxxxxxx> 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@xxxxxxxxxx>
> Closes: https://lore.kernel.org/lkml/CANDhNCqvKOc9JgphQwr0eDyJiyG4oLFS9R8rSFvU0fpurrJFDg@xxxxxxxxxxxxxx/
> Fixes: cd3557a7618b ("vdso/gettimeofday: Add support for auxiliary clocks")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
Tested-by: John Stultz <jstultz@xxxxxxxxxx>
Thank you so much for the quick fix!
-john