Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp532243rdh; Wed, 7 Feb 2024 11:49:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsvbQkdP7CYvK8JEcN2Gj/LZc3nLjv3rr4pU/j9YOBa6hZIXOz/DdTEKp4wJdZiSxgHQ77 X-Received: by 2002:ac8:7dcc:0:b0:42c:cb4:92b9 with SMTP id c12-20020ac87dcc000000b0042c0cb492b9mr7972790qte.55.1707335370885; Wed, 07 Feb 2024 11:49:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707335370; cv=pass; d=google.com; s=arc-20160816; b=eYTv24P2boLEufV24QoUHVZFaciikopqS8CdP5+6mruTcOGcr0O2ZWhu281sNmEE/a b106ZLE3hIzHCJkttG3YXDgwh3LL+eODCUGfSb7dBPQyd8KQyRiKUFNZXEkNq9hHoqbQ NCUKb1ynOi34yh9wZACg6kLoEOSZOklTvLzGJqmaFmrTLPA4/n232bsl+LW7zgu4c1mu wBx0pEkqlMIzjDnTd9wFS9UZMjG3F62oPxkcqNbsBrHtqDyRRRH1rkD0P9ZQj6KszCcC gYdEVD9M66Eo4fOGfmtCh535xPrICaPzMxnDAuwhPaK+SxKoo5u0j9xGjhez4u+OnlUe Ujsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MOJunLziJVE2XXT4QcCdVcM6/jBfL+jnlxcETMLXnIg=; fh=V7kdzweCKIEPhOMTeRQV7J8k6G/af8Hqho/GuRA+ySE=; b=u/YiznlYRNNguE32C+zQpmBTWElD8px4SyQsJXdR+SEoACMfhTki0/ekWyvVAA9pGn LtIn29FUZvB6K7dSdGvrcsabuZ/sTe+WnpMk3RqKERyTHexhQO0YtG2w0UVJA9msa/zz 8Y+XzpOIxt+dFNzYgt4c/7d2Wd4ukQdW1JBf3rRwETGL7U+LrNYO6zyQ4E0Nz7KJm/K5 Y8q6S46uD0grTQWoyiv0N59pxnf6LNXWlK2UchUUuYJYMDKgOpVuDemMO4PDBhoZBl+J jCNPJpnuHyXC+YqdQtMvDFextMeY9ypz9K80IxpDEAerib56nRYFUTwIQFa7pny33Wn6 9MEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uOxkl5O2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-56989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVzeSuOdO9JFSqRgol/rWY+3G5t21Bg0xRnrKQ7gK83ArAdA0FJi71fY7ebEajfzVc03omFGFoL4oI7rBZ4VidMnjv1oPLcY1cwPFOfAA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u14-20020a05622a14ce00b0042c2dc00774si1819848qtx.585.2024.02.07.11.49.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 11:49:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uOxkl5O2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-56989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8FC571C233B3 for ; Wed, 7 Feb 2024 19:49:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 104548663B; Wed, 7 Feb 2024 19:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uOxkl5O2" 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 323878615A; Wed, 7 Feb 2024 19:49:21 +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=1707335362; cv=none; b=aWUIREUi/xR8tX+WWt8Em7guQaP/dgX+84rchixxnfCwkIlKw3jmj6Hoxq8gy2283w9hChfmOLncqO+sQdC30x3DUme/jVf2ZQMo1B05A52XpM6JqdgCgTHeN2qNyVdmVRwfEcRSRpNG1zAWn+1wEAEEB33KT0SfagGrhNkdXcQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707335362; c=relaxed/simple; bh=Qgto4wYZaGAjn9+btzk8CBsRBzPuQf1xeweWZoy1n5o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NhrNaxnjUcwVQniWjfrcAmDZwJCX0Mm1DZtIpt23w3/hLvHnxDXGgtF0LdZLqHYF4FEWldr04fcg5ZxPOPWDPVluLTJrwStyH06f9kphdj8VZf6mYA8Bn5XeyFlcEYE4yVWUZI4umf3Z99YHpiTHRYq9SfSYuiCz/eNxa6XR8jw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uOxkl5O2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59B1CC433C7; Wed, 7 Feb 2024 19:49:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707335361; bh=Qgto4wYZaGAjn9+btzk8CBsRBzPuQf1xeweWZoy1n5o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uOxkl5O29VIrTO+UZmB8d8ELCYblaTLg6nl8qrRxDdQ0/bmAgR1xrODVdtIIRMV4Y baHLBj2QhOET5sbjIpQAdVGa2t0lW0WTP98mNUO5JuFlF95ypZ1Qu5gE+74IEAGph3 biRfPNE+ELgkiO4KDab+JZcZnsTIdiJ40PjAYR16vQGnBlhByxRtoJxGylIqxBJ6UH eBvmm4cKpu9tXnRB13fgQs1dRxnzV1OClcqv0xkY7nGvpq4w3+jRWrArwSrtPs93jv H2dj5ceOrff3GJtF/NTIU+VFqjuYqqw9WITrDSLkiqzzDLn6c3yBb1UZmcWQ9KWScH qPw0b7RreZUBA== Date: Wed, 7 Feb 2024 11:49:19 -0800 From: Josh Poimboeuf To: Borislav Petkov Cc: "Kaplan, David" , Ingo Molnar , "linux-kernel@vger.kernel.org" , "linux-tip-commits@vger.kernel.org" , "Peter Zijlstra (Intel)" , "x86@kernel.org" , David Howells Subject: Re: [PATCH -v2] x86/retpoline: Ensure default return thunk isn't used at runtime Message-ID: <20240207194919.qw4jk2ykadjn5d4e@treble> References: <20231019143951.GEZTE/t/wECKBxMSjl@fat_crate.local> <20231019152051.4u5xwhopbdisy6zl@treble> <20231024201913.GHZTgmwf6QMkX8BGbo@fat_crate.local> <20240103184656.GEZZWroPmHLJuP6y5H@fat_crate.local> <20240104131210.GDZZauqoeKoZGpYwDd@fat_crate.local> <20240104132446.GEZZaxnrIgIyat0pqf@fat_crate.local> <20240104132623.GFZZax/wyf5Y3rMX5G@fat_crate.local> <20240207175010.nrr34b2pp3ewe3ga@treble> <20240207185328.GEZcPRqPsNInRXyNMj@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: <20240207185328.GEZcPRqPsNInRXyNMj@fat_crate.local> On Wed, Feb 07, 2024 at 07:53:28PM +0100, Borislav Petkov wrote: > On Wed, Feb 07, 2024 at 09:50:10AM -0800, Josh Poimboeuf wrote: > > And as you say, there are many frankenkernels out there and upstream > > doesn't want to be in the business of debugging them. > > Ok, all valid points. Diff ontop. > > I'll queue it now so that it has ample time of cooking in linux-next. > > Thx. > > --- > > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c > index 612c9ec456ae..5a300a7bad04 100644 > --- a/arch/x86/kernel/cpu/bugs.c > +++ b/arch/x86/kernel/cpu/bugs.c > @@ -2853,16 +2853,5 @@ ssize_t cpu_show_gds(struct device *dev, struct device_attribute *attr, char *bu > > void __warn_thunk(void) > { > - pr_warn_once("\n"); > - pr_warn_once("**********************************************************\n"); > - pr_warn_once("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); > - pr_warn_once("** **\n"); > - pr_warn_once("** Unpatched return thunk in use. This should not **\n"); > - pr_warn_once("** happen on a production kernel. Please report this **\n"); > - pr_warn_once("** to x86@kernel.org. **\n"); > - pr_warn_once("** **\n"); > - pr_warn_once("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); > - pr_warn_once("**********************************************************\n"); > - > - dump_stack(); > + WARN_ONCE(1, "Unpatched return thunk in use. This should not happen!\n"); > } LGTM, thanks! -- Josh