Commit b05785fa authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Treehugger Robot
Browse files

FROMGIT: arm64: uapi: Provide correct __BITS_PER_LONG for the compat vDSO



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: default avatarJohn Stultz <jstultz@google.com>
Closes: https://lore.kernel.org/lkml/CANDhNCqvKOc9JgphQwr0eDyJiyG4oLFS9R8rSFvU0fpurrJFDg@mail.gmail.com/


Fixes: cd3557a7 ("vdso/gettimeofday: Add support for auxiliary clocks")
Signed-off-by: default avatarThomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarJohn Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20250821-vdso-arm64-compat-bitsperlong-v1-1-700bcabe7732@linutronix.de


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 9a6d3ff1
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git

 for-next/fixes)
Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
Bug: 438685242
Change-Id: Iee0b65e31f7407478c98ab466f0efa9e80b5d6dd
parent 9531007d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment