]> www.infradead.org Git - users/willy/linux.git/commit
x86/vdso: Fix latent bug in vclock_pages calculation
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Tue, 4 Feb 2025 12:05:33 +0000 (13:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 21 Feb 2025 08:54:00 +0000 (09:54 +0100)
commit3ef32d90cdaa0cfa6c4ffd18f8d646a658163e3d
tree2d9b88e0687a06fd3b0888539e2834aca293cd9b
parenta64dcfb451e254085a7daee5fe51bf22959d52d3
x86/vdso: Fix latent bug in vclock_pages calculation

The vclock pages are *after* the non-vclock pages. Currently there are both
two vclock and two non-vclock pages so the existing logic works by
accident.  As soon as the number of pages changes it will break however.
This will be the case with the introduction of the generic vDSO data
storage.

Use a macro to keep the calculation understandable and in sync between
the linker script and mapping code.

Fixes: e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250204-vdso-store-rng-v3-1-13a4669dfc8c@linutronix.de
arch/x86/entry/vdso/vdso-layout.lds.S
arch/x86/entry/vdso/vma.c
arch/x86/include/asm/vdso/vsyscall.h