Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp823586rwe; Wed, 31 Aug 2022 11:38:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR4UjeehtQAFazkvShDUFglu4DTO69mIG3yoriGYSnbto9vfMd0a34r4wftZMwB+K3aLB1xG X-Received: by 2002:a05:6402:3485:b0:448:a1c8:d640 with SMTP id v5-20020a056402348500b00448a1c8d640mr10390164edc.279.1661971116142; Wed, 31 Aug 2022 11:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661971116; cv=none; d=google.com; s=arc-20160816; b=PqTgKnhaubE437+TYh8IB6AgXT+CGsiu3sBJcdsQ4R8fWJoxoe55VX21IOnPLuUXhO Nuzq/5KMt7IRvCuZb1ibZSbI6smvaRbb5+p4nwgPfjEsxywZZuZNPwZLUswANKIkRLtJ Mj6gMFJ5ItPe0ggXSUGyqepPsPTdKHV3xlOpaI6V8Fj+FJ6MpIIaUBZwTgC9js0pQrBB TrUpDGhAfGDYBWLdSmSJ+WDnww0ncd71OrFeUF4Tvl3ZLCiHBLad3A1qnGtng3c7HX3b wMFk7wm0N6S8zSxza/1lOWXakSLrwDJrKiZT0yhY6rhwwojB11LJ8O2/t/f16JEL58Sn w+lA== 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=fS7xlk8exOPxYXHFLdn8iabPIslSYjRlhaKGdRBrbZw=; b=nV9+QO6FXewYro7zbxYEYjcXaiv8JFm4VwMJe0nxTuvmsXZLPESJYUDs+0k9PbKSQo TUldTmigYHyD/uZ7gLMaoffv6FvRUlAA5ic/iwKUxLMyfDpeVbiIm6PaOJo9zWta8/ZU +4cTHe4CuDvO5937zRDxw9xPU3ZBqd/9TqsiqfDVpGU14tD+clXEdmKPi8yvALdAQt18 Kt0MvIDA0DeIBehugHHjBmGHBa9BIw2+fyYqwMam3BcAJNc2ujhxMgKlI1G4K0Cbfvl/ q0oFJbbyf3W5mAn8YomCw8r+LMCDpqe+Z0jkeR0BgnD0iOBmTyKHxZox4vkS3iiyH8WV 3GlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MNJusS+5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh38-20020a1709076ea600b007309a570223si10443513ejc.609.2022.08.31.11.38.09; Wed, 31 Aug 2022 11:38:36 -0700 (PDT) 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=@chromium.org header.s=google header.b=MNJusS+5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232966AbiHaS2U (ORCPT + 99 others); Wed, 31 Aug 2022 14:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbiHaS1q (ORCPT ); Wed, 31 Aug 2022 14:27:46 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFC8987091 for ; Wed, 31 Aug 2022 11:23:36 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id o4so14933886pjp.4 for ; Wed, 31 Aug 2022 11:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=fS7xlk8exOPxYXHFLdn8iabPIslSYjRlhaKGdRBrbZw=; b=MNJusS+5Xh80LA5c1pprHLLub+S28s+9/p/b/OOz7IAJSptPqkqQlXfv5FO9nna7My MOnGz7gea2rJeQf4IClBH2ymUQoF910kZAFSn4Op4vV9G0z3m5++AuppB6fHkfzGO741 uZaElfhQRXmG5iRG0vhJY3t97cmpA8p041qGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=fS7xlk8exOPxYXHFLdn8iabPIslSYjRlhaKGdRBrbZw=; b=CLm/XU1bAJSM/Xfkmxv8/6XkthJ2JyVQ+ZPX+Rpgn7GtYxS5Gc1KUfwlQQwcZVZ++b ptK/Fex2nvO/awQS0P6q5jad+yWAvMo/+AAfl50wd2ksBGz/NmQ1mc4IDYYIfDKIZKM5 U3wSNKqFXGCb5IolpqLAW8vON/solSmvQOIr5/aUtbYEEi84uo+5t12LATH6tV2LteAC eDBSqozAxsKxQAQc+biweTDVClta8MOPoMsLBw4IfFcJMz2u9etnPNJM5SAKsM9dFSWq rfBXEY3biJZWwXdxvAJxqRZVttSl9Or8bNg9BldYjyWxzKFP3o38Jiiw6rdmGw4X8n0b ILIw== X-Gm-Message-State: ACgBeo1CSkhJ8BtJiTGB+8S5NWK2lVPbVGaWvzcQY+1pWp/Vt8E12JIC YuWMZzxv6y4J5C4wsHwORgQvNQ== X-Received: by 2002:a17:90b:3803:b0:1fa:ebea:e90e with SMTP id mq3-20020a17090b380300b001faebeae90emr4544973pjb.111.1661970215991; Wed, 31 Aug 2022 11:23:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z9-20020a17090a170900b001fe136b4930sm1590311pjd.50.2022.08.31.11.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 11:23:35 -0700 (PDT) Date: Wed, 31 Aug 2022 11:23:34 -0700 From: Kees Cook To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [PATCH v4 16/21] objtool: Disable CFI warnings Message-ID: <202208311123.CFD2B1B9@keescook> References: <20220830233129.30610-1-samitolvanen@google.com> <20220830233129.30610-17-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830233129.30610-17-samitolvanen@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Tue, Aug 30, 2022 at 04:31:24PM -0700, Sami Tolvanen wrote: > The __cfi_ preambles contain a mov instruction that embeds the KCFI > type identifier in the following format: > > ; type preamble > __cfi_function: > mov , %eax > function: > ... > > While the preamble symbols are STT_FUNC and contain valid > instructions, they are never executed and always fall through. Skip > the warning for them. > > .kcfi_traps sections point to CFI traps in text sections. Also skip > the warning about them referencing !ENDBR instructions. > > Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook -- Kees Cook