From patchwork Mon Feb 8 14:55:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiss X-Patchwork-Id: 12075807 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=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 95C04C433DB for ; Mon, 8 Feb 2021 14:57:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2EA2B64E7E for ; Mon, 8 Feb 2021 14:57:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EA2B64E7E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=AQLGuKvXNPw6GChoaNjt8yqB64lseVhKpOvK3wiGQjw=; b=cm08jK/NfA1fmz5CSbBvLUrOFp xiRsOk3Dmx2Hu5i3OHjWpTteviQyqlqrEnqPRl7VB5xkeEoiMXoQvRxQ8CJ++tzBzuhrvXTBJQjtA 9L36GSb8QUufD0zSY5HzHYT6VaAqVmmvkCWoNKg5ZQEEr11MjP72hDeQpo9x+otpQnkAA04x8mTjO /b1dzIRUDkGL/kK9xuMGWIvhnM3dgLEzscN0of5pEkHiIWjdqy2ZwOIN0IGZ4USstuF0mL8IzTufT FS2MdDi/yEVurPctrRh24kdnEJmwlr64OsC9+6Obx6m13GgZNYyK6elP5Z7itZjnIFf9wDnLSwFpn svQJ+Ibw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l97xO-000237-NK; Mon, 08 Feb 2021 14:56:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l97xM-000229-6o for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 14:56:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CAFDD1FB; Mon, 8 Feb 2021 06:56:00 -0800 (PST) Received: from e120529.arm.com (unknown [10.37.8.4]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 861F73F719; Mon, 8 Feb 2021 06:55:59 -0800 (PST) From: Daniel Kiss To: linux-arm-kernel@lists.infradead.org, will@kernel.org Subject: [PATCH v3 0/2] arm64: split ARM64_PTR_AUTH option to userspace and kernel Date: Mon, 8 Feb 2021 15:55:52 +0100 Message-Id: <20210208145554.2164638-1-daniel.kiss@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-ARM-No-Footer: FoSSMail X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_095604_324438_1360137A X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin.Marinas@arm.com, pcc@google.com, Ard.Biesheuvel@arm.com, Daniel Kiss Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series is to support pointer authentication in userspace independently from the kernel use. Use of pointer authentication in kernel depends on toolchain suppport and might not be desired in production due to deployment problems. Debugging the kernel also a bit harder with PAC. Let the distributions choose where the pointer authentication is used. Config structure for BTI is similar. This patch series can be cleanly applied on v5.12.rc6 The patch series has been tested on Arm FVP in all three config combinations. Changes from v2: * Moved the toolchain version check under ARM64_PTR_AUTH_KERNEL. Changes from v1: * Keep the A key in register while running in the kernel. Daniel Kiss (2): arm64: Add ARM64_PTR_AUTH_KERNEL config option arm64: Conditionally configure PTR_AUTH key of the kernel. arch/arm64/Kconfig | 33 +++++++----- arch/arm64/Makefile | 2 +- arch/arm64/include/asm/asm_pointer_auth.h | 63 +++++++++++++---------- arch/arm64/include/asm/pointer_auth.h | 20 +++++-- arch/arm64/include/asm/processor.h | 2 + arch/arm64/kernel/asm-offsets.c | 4 ++ drivers/misc/lkdtm/bugs.c | 6 +-- 7 files changed, 79 insertions(+), 51 deletions(-)