From patchwork Fri Jun 4 10:04:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiss X-Patchwork-Id: 12299395 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.1 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 460B1C07E94 for ; Fri, 4 Jun 2021 10:27:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1064161009 for ; Fri, 4 Jun 2021 10:27:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1064161009 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=+nJ25BLK6k9juxLIR7lPml9QRKQ5A2GFr1GrTIu2tcU=; b=27ZrmPsuDDa1Eh c5NZ2T3LGPtvdGiCqY3m0PDfcsPsgkNzccK/HK3gRzk2CzqF+nu/OYn9cxgA1ejoQYQPO2kLEk+k9 Ysy8jBwMoX+cWfeu8++w+iLDcCl0vz4FEn3L4F61OPTlQH8NStXbIA6iRbb52AKLfrJ+fD8CQegUL vZ7jzkzBK5flGlKRzdjpSPpIjE9QyeJYC3CFzGRRpmbuIAbt2N7DiH1KxAY9mt/98mVCyMSVVxWBA lO2QSd8vuEgx9xqurMaxCOFPQDU7Rv05H55kNzZv3pWsHKfVQ6sSe0JrcZT1Cvre9NK8VFNtruRF5 6Db8oLBKVmp/wRq6YLHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lp71T-00CwgN-5a; Fri, 04 Jun 2021 10:25:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lp6hK-00CnsW-E1 for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 10:05:11 +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 4529112FC; Fri, 4 Jun 2021 03:04:57 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1BBD43F73D; Fri, 4 Jun 2021 03:04:55 -0700 (PDT) From: Daniel Kiss To: will@kernel.org Cc: Ard.Biesheuvel@arm.com, Catalin.Marinas@arm.com, linux-arm-kernel@lists.infradead.org, pcc@google.com, Daniel Kiss Subject: [PATCH v5 0/2] arm64: split ARM64_PTR_AUTH option to userspace and kernel Date: Fri, 4 Jun 2021 12:04:35 +0200 Message-Id: <20210604100437.1658599-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-20210604_030502_562332_176A1FE2 X-CRM114-Status: GOOD ( 11.03 ) 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 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 5.13-rc4 The patch series has been tested on Arm FVP in all three config combinations. Changes from v4: * Rebased to 5.13-rc4. Changes from v3: * Removed the duplicated #ifdef block in asm/pointer_auth.h. 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 | 49 +++++++++++-------- arch/arm64/include/asm/pointer_auth.h | 59 +++++++++++++---------- arch/arm64/include/asm/processor.h | 2 + arch/arm64/kernel/asm-offsets.c | 4 ++ drivers/misc/lkdtm/bugs.c | 6 +-- 7 files changed, 91 insertions(+), 64 deletions(-)