Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp810223pxm; Thu, 3 Mar 2022 05:11:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyh2Usol1NFMqtm+NdfDy6EOH3ZqCTPmLKG/qDNhl0g+cTTEUl6ow3SRWWvXZwngsKCAsMP X-Received: by 2002:a63:2b4d:0:b0:36c:7c39:b66c with SMTP id r74-20020a632b4d000000b0036c7c39b66cmr30158297pgr.583.1646313081323; Thu, 03 Mar 2022 05:11:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646313081; cv=none; d=google.com; s=arc-20160816; b=nw2iWR27+nlNiJcRGkJLCC5jYzw2IuFJgq+HcmT7r83zWPsh32z/ICt9PDwXhBEqoa evOatq73v96IjjvqzA12NF6KqukboA2bhydjlnk3n7vxSnu/spgx5rlZKVs6JH17u7UL XfUgYlPjpquV0m9Ps1WXsf8ubLpBgh9I33NKAIrHPR8ADhzXoeSpXoWF2bKJnDLdxpnK Bya5PrEFzzVneF03BdlIY9iYtECQXT+a9SAN9e+iqJ42NMVvFkzHJpH0b54gxEqbesSd i2cmuglSmvsqKoftNuTCdkcQRWSWZB4qbNUX4Fewku7ersIqSsxk8TbEl96lDpRM4b2b YnxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=yT9w4xnsVmNFCoRZzcwyGELh280VIWKMsPKWSrgdRDI=; b=VkcXtAvpxRakoN4cwGh5/ON6T3O64dKTuAQBhy3/CQdpg2UmpCEaaoh/KZ3/ookSKX fKxJAok4AbcqlAU53GGrqYtFQk5H8obrrmPIG2rFn3PGDTGZPdGqiKnCb4XCJonCIfKg gw3AuHR6K3/1ZckQOCGGkF01mRl8th8jBeFF65+nU9VAdoBszhgoucOLwC+SaeiI1dpd phkddkZ8V1WH7QwBcVCM/og/PXUIXzDGfNfPDXitOKqp3Opamehuz0k5OPK8KOb6hGPe G9cN3uIYnEbTdKaE8s2dyE2y1G1cE+47b4UIDJgOHWbBWsJuYTgZk90eRdFpbF80aAet yJXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WSChO2tE; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17-20020a627811000000b004e1b9d74e4fsi1975291pfc.295.2022.03.03.05.11.04; Thu, 03 Mar 2022 05:11:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@suse.cz header.s=susede2_rsa header.b=WSChO2tE; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233319AbiCCMd4 (ORCPT + 99 others); Thu, 3 Mar 2022 07:33:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbiCCMdz (ORCPT ); Thu, 3 Mar 2022 07:33:55 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5363F1768D2 for ; Thu, 3 Mar 2022 04:33:08 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 631D21F381; Thu, 3 Mar 2022 12:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1646310787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yT9w4xnsVmNFCoRZzcwyGELh280VIWKMsPKWSrgdRDI=; b=WSChO2tEGJvFrwVeNWo7mykbBkxiDI0+n2g4Ze8J5069Cl9FTb4AxyQod05LRq+2lvBKJP FzFpA1hJvX8nAQBxQAxh1sIkEqODYd3BRbtbf5chpgSRpk2GJKYH38VYKscrF9HlNjkq7a s/hbryKLWH1q4nBYEh4WiFyg8CjXC3U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1646310787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yT9w4xnsVmNFCoRZzcwyGELh280VIWKMsPKWSrgdRDI=; b=W0X4ThWJtdBhiYbB8f4OV8UIo23X8nomlfft51HlTh8lcIv/Q6ZeWAbJlJJ1auPXpsxJfr elhO6uSCm6xXtXAQ== Received: from pobox.suse.cz (pobox.suse.cz [10.100.2.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id EB576A3B83; Thu, 3 Mar 2022 12:33:06 +0000 (UTC) Date: Thu, 3 Mar 2022 13:33:06 +0100 (CET) From: Miroslav Benes To: Andrew Cooper cc: Peter Zijlstra , "x86@kernel.org" , "joao@overdrivepizza.com" , "hjl.tools@gmail.com" , "jpoimboe@redhat.com" , "linux-kernel@vger.kernel.org" , "ndesaulniers@google.com" , "keescook@chromium.org" , "samitolvanen@google.com" , "mark.rutland@arm.com" , "alyssa.milburn@intel.com" , "rostedt@goodmis.org" , "mhiramat@kernel.org" , "alexei.starovoitov@gmail.com" Subject: Re: [PATCH v2 33/39] objtool: Add IBT/ENDBR decoding In-Reply-To: Message-ID: References: <20220224145138.952963315@infradead.org> <20220224151323.959862564@infradead.org> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1678380546-1847834621-1646310787=:704" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1678380546-1847834621-1646310787=:704 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Thu, 3 Mar 2022, Andrew Cooper wrote: > On 03/03/2022 10:53, Miroslav Benes wrote: > > Hi, > > > > On Thu, 24 Feb 2022, Peter Zijlstra wrote: > > > >> Decode ENDBR instructions and WARN about NOTRACK prefixes. > > I guess it has been already mentioned somewhere, but could you explain > > NOTRACK prefix here, please? If I understand it right, it disables IBT for > > the indirect branch instruction meaning that its target does not have to > > start with ENDBR? > > CET-IBT has loads of get-out clauses.  The NOTRACK prefix is one; the > legacy code bitmap (implicit NOTRACK for whole libraries) is another. > > And yes - the purpose of NOTRACK is to exempt a specific indirect branch > from checks. > > GCC can emit NOTRACK'd calls in some cases when e.g. the programmer > launders a function pointer through (void *), or when > __attribute__((no_cf_check)) is used explicitly. > > > Each of the get-out clauses has separate enable bits, as each of them > reduces security.  In this series, Linux sets MSR_S_CET.ENDBR_EN but > specifically does not set NOTRACK_EN, so NOTRACK prefixes will be > ignored and suffer #CP if encountered. Thanks for the explanation. I would be nice to include it somewhere so that it is not lost. Miroslav --1678380546-1847834621-1646310787=:704--