From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 2A93C37701A; Tue, 8 Sep 2026 07:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788851981; cv=none; b=L+4/pf1ERWZJ5Xncppn/hu1A/FvpHdOYIeU2sUWImHdPmeTtHZpEFhtzcKJbZRYgW+zzGZdaaYhFUFGFSJ4vBFg+A1HRzO10OazH+O4yv5t925M4/GPReuCBJpvJYu5mj+h3fBTsbKo5Al013h9selLDReRP4gI8Kx7Q+dC8gWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788851981; c=relaxed/simple; bh=r4z9Rduphej7BE5ou7vFL3e/pitkInh5dUdcODt3n1M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jXmxOEpFBrDl9JMKKKOGw2EkwDNNEXNJrv579XksgJgqms8wkgO4sqBy960GHeEebAq19/CEPh3dvtYE6a7O/dE2x11QKojycGk2rYu5TH5LEM+VExzw5uPwBJQXRd1TnYKjRBNMZBlBj/XdAsW8D9VSva/NVqOkS/HlgTYuU1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=UoZziDS/; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="UoZziDS/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=cvxxmFP38glDv9aUVdeEkTg6ek/m9m390THhoWCfEM0=; b=UoZziDS/M2tkE9i/kd/fRWxjxG xi+fyu0pTnULNJBoBTxWqssjFBpND46iwdm8/Xdasvn1rRlVO3YRTifGQHqQ7Djyr0qN+giJZ+fhm VGFo7VQcUzTluQnwuFY/TINjSZwGg2wAu6h/I2aJQekwAQAHDfDRbs5c4653HmcsHzR3/MT7uYBiv OHGOF2sDyRO8Ng0HJl/EAucBF+nX0HMCIeEV9AzqfniAsQubp91a/6o38RnF6m5eUvGRXcnh6SFwM YSzWSLDv1463xBJzjZwzhVMGY0l1ix+hGiimn09WhCg0UeYSjjmBlFhgA8gLyLSTRRkm2555WQmqU gUx+TBrQ==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux)) id 1x3q6r-0000000H2Y9-0OuO; Tue, 08 Sep 2026 07:19:13 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5B0713005AF; Tue, 08 Sep 2026 09:19:11 +0200 (CEST) Date: Tue, 8 Sep 2026 09:19:11 +0200 From: Peter Zijlstra To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: 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 , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Thomas Gleixner , Christophe Leroy , Boqun Feng , Nicolas Schier , 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 Subject: Re: [PATCH v5 12/24] vdso: Add the vdsocheck tool Message-ID: <20260908071911.GU4120091@noisy.programming.kicks-ass.net> References: <20260908-vdso-absolute-reloc-v5-0-3a93791af1cf@linutronix.de> <20260908-vdso-absolute-reloc-v5-12-3a93791af1cf@linutronix.de> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260908-vdso-absolute-reloc-v5-12-3a93791af1cf@linutronix.de> On Tue, Sep 08, 2026 at 08:33:46AM +0200, Thomas Weißschuh wrote: > All vDSO code needs to be completely position independent. Symbol > references are marked as hidden so the compiler emits PC-relative > relocations. However there are cases where the compiler may still > emit absolute relocations, as they are valid in regular PIC DSO code. > These would be resolved by the linker and will break at runtime. > This has been observed on arm64, see commit 0c314cda9325 ("arm64: vdso: > Work around invalid absolute relocations from GCC") > > Introduce a tool to check for absolute relocations during the build, > as the current inline-shell logic is not expressive enough. > The check is done on the object files as the relocations will not exist > anymore in the final DSO. As there is no extension point for the > compilation of each object file, perform the validation in vdso_check. > > Signed-off-by: Thomas Weißschuh > --- > Makefile | 19 ++ > lib/vdso/Kconfig | 5 + > lib/vdso/Makefile | 2 + > lib/vdso/Makefile.include | 14 ++ > lib/vdso/check/.gitignore | 3 + > lib/vdso/check/Makefile | 34 +++ > lib/vdso/check/elf.rs | 498 ++++++++++++++++++++++++++++++++++++++++++++ > lib/vdso/check/vdsocheck.rs | 154 ++++++++++++++ > 8 files changed, 729 insertions(+) Urgh, does this mean I have to have rust installed just to build a kernel now?