From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795441885; b=k/ANo6PIMr8Hb5M1md0ECU9V+v6oAPNLQuxkI4zII2nuohUvFi17YbdTUG2mloUa30C2 xdtUi9TY+bCAmohqrDDwvr9q4ZOA5HygVBIjsgIEQjic8HhP45v7Fu2fBP9mWc9XqsvDv bb8vzHTwwJ0zEVus9xhrZkNelJFH4ZDRKkqrNa2JoUsLfeAb5sYTz6+9XqaGOHj3L/HfV Kclv9N3fxzkcWomWPTMdWEf69FOGBimcENK7aoTe1NcxgDkyvWuivvhm1CDM2q8t2z+Eu zhNbWNvnQ79GUwoT/i3aTKmOlMjxqMF/53uLsfSpv7sAlOy4cZGcsqyz4DV+/sp9f3Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795441885; h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:Date:Subject: MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id: References:In-Reply-To:To:Cc:X-Developer-Signature:X-Developer-Key; bh=wbaUWZC28smuRoW90pWpaXz3GGY4MsOKGg8st7PIjvw=; b=2KNvR2i/dYpETpv1VzVWLdeTUnyqvn7ZeFZKd6HhTpy/iJW8BNNv/Iza192Dvh+6jCZz BSlXS2VTWhZ2JwTKGbQWw9txJYmQvW8fFfFFSXe0//Ca8fdeSSaSZmM0DoKMKzdEtLiGp lGMDEMehCyakuzqqaCNtoqfZcv7j1rOsMNuzXR04cAwyNaFVHgk7KJL3DzXqnOiOfKabh l9WvLcXrapWuuA5HZ7AagjAPfC0HF2x635Iu3yVlSOfPamophRveVVoFhxIqXast8Zpjj UghM84rkxoAbI/fizJibiB6rLW6vi0XNZAvxW6m9Bc6FB3Hd0vGg1/u12tOrtvDfYjQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b="AdnWR/fT"; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=CiSYPSUw; arc=none smtp.remote-ip=193.142.43.55 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E92A606A684; Mon, 23 Nov 2026 13:51:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8E92A606A684 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=AdnWR/fT; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=CiSYPSUw From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1795441882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wbaUWZC28smuRoW90pWpaXz3GGY4MsOKGg8st7PIjvw=; b=AdnWR/fT44yXzm+ht95OqsrELNCyH358idfw54sxV+82ZCQh8b1aIvskImaSeMPYYiPAGX tMSFHMm39iz7ISqX2w8pj4D8L/qzXb1g+WS97tFqN8moTMNum/DjAz0AOhUR9mHeaYQxj9 5LZEWcHDHmfyVG3iQ0WvT8vFcoQbpRxTznUUUuQTu76cbBTyn3KQ4CodP8l937jaO91ZuP Qt441N7af+F5t3S2BxLy/sH8WAJ3bW5O4y6lY0UQw0K7A+UQhTXKdNOY7nqA7niM/tyffr 0vxJK9JiP8+NfpneuW9wJzwcEPrvj3p/SNvKjKHMhV35bVoateZvXcf6rspcBQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1795441882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wbaUWZC28smuRoW90pWpaXz3GGY4MsOKGg8st7PIjvw=; b=CiSYPSUwyavYYl1x/i+wWbxPyj9epV9FlY90gd2wiTfE4WxtGjnCDB5MgwLKxaEC26eTmC kUVvWJED9GTdvTAw== Date: Mon, 23 Nov 2026 14:50:56 +0100 Subject: [PATCH v6 05/11] powerpc/vdso: Enable the vdsocheck tool X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20261123-vdso-absolute-reloc-v6-5-161e218dd217@linutronix.de> References: <20261123-vdso-absolute-reloc-v6-0-161e218dd217@linutronix.de> In-Reply-To: <20261123-vdso-absolute-reloc-v6-0-161e218dd217@linutronix.de> To: 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 , Christophe Leroy , 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 , Peter Zijlstra , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1795441872; l=3226; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Cgbtb7qSJ3AcXOvZFi0BZIPMWqlXOiwZ1bBjbdIILZ8=; b=tf9jQyiu6Hx303xQeraxjP8OCezqMY+3qKghsgR/OWQajoh6hO04aKYTX/3KWhg5DquWsJP8b aAXQOlfMR3eDCtoARUDmA0kN0uVLstrGS/+wTZDeacxxM2luRimKr84 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 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 c3b6cd655606..1c4a75c3a830 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -327,6 +327,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 0d1a49529885..b2e399e10273 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -82,9 +82,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 0d5ceaca34d7..da58ff220eab 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 AllowedRelocations { + in_object_file: &[ + 10, /* R_PPC_REL24 */ + 11, /* R_PPC_REL14 */ + 26, /* R_PPC_REL32 */ + 249, /* R_PPC_REL16 */ + 250, /* R_PPC_REL16_LO */ + 251, /* R_PPC_REL16_HI */ + 252, /* R_PPC_REL16_HA */ + ], + ..Default::default() + } + .into(), + bindings::EM_PPC64 => AllowedRelocations { + in_object_file: &[ + 10, /* R_PPC64_REL24 */ + 11, /* R_PPC64_REL14 */ + 26, /* R_PPC64_REL32 */ + 44, /* R_PPC64_REL64 */ + 249, /* R_PPC64_REL16 */ + 250, /* R_PPC64_REL16_LO */ + 251, /* R_PPC64_REL16_HI */ + 252, /* R_PPC64_REL16_HA */ + ], + ..Default::default() + } + .into(), _ => None, } } -- 2.56.1