]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
timekeeping/vsyscall: Update VDSO data unconditionally
authorHuacai Chen <chenhc@lemote.com>
Thu, 24 Oct 2019 03:28:29 +0000 (11:28 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 4 Nov 2019 22:02:53 +0000 (23:02 +0100)
commit52338415cf4d4064ae6b8dd972dadbda841da4fa
tree963f580852fda99183be99a2e7700b39c7d54da5
parentd7e8d149c5f3774fd8d422364c38afb69501ccb0
timekeeping/vsyscall: Update VDSO data unconditionally

The update of the VDSO data is depending on __arch_use_vsyscall() returning
True. This is a leftover from the attempt to map the features of various
architectures 1:1 into generic code.

The usage of __arch_use_vsyscall() in the actual vsyscall implementations
got dropped and replaced by the requirement for the architecture code to
return U64_MAX if the global clocksource is not usable in the VDSO.

But the __arch_use_vsyscall() check in the update code stayed which causes
the VDSO data to be stale or invalid when an architecture actually
implements that function and returns False when the current clocksource is
not usable in the VDSO.

As a consequence the VDSO implementations of clock_getres(), time(),
clock_gettime(CLOCK_.*_COARSE) operate on invalid data and return bogus
information.

Remove the __arch_use_vsyscall() check from the VDSO update function and
update the VDSO data unconditionally.

[ tglx: Massaged changelog and removed the now useless implementations in
   asm-generic/ARM64/MIPS ]

Fixes: 44f57d788e7deecb50 ("timekeeping: Provide a generic update_vsyscall() implementation")
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1571887709-11447-1-git-send-email-chenhc@lemote.com
arch/arm64/include/asm/vdso/vsyscall.h
arch/mips/include/asm/vdso/vsyscall.h
include/asm-generic/vdso/vsyscall.h
kernel/time/vsyscall.c