Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9248756rwi; Tue, 25 Oct 2022 17:28:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4iv3pLSG6OV7umjIMjJFgome952I8rQKAB0XGHWrkQtizRiTSAVKGJ9Ug4fXFYgzGy+BXT X-Received: by 2002:a17:906:7313:b0:78e:c2a:a3fa with SMTP id di19-20020a170906731300b0078e0c2aa3famr33585716ejc.581.1666744111609; Tue, 25 Oct 2022 17:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666744111; cv=none; d=google.com; s=arc-20160816; b=bceQrkFoMLhxTF4Clr2U97ulAHe2Ei+CtIqJjkL2MEw+ZaI4OzhGxslDbxHDipHS8A R6/xPyI/AFU2DA/I1rI55lhtL/XTY8wpejpPd3mChDLkP5IyHvQzdsWbUToxqn1c8kvi KuvPn66c29B3sWQamc6g0D1PEUvaMvbxhHTlUX9uQqmnh9WQz8ozGcvMmJBq11ZRMFQG aDJthfJaEA9pqraTzM/AW07ZfZiH2rx4qXkz2zIG36oZm5G0ERyAzYqN5GedBOHFZt8U vqVeihc6Adf6PZK8rSeYyP1GWq7rMO8NOVEkM4OCt/ZJJIF9rLXkzMBapYU/rUBdd/Cj eg+A== 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=oyd+l1GsSKxcb098K/jTmL5mtspj4j9mcqRnV2H/Ptg=; b=IT6oD+1A06a39D/EeYVmZz4bQ1WVDnhTQ7pTsXKQmUJmZ1EDvXM77fIkXiXmp2LNuR bskv5d4pxoLDhLXxYMKytqMNc1pdfR4ZTJH9rEbez907J+sCybvlgIRMo4M2Mi2sre+P 7OuxwGx/e1mGCtOIaiwFh9nuRsKaEhvzizR/P2VerSeVrh7Vt/mZYRkrDhZq1G4G0sSi CYzoEZOZ1OzS2dg3EevEdQQqhYf9ZB1bXPwV6V9B4HfWkytIGP749t8+ovK9b3ZNi1w/ 3a3Q3x/jsoApA8ke1E/9T07LrNhyDTutVnaRqXktuz/aHYE9Nno/TqqGA5HVLGVPwmy/ biew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ICUFGGbv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a170906974f00b0079e1916c11asi853081ejy.703.2022.10.25.17.28.12; Tue, 25 Oct 2022 17:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ICUFGGbv; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbiJZASC (ORCPT + 65 others); Tue, 25 Oct 2022 20:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbiJZASA (ORCPT ); Tue, 25 Oct 2022 20:18:00 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A3EADCACC; Tue, 25 Oct 2022 17:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666743479; x=1698279479; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=oyd+l1GsSKxcb098K/jTmL5mtspj4j9mcqRnV2H/Ptg=; b=ICUFGGbvv6/CFGyei97UBWZ61Vllisdosb7t3dnw0ClzbhA6VnkiCOhn lQPRs4ehG/OuRC5EyxeVwxE9nNF2qkXo5UpB93JAofIgwBJt6EU6+yjKU lIYVl1nkuxXQS5pI5rHhnIhpqoICtgJd/kiRSoT5rjw28tfo+xqpr4ATW qXCZ6Rnxt9At9s2Ss7vtZZY09gLZmQ1eWeKVqU+i++0WjZuSUXTKYv2cH kyl7FzLaEl1QDypst3lQi+rC87a0gONL/0KO2AkUYZUmea0m6AGhPbeuT JDb8QiAaTmC0iNXbJRL4/0CsT1PvW3NKOzNGvXOjWxRqjn8yGge5EyY01 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10511"; a="295228483" X-IronPort-AV: E=Sophos;i="5.95,213,1661842800"; d="scan'208";a="295228483" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2022 17:17:59 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10511"; a="609764421" X-IronPort-AV: E=Sophos;i="5.95,213,1661842800"; d="scan'208";a="609764421" Received: from swatthag-mobl1.amr.corp.intel.com (HELO desk) ([10.209.27.104]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2022 17:17:58 -0700 Date: Tue, 25 Oct 2022 17:17:57 -0700 From: Pawan Gupta To: Johannes Berg Cc: Peter Zijlstra , scott.d.constable@intel.com, daniel.sneddon@linux.intel.com, Jakub Kicinski , dave.hansen@intel.com, Paolo Abeni , antonio.gomez.iglesias@linux.intel.com, "David S. Miller" , Eric Dumazet , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, gregkh@linuxfoundation.org, netdev@vger.kernel.org Subject: Re: [RFC PATCH 0/2] Branch Target Injection (BTI) gadget in minstrel Message-ID: <20221026001757.gyjzcwe5wznu6drj@desk> References: <20221025193845.z7obsqotxi2yiwli@desk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Oct 25, 2022 at 09:56:21PM +0200, Johannes Berg wrote: >On Tue, 2022-10-25 at 12:38 -0700, Pawan Gupta wrote: >> >> > And how is sprinking random LFENCEs around better than running with >> > spectre_v2=eibrs,retpoline which is the current recommended mitigation >> > against all this IIRC (or even eibrs,lfence for lesser values of >> > paranoia). >> >> Its a trade-off between performance and spot fixing (hopefully handful >> of) gadgets. Even the gadget in question here is not demonstrated to be >> exploitable. If this scenario changes, polluting the kernel all over is >> definitely not the right approach. >> >Btw, now I'm wondering - you were detecting these with the compiler >based something, could there be a compiler pass to insert appropriate >things, perhaps as a gcc plugin or something? I hear it could be a lot of work for gcc. I am not sure if its worth especially when we can't establish the exploitability of these gadgets. There are some other challenges like, hot-path sites would prefer to mask the indexes instead of using a speculation barrier for performance reasons. I assume adding this intelligence to compilers would be extremely hard. Also hardware controls and features in newer processors will make the software mitigations redundant.