From patchwork Sun Apr 21 18:28:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13637486 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 2DB0BC4345F for ; Sun, 21 Apr 2024 18:29:15 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0TbLH7wKKbrcYnx9DbMBx4XVWZuvFXrho3TkRkJPtqQ=; b=Bb2/EBwV5tR+4B NrGZXyDq1TsxVlPdEiWh2FZf+eWBL1VH+jhZgkSgL7hyIsTRSHxnvnx9GpDEcQ0OET7jPYneO+Vg7 h7rbzgWj/PMNMi2NGdFOayDgZ8TFl/708wzIiBz0WMJGKCeOtEc8UOjuR9zL0iFFCpuMG7ScD4s26 YxZ/qDviw12GM/Vdfq8oMWXGCTcVaU3U6uDO1H/U8sj2OJlMnrl+RCeNfTg7uEiZqZylPQO6E4QnA YWRh2FcjQCrrkiWQee28GDfSaU/pYZf0+CD85s38DJwWsli6t2jbqRtrnuF6MNA7u93VXit4hFlns uGRpzkOym11rESQxPQqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rybvx-0000000B4Ca-0Q2Z; Sun, 21 Apr 2024 18:29:01 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rybvd-0000000B43t-0jos for linux-arm-kernel@lists.infradead.org; Sun, 21 Apr 2024 18:28:44 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-516d2600569so4629786e87.0 for ; Sun, 21 Apr 2024 11:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713724120; x=1714328920; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Y70OTHVL5ivIan0b4DqgD01dRiya5SKhfRNunxoXdLs=; b=MUqHVgI96PXD/GMoLIxnYTLQ486YUtGODWq5OXXkhol7TndZkCqv09uQwmM6o6DqVV h32EsKV4QIfPQef9Q8OYf7fMuDPW868w2mrvXbecrQ0M4j82H00psMSfRJff5vZEJ8ec nJp32R7AFBMsrXCErHThuCESGDG0wurgIszGzyjBfpDoyXK2CFlram8xWMv0hXKlvsVm W3EeVSG8Ma+EVExACurT25iQuDAFUXnN8+IE4y0WZ8yB3ZVdJe373TLfsFQSSOtc+vYl t8GG5kCmxJe6V8rfmJlJrZwZ7qoJpsbC6TF48lFk/G3t02AUpXblK/jHdZXqToC7bf3Y wJZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713724120; x=1714328920; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y70OTHVL5ivIan0b4DqgD01dRiya5SKhfRNunxoXdLs=; b=qakpNyAF6r16klApnlSIobLNtOt+16MjctiHQgQiEu98dkqmegfCLKaooWkaEQqA2M 7CcjRjz9GchugowVFoB5bynC0JJcWIlZnzVK4ZsSEzgU6nNQKTd+btXTObl7XThdV/Ay p4W3JWhy3YHDzEFOXeQKt9JLI1odOefSAUMle43N5LX7/hMG9tO2mKylYGe8sCOhI3uU Kg216a2Et8KpzwWa14eaw8oSjTwxfuJ8k/J/zpVqnemFSDaVDBGbtQC6/0mA8k3BeJKC z/I3YDCc2AT8KNnP7F3nU7FoI0wQJ5rwakvkCSe9mkwe+/0E1eOgOI4FR3cMyU1NrH1n feVg== X-Gm-Message-State: AOJu0YzUIHvx9glCuTG7kx6u3+izgEnpeGijr/PtcR42hhaq61B1RYiW yxJMpOphqm3vr6OnKabPot+sLXHKYK4yp5cJ4obfiULo/oo6UafZy9nFBtl0FqI= X-Google-Smtp-Source: AGHT+IH7reJlxAOcCyXD+MSHuuDYG0YRVdcMUSgTIS46/BdvW/4HC0w9owbY9Cg+Mub5s+Jo3qDzbA== X-Received: by 2002:a05:6512:3054:b0:516:e8b1:177d with SMTP id b20-20020a056512305400b00516e8b1177dmr6437575lfb.65.1713724119734; Sun, 21 Apr 2024 11:28:39 -0700 (PDT) Received: from [192.168.1.140] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id s14-20020a19770e000000b005188ea5d2b5sm1549641lfc.303.2024.04.21.11.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 11:28:39 -0700 (PDT) From: Linus Walleij Date: Sun, 21 Apr 2024 20:28:37 +0200 Subject: [PATCH v7 11/11] ARM: Support CLANG CFI MIME-Version: 1.0 Message-Id: <20240421-arm32-cfi-v7-11-6e132a948cc8@linaro.org> References: <20240421-arm32-cfi-v7-0-6e132a948cc8@linaro.org> In-Reply-To: <20240421-arm32-cfi-v7-0-6e132a948cc8@linaro.org> To: Russell King , Sami Tolvanen , Kees Cook , Nathan Chancellor , Nick Desaulniers , Ard Biesheuvel , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, Linus Walleij X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240421_112841_435536_F3C59A08 X-CRM114-Status: GOOD ( 10.99 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Support Control Flow Integrity (CFI) when compiling with CLANG. In the as-of-writing LLVM CLANG implementation (v17) the 32-bit ARM platform is supported by the generic CFI implementation, which isn't tailored specifically for ARM32 but works well enough to enable the feature. Tested-by: Kees Cook Signed-off-by: Linus Walleij --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index b14aed3a17ab..df7bd07ad0d4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -35,6 +35,7 @@ config ARM select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_SUPPORTS_CFI_CLANG select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE select ARCH_SUPPORTS_PER_VMA_LOCK select ARCH_USE_BUILTIN_BSWAP