From patchwork Thu Mar 7 14:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13585769 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 0F2C0C54798 for ; Thu, 7 Mar 2024 14:22:20 +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=Ev22CA0edXCpNr ACIaduAycF9/b7vNbSiJ26+gg6AbokOmpq9xaaquFxBcmU+6seGmYhrnD6x7OhMtD9V3o49uYr0I/ SIt9wRLeEjqnlTbZxhpQA8unS4qiH4UmrMeFguUvSyGVZvB2WMkAgKAJBZ6hG5ZEMJ+kFN+PWNvlG PEO6J3Kw2l/wt+IAGbZ+3rd1XvQgNca3bbEYyLWT8TJBkLdQHELN88I4/V7n+92nWb32riAW6uiQZ SChPmT+aIZ6QAN/i4/A4TSeajR0dO0NBqaEeQ2kYiqhjINdWZ3dbXdr63r9187dWhhzZSKy6Ocgat YYwvIeWMZwW/EnjhHpIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riEdP-000000051AM-3O09; Thu, 07 Mar 2024 14:22:11 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riEdJ-0000000514s-3plY for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 14:22:07 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-512bde3d197so968535e87.0 for ; Thu, 07 Mar 2024 06:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709821323; x=1710426123; 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=pHytGSbW7uH33b53BOqlBEItuwdX9knadICdjCx1RdPw+8okl4x6rP9lwbrsgppvqh VB4X5RvPvhtTjL1ByAxKBA1NCyUaGUdRr47NEEcq4sZG3ZJdY3fiuftLJxlC7QeuvjpE DIqg7yVM2Sfl9k+mQkhBSB/1sb4MWWBPzQv/+D+O5g6wXKr22+zVo1wTRepOPWER9o+1 CuYN9IYaJadzxewPgvG7T6Oh6CP7mbsvLmDMAlwfTtuMwcrS2ul1bGa1LhCBmYG1duUa F89IQDS7yNNWN0h0bZctXT0el95xLfLoQ7WMOuhssy58jgENNpT4eJTCxUwyF5dDyuK5 RhCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709821323; x=1710426123; 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=lomRRksQVZ8cvg2K+Qo7shHP6c99kBxNNa91lnymCMHadSFuLxz1k5JjNANvbnCyQq RWFmhbEHpc74GHb8eNcEdJ6bEzbQVaVxSC+jLRj+MLoeEXu5asN4ohCMglfFId/2QnH1 YtW5UOBaQ3SVf3MXbFkICVjOMjn4b1FkR+Oii2+yGnyvDS27Bdtd0Ipc0gSbcFbXTWTD gLPiJz8sxb2FuO3y3+BrUntCAF86wslBCRPXh0YRqo4f8bvvHcLcaTMF/3HawnIhd+Bl kbrpIBuhE4UeHONdP9hYMprOVOoqKhjP1bIfyEvh6Cl69gMVRCGxRVO6gyzuzmCWSWyU YFfg== X-Gm-Message-State: AOJu0YwQkSH/gwaydrmKwq8Z/5JNPLCjhR9Tf3Z3LdpjpUPlnKhJNBwm m0xUsg//J5RbSENkhCEE3oRbjsBCAsd1+wgRAKe2mjj+o7IF8N/9BRl6rSoOjhw= X-Google-Smtp-Source: AGHT+IEjEs26cHK1t9iAXvxyu/L9BJnGLeqBGsWPyI0GJgRqzy6czqPbkg8pKDhoELdHGfHHlDTaeg== X-Received: by 2002:a05:6512:3b1:b0:513:600c:4ae1 with SMTP id v17-20020a05651203b100b00513600c4ae1mr1522176lfp.27.1709821323348; Thu, 07 Mar 2024 06:22:03 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id x11-20020a19e00b000000b005133b381a5csm2417137lfg.90.2024.03.07.06.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:22:02 -0800 (PST) From: Linus Walleij Date: Thu, 07 Mar 2024 15:22:00 +0100 Subject: [PATCH v2 1/9] ARM: Support CLANG CFI MIME-Version: 1.0 Message-Id: <20240307-arm32-cfi-v2-1-cc74ea0306b3@linaro.org> References: <20240307-arm32-cfi-v2-0-cc74ea0306b3@linaro.org> In-Reply-To: <20240307-arm32-cfi-v2-0-cc74ea0306b3@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-20240307_062205_985558_9931D856 X-CRM114-Status: GOOD ( 11.71 ) 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