Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4201653imu; Tue, 18 Dec 2018 10:39:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/XYkhUbOXLm0GFOlpszZEU+ZkC6dSsmB/26+0DuQLrUNjbfoJblPT8J4a2QH8Si3kqcr3ZC X-Received: by 2002:a17:902:4324:: with SMTP id i33mr16969132pld.227.1545158348901; Tue, 18 Dec 2018 10:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545158348; cv=none; d=google.com; s=arc-20160816; b=A3dZI2xQCGQeO6+PqUgKgPNynHgidggwxG3JV40zTD0VXmt6NM2jcrwRNg93iI/kOY +Bp2UdP1GGkmQuvosJaeUKutY2caSRUVZQTFs/Yd/Sqx15xVDOx/Ub5tQliQlkFKWRaL n74hOcYkIjZ2eLRcd3z941nvWxdNqlEnkMOsx2oaxLQhHkVW/L7b8e07q/9f4th/Pb48 Gtp2SzwdbzMN7ouwQLk7yF+G+WC9HIqWja+DFGg/HS08ctiD/fSp7snBMjjAXl3Lxyl3 LIajL6uyiatQsifQ+3LlmX1HbjwxKMPKZWRKH9FVQKcDG+rhiOVUH/0T/7WVo2GFTECZ FHpg== 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=mGy/pPGrvjIUNohtT/lCxmWhLMUktnhtOuqkEj+8+pk=; b=hHJQ4ton0E5iS7IzsHElcenNZrjqAf/vy879PvpKJ3vQSOIZgkjJhd3tgau1KLvlEK 6vSqHK8HAtJXPnh+kGPGtfKuSikRIzSDrANqbGaFSFsyHjUM999NL7YyAySEKCaBYgk0 4h4+qs4ONyD1yQndAzTfCIwsqvVZjHBxMdXO1AzVcuiUXmc9THhVSMJSS0/huduWokwF TNAX+oZIbr6BjZ9XnbQkngSKSt1LW9j8ZXtdGbS3tjj6d/KQcWzCX8U5gKD1TQr4OTRA YowCuTFuLprypFuhO3NcBYj7CdrFhu9N4fBEhfgBw+Jrwgb5fPqVkBSER+y2W/DspOuX MagA== 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 1si13941635ply.409.2018.12.18.10.38.53; Tue, 18 Dec 2018 10:39:08 -0800 (PST) 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 S1727602AbeLRR7s (ORCPT + 99 others); Tue, 18 Dec 2018 12:59:48 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50730 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727567AbeLRR7q (ORCPT ); Tue, 18 Dec 2018 12:59:46 -0500 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 DB88AA78; Tue, 18 Dec 2018 09:59:45 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.113]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 78DF93F5C0; Tue, 18 Dec 2018 09:59:41 -0800 (PST) Date: Tue, 18 Dec 2018 17:59:38 +0000 From: Catalin Marinas To: Andrey Konovalov Cc: Mark Rutland , Kate Stewart , "open list:DOCUMENTATION" , Will Deacon , Linux Memory Management List , "open list:KERNEL SELFTEST FRAMEWORK" , Chintan Pandya , Vincenzo Frascino , Shuah Khan , Ingo Molnar , linux-arch , Jacob Bramley , Dmitry Vyukov , Evgenii Stepanov , Kees Cook , Ruben Ayrapetyan , Lee Smith , Alexander Viro , Linux ARM , Kostya Serebryany , Greg Kroah-Hartman , LKML , "Kirill A. Shutemov" , Ramana Radhakrishnan , Andrew Morton , Robin Murphy , Luc Van Oostenryck Subject: Re: [RFC][PATCH 0/3] arm64 relaxed ABI Message-ID: <20181218175938.GD20197@arrakis.emea.arm.com> References: <20181210143044.12714-1-vincenzo.frascino@arm.com> <20181212150230.GH65138@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Dec 18, 2018 at 04:03:38PM +0100, Andrey Konovalov wrote: > On Wed, Dec 12, 2018 at 4:02 PM Catalin Marinas wrote: > > The summary of our internal discussions (mostly between kernel > > developers) is that we can't properly describe a user ABI that covers > > future syscalls or syscall extensions while not all syscalls accept > > tagged pointers. So we tweaked the requirements slightly to only allow > > tagged pointers back into the kernel *if* the originating address is > > from an anonymous mmap() or below sbrk(0). This should cover some of the > > ioctls or getsockopt(TCP_ZEROCOPY_RECEIVE) where the user passes a > > pointer to a buffer obtained via mmap() on the device operations. > > > > (sorry for not being clear on what Vincenzo's proposal implies) > > OK, I see. So I need to make the following changes to my patchset AFAIU. > > 1. Make sure that we only allow tagged user addresses that originate > from an anonymous mmap() or below sbrk(0). How exactly should this > check be performed? I don't think we should perform such checks. That's rather stating that the kernel only guarantees that the tagged pointers work if they originated from these memory ranges. > 2. Allow tagged addressed passed to memory syscalls (as long as (1) is > satisfied). Do I understand correctly that this means that I need to > locate all find_vma() callers outside of mm/ and fix them up as well? Yes (unless anyone as a better idea or objections to this approach). BTW, I'll be off until the new year, so won't be able to follow up. -- Catalin