linux/arch/arm64/include/uapi/asm
Thomas Weißschuh 9a6d3ff10f 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: John Stultz <jstultz@google.com>
Closes: https://lore.kernel.org/lkml/CANDhNCqvKOc9JgphQwr0eDyJiyG4oLFS9R8rSFvU0fpurrJFDg@mail.gmail.com/
Fixes: cd3557a761 ("vdso/gettimeofday: Add support for auxiliary clocks")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20250821-vdso-arm64-compat-bitsperlong-v1-1-700bcabe7732@linutronix.de
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2025-09-03 12:07:23 +01:00
..
Kbuild arm64: generate 64-bit syscall.tbl 2024-07-10 14:23:38 +02:00
auxvec.h
bitsperlong.h arm64: uapi: Provide correct __BITS_PER_LONG for the compat vDSO 2025-09-03 12:07:23 +01:00
bpf_perf_event.h
byteorder.h
fcntl.h
hwcap.h arm64/hwcaps: Add MTE_STORE_ONLY hwcaps 2025-07-02 18:49:04 +01:00
kvm.h KVM: arm64: Allow userspace to limit the number of PMU counters for EL2 VMs 2025-04-11 13:08:23 +01:00
mman.h arm64: implement PKEYS support 2024-09-04 12:54:04 +01:00
param.h
perf_regs.h
posix_types.h
ptrace.h arm64/ptrace: Expose GCS via ptrace and core files 2024-10-04 12:04:41 +01:00
setup.h
sigcontext.h arm64/signal: Expose GCS state in signal frames 2024-10-04 12:04:41 +01:00
signal.h
statfs.h
sve_context.h
ucontext.h
unistd.h arm64: generate 64-bit syscall.tbl 2024-07-10 14:23:38 +02:00