Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5238376ybi; Tue, 28 May 2019 09:38:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2wAc8eWzfyiMY2uV4Pg7A1iE4MHhiDca5zGTddwso3Nq9GIGxoyTZr2THR6qYWAi0Onfk X-Received: by 2002:a05:6a00:cc:: with SMTP id e12mr31013566pfj.207.1559061487611; Tue, 28 May 2019 09:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559061487; cv=none; d=google.com; s=arc-20160816; b=fGZ935HrpRsLpTK+GRkDdw6W/rOKpw4v2cFJfDLjO22amH0RW2P+BPXqidgP5HZGVm Cfnp17vnc2iV+va9WV41b2dbG2UyBKx5wcBdCu4j/HDcKfY8fPiOGeYjIhK0aFLNyLqW iuhxei2EQEvveo7HaRzjK0+TgMRt+99EgBXvRwEaWvKSm12YhDbW5FWZtsZr1M4R0H/S S0pM2O9EA8tmUYGDvvJx/vu/5Tt8MU9UiIy3xb7+0W2CBmI9Y+qc/SuoMxvxAUmexPqP sqRirlk37b4sSpn1mGbU4ZKOhhV0DSlgVDeoc07t90Lvn2CdC/rWLbm+fr0aeKmVL+du WzNg== 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=h32QT9H6rq0E1vjXhg0NjEb7RMelxM2xdWE5E7m7I7c=; b=spGAhziPPNbLI84SCkXTYvUOBDYEVge9iF41h5opyqXroaT0wL/91lYKO51gRJUafp fXpGyoFBaNrraaEJnfiSXDDCuSThkS1JWHPrVppe3WNI/4IsV+G+otKQWO5ZQ//G5idc o6myRnaBmsjpIhRVNhdzUc3e5l4WnB3QWSQeBA4bjZmMPdrMh6aZ1pY/uqlXkbQ7yaSL YnRj3SeVDYV3gWFxtPOsR1frvtSDvq/OkO6sTKBNwJR3SjOkWLPzcJ+fBFzh6e4WT9mI DM0Z6GU7AeBO71JRALrRvtDfWkLbw+CBhZsPVmI9DpmK02UDGmRNcihu5X8eH1GLEa9E s3OA== 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 r11si16154580pgp.232.2019.05.28.09.37.51; Tue, 28 May 2019 09:38:07 -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 S1727115AbfE1QeK (ORCPT + 99 others); Tue, 28 May 2019 12:34:10 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60968 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbfE1QeJ (ORCPT ); Tue, 28 May 2019 12:34:09 -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 D37F1341; Tue, 28 May 2019 09:34:08 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2754A3F59C; Tue, 28 May 2019 09:34:03 -0700 (PDT) Date: Tue, 28 May 2019 17:34:00 +0100 From: Catalin Marinas To: Dave Martin Cc: Andrew Murray , Mark Rutland , kvm@vger.kernel.org, Christian Koenig , Szabolcs Nagy , Will Deacon , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Lee Smith , linux-kselftest@vger.kernel.org, Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Evgeniy Stepanov , linux-media@vger.kernel.org, Kees Cook , Ruben Ayrapetyan , Andrey Konovalov , Kevin Brodsky , Alex Williamson , Mauro Carvalho Chehab , Dmitry Vyukov , Kostya Serebryany , Greg Kroah-Hartman , Felix Kuehling , linux-kernel@vger.kernel.org, Jens Wiklander , Ramana Radhakrishnan , Alexander Deucher , Andrew Morton , Robin Murphy , Yishai Hadas , Luc Van Oostenryck Subject: Re: [PATCH v15 05/17] arms64: untag user pointers passed to memory syscalls Message-ID: <20190528163400.GE32006@arrakis.emea.arm.com> References: <00eb4c63fefc054e2c8d626e8fedfca11d7c2600.1557160186.git.andreyknvl@google.com> <20190527143719.GA59948@MBP.local> <20190528145411.GA709@e119886-lin.cambridge.arm.com> <20190528154057.GD32006@arrakis.emea.arm.com> <20190528155644.GD28398@e103592.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190528155644.GD28398@e103592.cambridge.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 28, 2019 at 04:56:45PM +0100, Dave P Martin wrote: > On Tue, May 28, 2019 at 04:40:58PM +0100, Catalin Marinas wrote: > > [...] > > > My thoughts on allowing tags (quick look): > > > > brk - no > > [...] > > > mlock, mlock2, munlock - yes > > mmap - no (we may change this with MTE but not for TBI) > > [...] > > > mprotect - yes > > I haven't following this discussion closely... what's the rationale for > the inconsistencies here (feel free to refer me back to the discussion > if it's elsewhere). _My_ rationale (feel free to disagree) is that mmap() by default would not return a tagged address (ignoring MTE for now). If it gets passed a tagged address or a "tagged NULL" (for lack of a better name) we don't have clear semantics of whether the returned address should be tagged in this ABI relaxation. I'd rather reserve this specific behaviour if we overload the non-zero tag meaning of mmap() for MTE. Similar reasoning for mremap(), at least on the new_address argument (not entirely sure about old_address). munmap() should probably follow the mmap() rules. As for brk(), I don't see why the user would need to pass a tagged address, we can't associate any meaning to this tag. For the rest, since it's likely such addresses would have been tagged by malloc() in user space, we should allow tagged pointers. -- Catalin