From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3135C79F82 for ; Tue, 8 Sep 2026 14:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UDv2ulwj8noxjdMQEqKxpUauXEITpLasbQE7qAV2OQU=; b=Fj0T/HR/JL6yk0xd87QTFZGkb7 9Hg7os5zJ0aef0fPBdmhf0RIV4YpgKW5Hts1+egF3HgG2jzHL1Kw+t7W6b0tk9abObSDl8LlVv6hX HxqOWEB1VrTTKds26qbO+PFsXaAqdd1NWEznokcV2GnenQNa6hLeklVu2V8aOKzAam3N2priKp/of 9E6w0BdPNxV4pgBGQN5YrniRUA7AijTCXZZEua/x81pZ/1KYvuJOHpPCiFpErf63jOw+SguAnKhGc MWIMuh2Pbz6gwwo0d6zZ3GxW7LaElhVOAaeLfSkO36ObsB49f1pDjcGEvODcLOOGMVH6mKeM/HSJX ceew+FpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x3x0v-00000009Ikj-0KbG; Tue, 08 Sep 2026 14:41:33 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x3x0u-00000009Ik5-0ITD; Tue, 08 Sep 2026 14:41:32 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4A81C4360A; Tue, 8 Sep 2026 14:41:31 +0000 (UTC) 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 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 X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org 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, > } > } >