From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D8A6F12E63; Fri, 16 Feb 2024 05:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708062157; cv=none; b=ZzDD1iW+s3ktkdWC/fos0Soj4YwqPWoaSkbSiEfcPjif+c3lKxYLd91rkAMvxg/IkTEd1AEmNY0qATtYs3WEH94DakFludnf2GPYXW4yutT3BTzuKxhOGMv00JulozO0HxaURk1X/VtbpnEvM0CbZiwWZ8hljv0dq1yREs1mJQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708062157; c=relaxed/simple; bh=cZ33RbXWRl7oeyYH20+M7tDKsle252OAe/cyfg297aE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RgmQMMgmDEVXW1PxHRYpTdD3NSLQ472zuvz5S11/bUtZ8iGkEwXjOotzooPBsGkjoot7NuMkqjVKBECSvPQrY4+w1C925Vy+HlSZFe3fF3OWct9qLRbiwR9dx+8f3+DJsqZaPhMsFsExE1QXfjBa1smmVvdBdp9SwdoNMj9M2L8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VVw0UCQo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VVw0UCQo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60732C433F1; Fri, 16 Feb 2024 05:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708062157; bh=cZ33RbXWRl7oeyYH20+M7tDKsle252OAe/cyfg297aE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VVw0UCQoAkNFSoG6Wg5/BqtvlTSQRfaG+ZkZ4Gcbj0+b5x2KnR74ib/lPnfYYfNQv 9ofAWa1Fg0WfQLtzVibadFijfwJDV8bnCxK9e4QkAWHktCaixQPt2bKwFwb3KPn5iT Cnj+7+9uphoOR4lAU4FyOBd+E20pbvWA1tOhhKXzfpvgNQ0NsNlNx5Og25M6fLoIoq zouKKe7XCB6EOT6mdzOBvU227WB/qoJzZroGpgk+7RNGWi8SHCUfUwpwYQLtxX6fOm 2dqJdQyP3qNRJbCK/nZj0S+JZ0eiCoryqYVqFvXBKYSZUwRgKAuDVBciNGgdpmrVBL Rr1NpffmUgHOg== Date: Thu, 15 Feb 2024 21:42:35 -0800 From: Josh Poimboeuf To: Borislav Petkov Cc: Nathan Chancellor , linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, x86@kernel.org Subject: Re: [tip: x86/bugs] x86/retpoline: Ensure default return thunk isn't used at runtime Message-ID: <20240216054235.ecpwuni2f3yphhuc@treble> References: <20231010171020.462211-4-david.kaplan@amd.com> <170774721951.398.8999401565129728535.tip-bot2@tip-bot2> <20240215032049.GA3944823@dev-arch.thelio-3990X> <20240215155349.GBZc4zjaHn8hj6xOq3@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240215155349.GBZc4zjaHn8hj6xOq3@fat_crate.local> On Thu, Feb 15, 2024 at 04:53:49PM +0100, Borislav Petkov wrote: > I'd tend to look in Josh's direction as to say what would be the right > thing to do here and more specifically, where? > > We need to run objtool on the vdso objects which are *kernel* code. > I.e., that initcall thing. The vdso-image-64.c gets generated by vdso2c > and lands in arch/x86/entry/vdso/vdso-image-64.c, that's why objtool > hasn't seen it yet. > > I mean, it is one initcall in the vdso, probably not that important and > if its return hasn't been patched, it won't be the end of the world but > still... > > In any case, the patch works as advertized! :-) Right, the good news is this isn't a regression and the warning is working as designed. This should tell the build to invoke objtool on that file: diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index b1b8dd1608f7..92d67379f570 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -36,6 +36,7 @@ UBSAN_SANITIZE_vma.o := y KCSAN_SANITIZE_vma.o := y OBJECT_FILES_NON_STANDARD_vma.o := n OBJECT_FILES_NON_STANDARD_extable.o := n +OBJECT_FILES_NON_STANDARD_vdso-image-64.o := n # vDSO images to build vdso_img-$(VDSO64-y) += 64