Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3277683ima; Tue, 23 Oct 2018 03:23:32 -0700 (PDT) X-Google-Smtp-Source: AJdET5e1zrRoTYX+f6380zOQ85Kuwe8jd9t05PbiabFuKkyZBOsIJ1GeAsT0SErg+uT1fVa0Wdqx X-Received: by 2002:a63:82c6:: with SMTP id w189mr3261250pgd.344.1540290212603; Tue, 23 Oct 2018 03:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540290212; cv=none; d=google.com; s=arc-20160816; b=vhCxmiqGkHRnt3UEbrI5vo8BqJ5V9EJwdfRCuTUDnqnL7N5cqp3t0bvGlWyECuO2ab 6dgWJ1OqWg4v1WyrgPwPvM0eg8twaXPwEH4Ntk+EjFP8JQaDtqz+aedpXPcw52ZybAwj d3nSo6MpE6oOFILGkRU7gFTx2wVmmDkAv9u39CIY4sgBdFRZT1nWrw2ttjL4G2IVwqdc tOsl/O97URLfShvy/o9AMYjFnKS2qke5MtnFl3zNo/qbsdTIzwXgdMVScJ1YN/6tJ7HM OsF01KWQKlOD9lkkTWU+8o0WCd7/8s4ljg9tAgPJPqJ+nmc89Lr1L04tsgvk5arEAJcC jtmg== 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; bh=J5NKNGwl0o0oe8LO3bRZnyNaUxgQjT3HxD7maQB7MxQ=; b=rL0oVQ17WBumHFSPRc5h+dH1qqTibMJn0YwIK5Tff7nFS0odgUeprvGoNYHVbhfQl1 4Nt5VxpkKkFU+k5oNZocCRuxOt9/iRCNzrRYEjBT0Kz4t+i4AtnQyQn39AhbpTcmqf5V jRdFVuwvZNtRRWFxM/IQ5Q/HwsmibJPo3/PjVAN3Dl1anGEOjvTEwskHajbkYIjbxyZ5 FsgvVTkeaL0ZINkgulGM8ILUUhz3LcoITeSGeaMwXBVZd50qgBLrZGTyiFHCLKgVxDN+ TwNF2675BWzTeRYRP+p3l0ZJNhazKKQYRx+r2GdLAsEKtv3QPn5PKDVECKuChZMyGovt pmCw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t14-v6si883633pgh.93.2018.10.23.03.23.17; Tue, 23 Oct 2018 03:23:32 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727568AbeJWSnE (ORCPT + 99 others); Tue, 23 Oct 2018 14:43:04 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56406 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbeJWSnE (ORCPT ); Tue, 23 Oct 2018 14:43:04 -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 DCFDA341; Tue, 23 Oct 2018 03:20:17 -0700 (PDT) Received: from brain-police (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B4DE3F6A8; Tue, 23 Oct 2018 03:20:14 -0700 (PDT) Date: Tue, 23 Oct 2018 11:20:09 +0100 From: Will Deacon To: Ramana Radhakrishnan Cc: Catalin Marinas , Kristina Martsenko , "linux-arm-kernel@lists.infradead.org" , Mark Rutland , "linux-arch@vger.kernel.org" , Andrew Jones , Jacob Bramley , Arnd Bergmann , Ard Biesheuvel , Marc Zyngier , Adam Wallis , Suzuki Poulose , Christoffer Dall , "kvmarm@lists.cs.columbia.edu" , Amit Kachhap , Dave P Martin , "linux-kernel@vger.kernel.org" , Kees Cook , nd Subject: Re: [PATCH v5 07/17] arm64: add basic pointer authentication support Message-ID: <20181023102008.GA8989@brain-police> References: <20181005084754.20950-1-kristina.martsenko@arm.com> <20181005084754.20950-8-kristina.martsenko@arm.com> <20181019111542.6wrvjguirglzg7vg@mbp> <5ca5bf92-f2b7-48c9-ea41-5efeff09a799@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ca5bf92-f2b7-48c9-ea41-5efeff09a799@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 23, 2018 at 09:36:16AM +0100, Ramana Radhakrishnan wrote: > On 19/10/2018 12:15, Catalin Marinas wrote: > > On Fri, Oct 05, 2018 at 09:47:44AM +0100, Kristina Martsenko wrote: > >> diff --git a/arch/arm64/include/asm/pointer_auth.h b/arch/arm64/include/asm/pointer_auth.h > >> new file mode 100644 > >> index 000000000000..2aefedc31d9e > >> --- /dev/null > >> +++ b/arch/arm64/include/asm/pointer_auth.h > >> @@ -0,0 +1,63 @@ > >> +// SPDX-License-Identifier: GPL-2.0 > >> +#ifndef __ASM_POINTER_AUTH_H > >> +#define __ASM_POINTER_AUTH_H > >> + > >> +#include > >> + > >> +#include > >> +#include > >> + > >> +#ifdef CONFIG_ARM64_PTR_AUTH > >> +/* > >> + * Each key is a 128-bit quantity which is split across a pair of 64-bit > >> + * registers (Lo and Hi). > >> + */ > >> +struct ptrauth_key { > >> + unsigned long lo, hi; > >> +}; > >> + > >> +/* > >> + * We give each process its own instruction A key (APIAKey), which is shared by > >> + * all threads. This is inherited upon fork(), and reinitialised upon exec*(). > >> + * All other keys are currently unused, with APIBKey, APDAKey, and APBAKey > >> + * instructions behaving as NOPs. > >> + */ > > > > I don't remember the past discussions but I assume the tools guys are ok > > with a single key shared by multiple threads. Ramana, could you ack this > > part, FTR? > > Sorry about the slow response, I've been traveling. > > Ack and Will's response covers the reasons why pretty well. A prctl call > would be a good enhancement. One minor "gotcha" with that is that the glibc prctl() wrapper would need to be annotated not to use pointer auth, or we'd have to issue the syscall in-line. Will