Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3567619rdb; Wed, 13 Sep 2023 16:43:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJOXYUpmriYXkUQH2YXjjPXwQKhe46Rxq3TQYuaIbN/AMID+knpeGsRu3ttjsDB+vx4wnq X-Received: by 2002:a17:903:1cb:b0:1bf:1a9e:85f7 with SMTP id e11-20020a17090301cb00b001bf1a9e85f7mr4470137plh.1.1694648602995; Wed, 13 Sep 2023 16:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694648602; cv=none; d=google.com; s=arc-20160816; b=uvZ+Dwd+ExVq/Eyw370Ixl9mzMOUlFN4AlQ77SdqQrpJ6+F6uHBKa7ZbFtjCpKa2yF OqwlvHk2qWNW413z3ghYqK7RGgZGiEf12x+4FN/lKXhdGqqn8BeQ5SbTfi5oFGiIYzFe PDVSfUNyK/RoYxOBWgRQehC1ex6Q+f2Ta65rOwEOTd7z3sWrzv1AV4lC8AKfgP/ND0sz ZZZLSQqhN6dxy0ll+RxkHK5We7OhsI9KaYo0dOafFRYzESL4DFEq+lFlMJF9uijLIcH1 d0ecBt0eaV+FlkOPh1qxN+W/M/qBBois+O3SRrTWxrZ4Myo95S1uxSIoRnryFtgWegTN y4TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=66j4LpC4FkxboVA4ELkFlwA3s9erD6zM+Bkl1ZbmvNs=; fh=a5/DUSIXUrv9fT749LLkowHS+3qDqxQOhmDpWd3pp3Q=; b=c4IIqYer7QGkFWKTfoJWVLWlpL2HKpMpTeYebGo3Cw8Kquo8UiTyvQxXCWDKTGO55k AdXi+0ri0N25zdtKbssoB9sQEtpu35lC+2KbyNSBxvPLMwwKKzxCu03c6OfqzAMvoBZo gCpPfzkeOTID7V9bHcu9nT1CPgwFx22ojLxyNJ34Sav31c0WInLJNvLJdc4eLY9pybyF YmO60PsafA2vpXhbYdaGwj/wY0c+t5jLxptTLQP9sBgGAik1ARUgIzn9nMje5IYgTdvw kxFYpJ8Ya8oeozhswoFozP1QAE036g4rf5IM7HsFiLIXu5zItdUnFa34fT6wVVdGzhpZ pAVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vzAIjuHV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r10-20020a170902be0a00b001bf20c80685si357912pls.125.2023.09.13.16.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 16:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vzAIjuHV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B744D80B2311; Wed, 13 Sep 2023 05:50:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240515AbjIMMu7 (ORCPT + 99 others); Wed, 13 Sep 2023 08:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238125AbjIMMu6 (ORCPT ); Wed, 13 Sep 2023 08:50:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4681119B1 for ; Wed, 13 Sep 2023 05:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=66j4LpC4FkxboVA4ELkFlwA3s9erD6zM+Bkl1ZbmvNs=; b=vzAIjuHVFwzSZ+jmF8W8PUR+jX h/0d3pu00H6MwztFn+DD9n5qhlrm4BdAwuTumla3TY/DvJAzCQY8e8jcJ5h8U4m0J5kqfMwdPqch3 EqnpUxTjGNo96gntkkgtI9VGIVo7XfjvbXmb4Q3MxlE40M9FjzfcPV5kSjDosg3dP8YrD0QeWguor 3LKNRtxReQz0aiMLYRMzLjRx+7536mnBHihJ8kd2ro19Qod9rQyhAM1jpD6OSmpmZic6QPA9RsPjL 1VA7EVk5zrR5pLP63Vu5cMA4pGveJrkIL3ayrcdrR5TtZX2DFTJ7IEtOLcUuRDFkebvQIUxjZe4gs r7/78SiA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qgPK4-00DuuQ-BZ; Wed, 13 Sep 2023 12:50:24 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 08FCA300348; Wed, 13 Sep 2023 14:50:24 +0200 (CEST) Date: Wed, 13 Sep 2023 14:50:23 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Nikolay Borisov , Andrew Cooper , LKML , x86@kernel.org, Borislav Petkov , Babu Moger , David.Kaplan@amd.com, gregkh@linuxfoundation.org, Thomas Gleixner Subject: Re: [PATCH RFC 4/4] x86/srso: Use CALL-based return thunks to reduce overhead Message-ID: <20230913125023.GG692@noisy.programming.kicks-ass.net> References: <20230821112723.3995187-1-andrew.cooper3@citrix.com> <20230821112723.3995187-5-andrew.cooper3@citrix.com> <20230821151636.onk2e6tlhmjg5yz5@treble> <810fa94b-9417-0076-1232-d263ef882027@citrix.com> <20230822022229.xlctyccmgdxiy6ic@treble> <9565380a-4654-f267-c8ac-a4d6ab81156a@suse.com> <20230822221828.htnwidmr22gtjhcd@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230822221828.htnwidmr22gtjhcd@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 05:50:59 -0700 (PDT) On Tue, Aug 22, 2023 at 03:18:28PM -0700, Josh Poimboeuf wrote: > The problem is the call-site, not the thunk. Ideally we'd have an > option which adds an INT3 after the 'JMP __x86_return_thunk'. The -mharden-sls=all option *SHOULD* be extended to unconditionally emit INT3 after everyt JMP instruction -- including the one used for -mfunction-return=thunk-extern. This is a known missing mitigation for an AMD SLS issue. Due to the whole branch-type-confusion thing, AMD CPUs can predict the JMP as 'not-a-branch' and continue to the next instruction. I'm sure Andrew has the proper name and CVE stashed away somewhere. IIRC he even has a GCC bugzilla entry for it.