Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3328775imm; Fri, 19 Oct 2018 08:50:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV62qRITDGhgScC2+SnhETgLEzl9WExCtD5a3zpubsyrIDUwBTOSO3+6nbVwp4obakwft61dW X-Received: by 2002:a17:902:ea:: with SMTP id a97-v6mr34492083pla.164.1539964227940; Fri, 19 Oct 2018 08:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539964227; cv=none; d=google.com; s=arc-20160816; b=K/J0u2Uax6jXrQcJ+wPJC/lxSbMqtn7f73FseKBIrzd3vnODolvPXWozYSLce3dhwF heAlskSmRYeUjVN+x5cqpkbiq2rq+21c7x6oHK+uQyVlY46fpYrbDgrwnFKPUilUfQvO frGvYJTT4BLfcgOZlOax7HhV0azLGm8si+HC5PwGO963SYL/LqS1ACM/gfz9OLZ0dkXd dJY15D3MHSEkNgwvmO/YT2DUxJ1CYzGsLqVyIIuh5IdJHV3WhYekWdDlQ6mE9z7pIoL2 98QdbOlEPq7DrsSOJ5FVV8XmEJl3SYtSTJxxiqGKUNCP6vihiMgpDfl+thTM3Jlt7UWZ WbAw== 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=D/lM6JO6YFgn+688kEv8Yme6sRHkS/aOFA06bw4G7X8=; b=MJsvHwFA/jcN9YN0ST4F8t3J2NViKFKTCbPct9Qv8zeQnEOb0cd5oBYBuhBJbE53HN 98hTgFTV29hsbRjsFJSpyt/WCQ0wfxHAkebMaLOCP7SLaUD3v6dTKkMpge6eHI9z8OAa rnqCtTiFCg53YMqAZEwTsvuaeLXPdoLa9gqT7LQvqCvCKNfUYZQBFap8OykGehyBytLD 3RHixR6zioaKh+MXQkbIEyXiz3rPdo7ckNnZqFOVJJLuU0Bj/PAqI5FtbKU2xOlwSMFm ralRPkKZ0WTS7j9kRka7OKKeBH99WJ+p498LKDrd34j0kXxJcOVfCp3QKyhqTER2JLZk r0BQ== 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 g16-v6si24194338pgd.354.2018.10.19.08.50.12; Fri, 19 Oct 2018 08:50:27 -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 S1727640AbeJSX41 (ORCPT + 99 others); Fri, 19 Oct 2018 19:56:27 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55252 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726935AbeJSX4Z (ORCPT ); Fri, 19 Oct 2018 19:56:25 -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 BEAAAEBD; Fri, 19 Oct 2018 08:49:45 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8D6E03F71A; Fri, 19 Oct 2018 08:49:45 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id A4C1B1AE06FD; Fri, 19 Oct 2018 16:49:48 +0100 (BST) Date: Fri, 19 Oct 2018 16:49:48 +0100 From: Will Deacon To: Kees Cook Cc: Catalin Marinas , Kristina Martsenko , linux-arm-kernel , Mark Rutland , linux-arch , Andrew Jones , Jacob Bramley , Arnd Bergmann , Ard Biesheuvel , Marc Zyngier , Adam Wallis , "Suzuki K . Poulose" , Christoffer Dall , kvmarm@lists.cs.columbia.edu, Ramana Radhakrishnan , Amit Kachhap , Dave P Martin , LKML , Cyrill Gorcunov Subject: Re: [PATCH v5 07/17] arm64: add basic pointer authentication support Message-ID: <20181019154948.GD16771@arm.com> References: <20181005084754.20950-1-kristina.martsenko@arm.com> <20181005084754.20950-8-kristina.martsenko@arm.com> <20181019111542.6wrvjguirglzg7vg@mbp> <20181019112404.GD14246@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 19, 2018 at 08:36:45AM -0700, Kees Cook wrote: > On Fri, Oct 19, 2018 at 4:24 AM, Will Deacon wrote: > > FWIW: I think we should be entertaining a prctl() interface to use a new > > key on a per-thread basis. Obviously, this would need to be used with care > > (e.g. you'd fork(); use the prctl() and then you'd better not return from > > the calling function!). > > > > Assuming we want this (Kees -- I was under the impression that everything in > > Android would end up with the same key otherwise?), then the question is > > do we want: > > > > - prctl() get/set operations for the key, or > > - prctl() set_random_key operation, or > > - both of the above? > > > > Part of the answer to that may lie in the requirements of CRIU, where I > > strongly suspect they need explicit get/set operations, although these > > could be gated on CONFIG_CHECKPOINT_RESTORE=y. > > Oh CRIU. Yikes. I'd like the get/set to be gated by the CONFIG, yes. > No reason to allow explicit access to the key (and selected algo) if > we don't have to. Makes sense. > As for per-thread or not, having a "pick a new key now" prctl() sounds > good, but I'd like to have an eye toward having it just be "automatic" > on clone(). I thought about that too, but we're out of clone() flags afaict and there's no arch hook in there. We could add yet another clone syscall, but yuck (and I reckon viro would kill us). Or are you saying that we could infer the behaviour from the existing set of flags? Will