From patchwork Mon Apr 15 13:43:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13630084 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 1E3DAC00A94 for ; Mon, 15 Apr 2024 13:44:25 +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=BnB7YND7zWkWKn aNSYUbojZmv0DXfn9peDyO4jsl1ITjIx3/axJ/9d5hSrRWVKyjcPdHF7y/MBy+1lHZIxkHixFoVg9 7isPpabJUrMVkmcBh3EWKiCwr+mnRW1Xoxus5Ak8NIw4bLAcZ8BVtwgP6XVgSJd0OVkAzg1k2HQud Xrv7FiI+GyH5/vUOjzwQOvoUNfYMqw2oKb893TnoKl7tTTuxAcGHH+rmkVYZUA37ynv1gVyHF54sy VRkn0XyTfsi0sa/ucsXHKpBINFXUvugzDTvrwK3HGpAauNCgyOzPU3MDI9R/JRCe0WvcEprKQ8ex4 V4wttOOrok2OR6oSMsRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwMd4-00000008Xkh-3POo; Mon, 15 Apr 2024 13:44:14 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwMce-00000008XT5-1Qkl for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 13:43:51 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d4979cd8c8so28653001fa.0 for ; Mon, 15 Apr 2024 06:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713188625; x=1713793425; 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=qfHIcwkU19IH3gdz1k6NCq2Ug8BqvZiU+NCvJJFiHs8ic2k36dW3Z6D4AGV8DsEJtf GYo8nqVhTV5XhqXjgzj9pkPQL5rGHTlGbuF+k01G77iGJaneAmxekz5QVpVbU4tTGBXC 3crXZHZsHWah9gVX9DSllbuu/08+Hod2WLs0dvR8l8EUO3G7WRWCjHkfr552l14XHbIF dH9IBIV4kzVwpvzXFUVuEQP8KhQddwrzkY7cN1khbHc3J2fA7uWttsZD2vNYWSClFTaJ Zkx0hF1rxnh0CeDtPTVguKfL9WypmgKMbBRi6Vl7dJ2lEOxGUUDz6WxoebMQ8GF0douK vy5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713188625; x=1713793425; 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=Wuv07sOumWcdGwiMdGopOM1QMgdgG/ywESsMLNwmWGkmxz1npTtQJXu6EORh2J/oqs 7JxTkMYLPzU4vSCJmITIblA5q5SDjiO3hkjLhovCl7zWALXH52OTLDfvMskMZhNCaQ6D 9oFfNvE07NGmRebstuyhBcL0okGJhxf/19sk09JYFqchBqXEHIbruOYv+F2NoYUAcu1Y SUyhMVPUAphTfPbyuTQM02aEbCvkHDKcRuEX8bcg0zJMBSgT0Lpe8PYcvzNZQA6uqGmH SWKUqPAQ/GIuhwQtKxMuWm0WIVwRH7zk26EV7EwNnBJqD9EYL3mSgEHwsS+M8BQ1gI4o rxJQ== X-Gm-Message-State: AOJu0YwFK6vsZqhw64A+uvucctIKkOsDOfeWnJ+D/v0AgMksGDuqVEku bJwIkZSW7ARatJW4gJ+NdII0FExEOxNMxrj9vEclngluq9LcPj9rxVSjZ/9m2E9ftPHn97FmY+B D X-Google-Smtp-Source: AGHT+IEmyCgv9WW7TFMUR7JYOcSk9YY4+1KCbUsCbRpdV3oTPSyMbS3vKIvR5G7m99Geqd/RcnjwLA== X-Received: by 2002:a05:651c:1053:b0:2da:b13:f405 with SMTP id x19-20020a05651c105300b002da0b13f405mr2699614ljm.13.1713188625317; Mon, 15 Apr 2024 06:43:45 -0700 (PDT) Received: from [192.168.1.140] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id p11-20020a2eb98b000000b002d43737e2d7sm1297988ljp.30.2024.04.15.06.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:43:45 -0700 (PDT) From: Linus Walleij Date: Mon, 15 Apr 2024 15:43:29 +0200 Subject: [PATCH v5 10/10] ARM: Support CLANG CFI MIME-Version: 1.0 Message-Id: <20240415-arm32-cfi-v5-10-ff11093eeccc@linaro.org> References: <20240415-arm32-cfi-v5-0-ff11093eeccc@linaro.org> In-Reply-To: <20240415-arm32-cfi-v5-0-ff11093eeccc@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-20240415_064348_599017_EDDC3E19 X-CRM114-Status: GOOD ( 11.27 ) 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