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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46F81C433C1 for ; Fri, 26 Mar 2021 04:36:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A341C61A26 for ; Fri, 26 Mar 2021 04:36:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A341C61A26 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=PEQ6D/pW0nX2xiD/p3qtLxiE5QrKInLeUChbKeJYuOM=; b=Omrufkbxb851ESbuHyTG96kWT rxqO8AwwDW/ikVj/gkUcUjpnX5194Y1reZyAxIwg93X+RmYrqf5HssvMYVjfOeK231/eZ6425XlxS 2CVtvHqa74Ppv/qaZA4Y9xJuwHWhYXbxSRHjx2Op+UWWBoeb/QrwDRKFvi6K2NoKibBJYeCit0TMr bewVzxgXDKoZj+sZN5QO4bBE+HJsVLiJCmR41SwDaVEG+qJmSSxl4yGH9cfxY8twiG1QEbYJaUMw0 rHDM883Z9qwe1F/FPxPs+gq6VfOIpb7huDQx7/iuBOGGsMDFXxrVLb+tWCWgaI8z7D830aDCV2KmI n72nQ0jVA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPeAn-002l6L-MV; Fri, 26 Mar 2021 04:34:13 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPeAh-002l5x-Gm for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 04:34:09 +0000 Received: by mail-pg1-x531.google.com with SMTP id h25so3789948pgm.3 for ; Thu, 25 Mar 2021 21:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=z1EPeptCFoIaJaJVsVX640bsVfb5dv09v+eTesBEdqU=; b=L33UBWhhTV0f0TkrQMXt+B0VKX9Vlp3fb+/k78HIXW/yrd0LU0Om96mIq2bNG+r7xH 5RzEDHiSIxJe6Qo1t9vt49eiID6LFyta9K33XFxXNDxpmV/PlZ0wbsclB3yvkHHpJffs QjWaq7BabNEk9dYp9Y1/B2mFH7xUCJOw1mokE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=z1EPeptCFoIaJaJVsVX640bsVfb5dv09v+eTesBEdqU=; b=uEsKi/CKB6rmPtGSo1B/2JkX0BCKd7oZdilpbo/MeyCLxcEzLq+u5CULD5HBsT1rWd MaCyBQwpTRgcyHd7738Az0ANMPQGtnWB1OaHNMhdrvAT2FfbYzlQJffOL6cUNuciSOHF LEgrMdHF4os0EQGIkklXTP2f9VxXth96lE9S6Bt4nPduI3wfpVt9afCWZXj9I5MxA7EO ef5c8YaLUhHvNvBOTmqk4UvA7Bd443baHYvpcLPmgnGm//6yZkqwZx2xM9qtX3760TnT KYg7OST4BkkZqkB7HWQ6TIsPpJ3eJ0i6NIu36OR7a0WAV6bg+KgbqjUc2gexR0PSD6wB Bh/A== X-Gm-Message-State: AOAM533YbAcdyKOFqw5lMyFzBabNc491Xj89AREw+Up5E3+osFFsn6b+ 1KIvGwnC6QDzPPhK5tB7eWfrXg== X-Google-Smtp-Source: ABdhPJyXVZPxtB7HYMsPfMGgcKqDfIITOg/pt8Wm93KxfhLZgWVnApKcmHPTpqIeTPK3vTEVX3bBXA== X-Received: by 2002:a62:fc90:0:b029:213:be9a:7048 with SMTP id e138-20020a62fc900000b0290213be9a7048mr11194418pfh.4.1616733245174; Thu, 25 Mar 2021 21:34:05 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l4sm7513908pgn.77.2021.03.25.21.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 21:34:04 -0700 (PDT) Date: Thu, 25 Mar 2021 21:34:03 -0700 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , Peter Zijlstra , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 04/17] module: ensure __cfi_check alignment Message-ID: <202103252133.339A7A49@keescook> References: <20210323203946.2159693-1-samitolvanen@google.com> <20210323203946.2159693-5-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210323203946.2159693-5-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_043407_783538_352CAD4B X-CRM114-Status: GOOD ( 13.53 ) 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, Mar 23, 2021 at 01:39:33PM -0700, Sami Tolvanen wrote: > CONFIG_CFI_CLANG_SHADOW assumes the __cfi_check() function is page > aligned and at the beginning of the .text section. While Clang would > normally align the function correctly, it fails to do so for modules > with no executable code. > > This change ensures the correct __cfi_check() location and > alignment. It also discards the .eh_frame section, which Clang can > generate with certain sanitizers, such as CFI. > > Link: https://bugs.llvm.org/show_bug.cgi?id=46293 > Signed-off-by: Sami Tolvanen Yay macros! :) 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