From patchwork Fri Apr 16 12:50:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiss X-Patchwork-Id: 12207619 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=-11.8 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 47812C433ED for ; Fri, 16 Apr 2021 12:53:11 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 0CCE1610F7 for ; Fri, 16 Apr 2021 12:53:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CCE1610F7 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=desiato.20200630; 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=u4pyug6IHvnDqtybljy4AzCvkazJ1gVhz+5eVbCZXcM=; b=rL4xmL8otg6apqszUaR7JMFE9s 0eOQEObvCzjK/YBwoBN5/hiCMaH9RBA6zjBo1tQw2Q6dxPCAiSw800BT9vuAqQg/E1gz6uGmf99Mw uQKtWxW2bpxxV8QFt/+ESFj3YhzH8YQkGuuIcpBRDj0WqR3c6CBV7C3UcEI8AB7UUKy1/AWbdgK6K LEDTcjqK5ASrz7isv/hIBJLXpTABjUs32F+uBy2lph3+XR7hii1pPzEW+H8CFWHiTYh5Ln4gXObEt xTaLAnhahuBo3LRZzdq6PbSWhe5eTgJgcyUHln3mFiFAbiRppBlnnOcdA2iFAcl2mE6pnKJmILAJH sqRDTNBw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXNwR-0027NV-7e; Fri, 16 Apr 2021 12:51:23 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXNvv-0027Ku-QA for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 12:50:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=35hvsD+a4NKbOnwHM8HBGKa5d2yJOFSxv2IDlI1yKD4=; b=xvA2Vrop+Uq2EEt692Mq0QIVCK I7UDB/SdULniKcjVwGZjrmB7p9cHWAAGm/fxDY+O/OuMpSDnGe0y9I1py/5FEJ4OgnbUo7wkrh54V YmoAJlMR2qjH8SDv4BG6UuY/J/rm7e5fEiyH1hFpWzjdlVzn3DOol7aUHrqwl22Le+1TwPjCG1YRN E5Vdusadaie64135EihjI3owKcow3lAnFFkN78ApHIrOUsarGcBGqDCDm0yoRshKLlF9EZ0Yn8EO+ 3fntSXkXFGyP8QqRTcgQDbKctN5CQoJ1deBT10H+lZm4nG1dWxHbDxgxBnN8vnQA4kDhJ2J5sl2VR nSBgOTlw==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXNvt-009N6K-AN for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 12:50:50 +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 B45C811B3; Fri, 16 Apr 2021 05:50:39 -0700 (PDT) Received: from e120529.arm.com (unknown [10.37.12.5]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7FBC23F85F; Fri, 16 Apr 2021 05:50:38 -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 v4 0/2] arm64: split ARM64_PTR_AUTH option to userspace and kernel Date: Fri, 16 Apr 2021 14:50:13 +0200 Message-Id: <20210416125015.2651652-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-20210416_055049_433678_24809DA7 X-CRM114-Status: GOOD ( 10.73 ) 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 v5.12.rc7 The patch series has been tested on Arm FVP in all three config combinations. 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 | 63 +++++++++++++---------- arch/arm64/include/asm/pointer_auth.h | 44 +++++++++------- arch/arm64/include/asm/processor.h | 2 + arch/arm64/kernel/asm-offsets.c | 4 ++ drivers/misc/lkdtm/bugs.c | 6 +-- 7 files changed, 90 insertions(+), 64 deletions(-)