From patchwork Mon Mar 11 09:15:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13588394 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 1F816C5475B for ; Mon, 11 Mar 2024 09:16:11 +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=YcWCiYSXPZCTR02DodhnH7fKzLrIrk13DlFtZ6SnJV4=; b=006ly60dTHJyy2 tl7QIEXMem9ib/x2UESmF7j0aJf49I16UWK71qBf4K2C71jXAuLvz/SZQ/lxcC5S7wB21r8gZydRs 1TJcyWgfXxYpTd0SW3pZs0wY4TQ/TeQLyjU+bsOxf6LuLyx4Jo1wqMm9r/QaeiJ2FpLg0oZgiJ9p+ Q4FewxB9gKcyl2UAcsGltx/pSWRwVSw/nS8NdiqLNF6AiYdvyoM/FnezMkE+e/QjXLZAglDvD2JMf U5rsnFl/pqumYFor2kh5iKGGz0KM500J2H/ytOKu09fUZsUWD021SQJDyRuwllZOaR3EvukcxHgXs kD+0cJCM7XCoU/qeTHOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjbl8-00000000mTG-0MTh; Mon, 11 Mar 2024 09:15:50 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjbl4-00000000mPI-14Rr for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2024 09:15:48 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a45ba1f8e89so451840966b.1 for ; Mon, 11 Mar 2024 02:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710148542; x=1710753342; 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=vaHsL9uZaLpUW/gtSno6U8/q3nfzw7ffg7lr4P7gXB0=; b=JPdOk4vd2LPUV+SGYGoL/cSA8BjBvzGSUqBuqKDILsGDdxTiJgX6opw9A5Rp9TKoda wMXQNaEaL/bbX7EwEl9vVRiKwrkeUdugGeqp5i/jkyQoYv8AGIs2zQ4tyEc0PXQ622XZ RI9jsyaS+YXauMlYnhG4lY2m9HPgTKJCsNE++bLk3pXlDs819FTaVj17ozkE7Tv5BfSo AoIwUjvVmxcEtHGqBADY7M/4HimdVvdfUtByBklOXUHYz6hnpyYBjvUNLGVHPZfW7hho 5sNP9skpHyX8plrOBgb896EwWlRFlk1TOgriuIBejiuMocCLix9RdkVT2QTcdkRXdnxU 9+UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710148542; x=1710753342; 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=vaHsL9uZaLpUW/gtSno6U8/q3nfzw7ffg7lr4P7gXB0=; b=q7cabSLCCn5g1bz2xJ8fMkKRTiLW6O632lZ03vFShKjL5fbd7M23oVAHM8I8tdbEl1 aZwZb5LeFw9Hq/Rw1CXEI4PMWetls16RoamhueHqBNXax690Fw7e4mlO9NXa3gyduLfH It16tZPFmq118AliNAxWIPeYC5kpfhtCtVLeLaH78PqEaN3J8VI4bWeG5UR9QUEG3uo9 586L9K2aDDOkrDbfBGnpuMi94XJ+u+Thh1YQI4aZKmgRWDB9B5HFmEAn99mq9x2BdBhU EoL5h/d4aG1ZViHu8fDAmklJZhjjGKexHPQ1sF8nJDO5TLHXdj+lVBV+XS11GvcqKC4S +j2g== X-Gm-Message-State: AOJu0YwluC1gswX2DeVHte4ETqlZDlRPWubtzBboT+ea4anjAvlMCFFK enXlG4hgT8TqBncWhA0uu3l/OnObt5BO01A0dAtIe6LF1aQ+Njfu/LGgepoTJBc= X-Google-Smtp-Source: AGHT+IH1ShWHVcuL7royJmForLT2aqxmDB6ut5XSUOvUt0Umf/hDQ4y97HyAoJH2LFefeWUMgynafg== X-Received: by 2002:a17:907:c086:b0:a46:2349:7650 with SMTP id st6-20020a170907c08600b00a4623497650mr1957475ejc.17.1710148541902; Mon, 11 Mar 2024 02:15:41 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id js23-20020a170906ca9700b00a4617f1ccf3sm1601256ejb.169.2024.03.11.02.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 02:15:41 -0700 (PDT) From: Linus Walleij Date: Mon, 11 Mar 2024 10:15:38 +0100 Subject: [PATCH v3 1/9] ARM: Support CLANG CFI MIME-Version: 1.0 Message-Id: <20240311-arm32-cfi-v3-1-224a0f0a45c2@linaro.org> References: <20240311-arm32-cfi-v3-0-224a0f0a45c2@linaro.org> In-Reply-To: <20240311-arm32-cfi-v3-0-224a0f0a45c2@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.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240311_021546_328807_CD42F4DB X-CRM114-Status: GOOD ( 11.51 ) 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. 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 0af6709570d1..1216656a40bc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -34,6 +34,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