From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07B9B53ECF7; Tue, 8 Sep 2026 14:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788878506; cv=none; b=EcAJ1Bs0aSwDKIHyzZbifG4M5DM2iFEHwteVwkGwP3fh+/+85KGSfR+CPsjhF4R7Jg1T8bTfhvYViUJP8VX/e3vwfNyx/2KuhxDMA0GgO6LA7sRWfhpTpmEVC2Mec/HZpu/jkJe8xNjXfAvJc4awPacwNrNFzpanDD/6CDNf7TU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788878506; c=relaxed/simple; bh=oDX/WcE11SZ/SdoliOgaRIcPYC+iHQXg06z0Mv3RUGk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nBUhIjzzWRI5dhwlqAy7zJCis/z6/yjFQoJIWJ7elpD9+gR+LaoyOfGvjHU2SXZ+gvC/Y9XVJTzD6EowYI70Qkpnc1WO8W8H4DX9rvLkDUbUZoT6UAfUehLbI/7Ks8A69kkOown04mSAEwMz8EKHGU7LRekIwfrubUiXj5SGf34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A83611F00A3A; Tue, 8 Sep 2026 14:41:14 +0000 (UTC) Message-ID: <7c9f6ec3-5886-41ea-8803-d81019321d29@kernel.org> Date: Tue, 8 Sep 2026 16:41:09 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 17/24] powerpc/vdso: Enable the vdsocheck tool To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Lutomirski , Vincenzo Frascino , Kees Cook , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Richard Weinberger , Anton Ivanov , Johannes Berg , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Huacai Chen , WANG Xuerui , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Bogendoerfer , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Thomas Gleixner , Boqun Feng , Nicolas Schier Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-mm@kvack.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-s390@vger.kernel.org, linux-mips@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Jan Stancek , Arnaldo Carvalho de Melo , Alexandre Ghiti References: <20260908-vdso-absolute-reloc-v5-0-3a93791af1cf@linutronix.de> <20260908-vdso-absolute-reloc-v5-17-3a93791af1cf@linutronix.de> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20260908-vdso-absolute-reloc-v5-17-3a93791af1cf@linutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 08/09/2026 à 08:33, Thomas Weißschuh a écrit : > The vdsocheck tool validates the object files and final .so library. > It can detect if the compiler created relocations which are incompatible > with the vDSO which need to be worked around. > > Wire it up for the architecture. > > Signed-off-by: Thomas Weißschuh > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/kernel/vdso/Makefile | 4 ++-- > lib/vdso/check/vdsocheck.rs | 27 +++++++++++++++++++++++++++ > 3 files changed, 30 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 2580e27e4328..f19e225cfc5c 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -330,6 +330,7 @@ config PPC > select SYSCTL_EXCEPTION_TRACE > select THREAD_INFO_IN_TASK > select TRACE_IRQFLAGS_SUPPORT > + select VDSO_CHECK > select VDSO_DATASTORE > select VDSO_GETRANDOM > # > diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile > index 368759f81708..ca20b91b4373 100644 > --- a/arch/powerpc/kernel/vdso/Makefile > +++ b/arch/powerpc/kernel/vdso/Makefile > @@ -81,9 +81,9 @@ targets += vdso64.lds > CPPFLAGS_vdso64.lds += -P -C > > # link rule for the .so file, .lds has to be first > -$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/vgetrandom-32.o $(obj)/crtsavres-32.o FORCE > +$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/vgetrandom-32.o $(obj)/crtsavres-32.o $(vdsocheck) FORCE > $(call if_changed,vdso32ld_and_check) > -$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o $(obj)/vgetrandom-64.o FORCE > +$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o $(obj)/vgetrandom-64.o $(vdsocheck) FORCE > $(call if_changed,vdso64ld_and_check) > > # assembly rules for the .S files > diff --git a/lib/vdso/check/vdsocheck.rs b/lib/vdso/check/vdsocheck.rs > index e45a1fbc6829..429bdcd65818 100644 > --- a/lib/vdso/check/vdsocheck.rs > +++ b/lib/vdso/check/vdsocheck.rs > @@ -69,6 +69,33 @@ fn allowed_relocations_for_machine(machine: u16) -> Option ..Default::default() > } > .into(), > + bindings::EM_PPC => AllowedRelocations { > + in_object_file: &[ > + bindings::R_PPC_REL24, Not sure this is correct, see commit 42ed6d56ade2 ("powerpc/vdso: Block R_PPC_REL24 relocations") > + bindings::R_PPC_REL14, > + bindings::R_PPC_REL32, > + bindings::R_PPC_REL16, > + bindings::R_PPC_REL16_LO, > + bindings::R_PPC_REL16_HI, > + bindings::R_PPC_REL16_HA, > + ], > + ..Default::default() > + } > + .into(), > + bindings::EM_PPC64 => AllowedRelocations { > + in_object_file: &[ > + bindings::R_PPC64_REL24, Not sure this is correct, see commit 42ed6d56ade2 ("powerpc/vdso: Block R_PPC_REL24 relocations") > + bindings::R_PPC64_REL14, > + bindings::R_PPC64_REL32, > + bindings::R_PPC64_REL64, > + bindings::R_PPC64_REL16, > + bindings::R_PPC64_REL16_LO, > + bindings::R_PPC64_REL16_HI, > + bindings::R_PPC64_REL16_HA, > + ], > + ..Default::default() > + } > + .into(), > _ => None, > } > } >