From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A508468A for ; Wed, 31 Aug 2022 18:23:36 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id mj6so9883843pjb.1 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=u7GexgSUWxEvsU9WxPwnXNfTHr36IcGhEcAqavRg/2ZTAspgkKE2w2h9SVULvpAD8i /4m8yj3gcXVjDjGHj22kJJnf64WcmSZ9nbhJe0bL7tcRo+35zRyYlTmbpbv2fio1hdUx X9IIEZZ0N7XLzd3yw6VhiT77T0SVULXc1lxvVmXYMuuXvrJgeWJ9TJocTc+m/y2Leda9 rzJTL1bV/HSoUE1ZGuz5tOfr6rccwsZr6t+t6dIQ38iQUK68Hc/hiGPHq380RE6Jga6o iYPxwix9P9tdWpxHpDtFNCENFyS7pkdBhKGThBU3EJSrircr+g3GnFXXunJ5nG2BkM1v 0YpA== X-Gm-Message-State: ACgBeo2NQoVYVMf435V7Vv4RuYmkMryDCOrsfoFqc6SCsPoUxwwjbAtL 2/+ZBBt+CzFN+ziVTwP6iqNwDQ== X-Google-Smtp-Source: AA6agR6p0pm5G+0tEg3FHLipUz0PBlM7zrfbRO94La2RKxHAydUxfZxpVV8PdPYV5O1NMEFkLbhxJA== 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> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830233129.30610-17-samitolvanen@google.com> 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A786ECAAD3 for ; Wed, 31 Aug 2022 18:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gM1h9euXNZ0/KTBD75PkSsqeyNC+TZbmiiH94MyZsjg=; b=y/OtH3H/fJ4feh Y2Gv4cZEC6fwZSGeL+4emKBlxGknkx+ZkCLIs2NOQY4LqE7VT5xvBiayiIP696nceqMC6BmCNW+TU K7JK6ThpMbMLtuT7r/zGE3Vne3BY2zjlLX1ngTAHuo6BUMK/jxpinmiy87KGhlHP3JsxSkJ5Hnm+f twYipTmKZnLI+E3n8wuyzpgoK5V8+V3afDkhnoL3thxCJASLyyujVbNZduz9jjMHmwsrsMjM2mc/Y +s2jaSpW5RKFmXiBk6CCB96zrR+5fSMkv0txILcTwzn8/+6OORh9D8EXMyEISW9ywH3ivTeGpHNTa JP18Yfvgj0ngfUasiv2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTSNI-007XfT-8q; Wed, 31 Aug 2022 18:23:40 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTSNF-007XeG-Ck for linux-arm-kernel@lists.infradead.org; Wed, 31 Aug 2022 18:23:38 +0000 Received: by mail-pj1-x102b.google.com with SMTP id t5so14970136pjs.0 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=a5NIYc8BuY77k/NOdhiKgp+b3jTlyro6Y8G+0M0LeGfytQhkUOsPZ8ABSy2ACU0amA 9zrh1LOIoURIFyncOBS3j7hZ25RVUzqJy4WA6CVffvy2Ue5EqmzvmbU8yuidJVEc26Qh 613Meh1ZIaLlhISTOAL3di8I4o3fLuIlyT4CJ6XIV5AUJF47iwR4yjiD3yzlYOve4c12 RWSWO/5TciAZyi8jSN3XsNhoTyzoSG3ycqEFg9VkLSgdSIdf3enIbUlzaoIj6SNp1EFP 0BeehW+9RlX2bxEsS8x6NVNv9orhUAaLeUC1leKDjh58a6vPOk2eavbHxuKZO8ix43NV Q0hQ== X-Gm-Message-State: ACgBeo20klkP5xF10+miYYtTXkDbCcS42/fGaMOb7w3sky47//wNqOq9 678oVJoIugMiSzd+5Ki6E+9F7w== X-Google-Smtp-Source: AA6agR6p0pm5G+0tEg3FHLipUz0PBlM7zrfbRO94La2RKxHAydUxfZxpVV8PdPYV5O1NMEFkLbhxJA== 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-Disposition: inline In-Reply-To: <20220830233129.30610-17-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_112337_438948_611099C1 X-CRM114-Status: GOOD ( 13.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel