Received: by 10.192.165.148 with SMTP id m20csp635982imm; Wed, 25 Apr 2018 05:30:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+4IEDQILwB0RVdOlLCdnhcnCPBIWJSV9SaRI4vLr7KgbOq4JxRwUJxpOrpxPhPKsjoXhXV X-Received: by 10.101.78.206 with SMTP id w14mr16644721pgq.83.1524659413028; Wed, 25 Apr 2018 05:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524659412; cv=none; d=google.com; s=arc-20160816; b=eVV7Rwfc+BzRD2mlsEL6wcGLk5Wk3x6acMxOaDLil3eVf20ZOyXg9fbCJJYazGBLJs A9fKTxSMIn0FPDQUKLhljjQzwim8CyxXRRY8Qbbg06wmHSDVVh47nR0vfbxhCMx15Bnn 5HCOf7rCiaWwDpcBphHlTwUi9WzPJOHHxVn2ByZMhOS5Uru64yYedPMZ5kIO27e3LWLj 2OsA2vSuW2cYUAXayPDH0rithSgX7pfq3/AX2HCI6XlcF2iPuY8fNwkh70KHsbfcr6JI oiuH7gP3OZ5vAnInhMPYX+VEwXq3uo+TsOTjBRpfSnBVDF1C9D2Uvafd4Xwpk9bviJM5 RCmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=olHgrSV1JXbwbEQQOUk631b217ua2tc8dyyTQuk6nKo=; b=gG8CdRlFww7riYHbG/5Zn4EXAZL5PeLmkukFUHSYm4iE4Lr4PPX+cAPNjWZQzzTDw5 HvLmcYm9TW8+HavEurz0INWB8p0wHu8AfTUpbp6l6RZpfdu+LE2LDyVjYKteLicivYAG iHtT3E3RMy7CmiqwqWQwf+XQYjJoZLJcfc2JHCqZmGFvsYxhipAwcor7Ikygk8JbRkeS S+01qghIM2yA7tsIBBQPKMVpdx/7koec1xSYsnc/KxDB31WLMMJQDU1gKyGQvtoqgiU0 qZN/iO67VkKHhmvQgdzDTpK0u5xHqwR5lfbykWR2zDM5P1AwOwE+deVoWF+HoYwoFHDq G1iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35-v6si15989768plh.36.2018.04.25.05.29.58; Wed, 25 Apr 2018 05:30:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753919AbeDYM17 (ORCPT + 99 others); Wed, 25 Apr 2018 08:27:59 -0400 Received: from foss.arm.com ([217.140.101.70]:39040 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753897AbeDYM14 (ORCPT ); Wed, 25 Apr 2018 08:27:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ACA731435; Wed, 25 Apr 2018 05:27:55 -0700 (PDT) Received: from armageddon.cambridge.arm.com (armageddon.cambridge.arm.com [10.1.206.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 547A73F487; Wed, 25 Apr 2018 05:27:53 -0700 (PDT) Date: Wed, 25 Apr 2018 13:27:50 +0100 From: Catalin Marinas To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, drjones@redhat.com, cdall@kernel.org, arnd@arndb.de, suzuki.poulose@arm.com, marc.zyngier@arm.com, awallis@codeaurora.org, kernel-hardening@lists.openwall.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, ramana.radhakrishnan@arm.com, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCHv3 11/11] arm64: docs: document pointer authentication Message-ID: <20180425122749.4eqhd2uiofoc7jyv@armageddon.cambridge.arm.com> References: <20180417183735.56985-1-mark.rutland@arm.com> <20180417183735.56985-12-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180417183735.56985-12-mark.rutland@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 17, 2018 at 07:37:35PM +0100, Mark Rutland wrote: > +Basic support > +------------- > + > +When CONFIG_ARM64_PTR_AUTH is selected, and relevant HW support is > +present, the kernel will assign a random APIAKey value to each process > +at exec*() time. This key is shared by all threads within the process, > +and the key is preserved across fork(). Presence of functionality using > +APIAKey is advertised via HWCAP_APIA. > + > +Recent versions of GCC can compile code with APIAKey-based return > +address protection when passed the -msign-return-address option. This > +uses instructions in the HINT space, and such code can run on systems > +without the pointer authentication extension. > + > +The remaining instruction and data keys (APIBKey, APDAKey, APDBKey) are > +reserved for future use, and instructions using these keys must not be > +used by software until a purpose and scope for their use has been > +decided. To enable future software using these keys to function on > +contemporary kernels, where possible, instructions using these keys are > +made to behave as NOPs. > + > +The generic key (APGAKey) is currently unsupported. Instructions using > +the generic key must not be used by software. > + > + > +Debugging > +--------- > + > +When CONFIG_ARM64_PTR_AUTH is selected, and relevant HW support is > +present, the kernel will expose the position of TTBR0 PAC bits in the > +NT_ARM_PAC_MASK regset (struct user_pac_mask), which userspace can > +acqure via PTRACE_GETREGSET. > + > +Separate masks are exposed for data pointers and instruction pointers, > +as the set of PAC bits can vary between the two. Debuggers should not > +expect that HWCAP_APIA implies the presence (or non-presence) of this > +regset -- in future the kernel may support the use of APIBKey, APDAKey, > +and/or APBAKey, even in the absence of APIAKey. > + > +Note that the masks apply to TTBR0 addresses, and are not valid to apply > +to TTBR1 addresses (e.g. kernel pointers). I'm fine with the rest of the series but I'd like the toolchain guys to ack the ABI we are exposing (just this document is fine). > +Virtualization > +-------------- > + > +Pointer authentication is not currently supported in KVM guests. KVM > +will mask the feature bits from ID_AA64ISAR1_EL1, and attempted use of > +the feature will result in an UNDEFINED exception being injected into > +the guest. I suspect at some point we'll see patches for KVM? -- Catalin