From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel Date: Fri, 31 May 2019 17:46:05 +0100 Message-ID: <20190531164605.GC3568@arrakis.emea.arm.com> References: <6049844a-65f5-f513-5b58-7141588fef2b@oracle.com> <20190523201105.oifkksus4rzcwqt4@mbp> <20190524101139.36yre4af22bkvatx@mbp> <20190530171540.GD35418@arrakis.emea.arm.com> <20190531161954.GA3568@arrakis.emea.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Andrey Konovalov Cc: Kees Cook , Evgenii Stepanov , Linux ARM , Linux Memory Management List , LKML , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , Vincenzo Frascino , Will Deacon , Mark Rutland , Andrew Morton , Greg Kroah-Hartman , Yishai Hadas , Felix Kuehling , Alexander Deucher List-Id: linux-rdma@vger.kernel.org On Fri, May 31, 2019 at 06:24:06PM +0200, Andrey Konovalov wrote: > On Fri, May 31, 2019 at 6:20 PM Catalin Marinas wrote: > > On Fri, May 31, 2019 at 04:29:10PM +0200, Andrey Konovalov wrote: > > > On Thu, May 30, 2019 at 7:15 PM Catalin Marinas wrote: > > > > On Tue, May 28, 2019 at 04:14:45PM +0200, Andrey Konovalov wrote: > > > > > Thanks for a lot of valuable input! I've read through all the replies > > > > > and got somewhat lost. What are the changes I need to do to this > > > > > series? > > > > > > > > > > 1. Should I move untagging for memory syscalls back to the generic > > > > > code so other arches would make use of it as well, or should I keep > > > > > the arm64 specific memory syscalls wrappers and address the comments > > > > > on that patch? > > > > > > > > Keep them generic again but make sure we get agreement with Khalid on > > > > the actual ABI implications for sparc. > > > > > > OK, will do. I find it hard to understand what the ABI implications > > > are. I'll post the next version without untagging in brk, mmap, > > > munmap, mremap (for new_address), mmap_pgoff, remap_file_pages, shmat > > > and shmdt. > > > > It's more about not relaxing the ABI to accept non-zero top-byte unless > > we have a use-case for it. For mmap() etc., I don't think that's needed > > but if you think otherwise, please raise it. > > > > > > > 2. Should I make untagging opt-in and controlled by a command line argument? > > > > > > > > Opt-in, yes, but per task rather than kernel command line option. > > > > prctl() is a possibility of opting in. > > > > > > OK. Should I store a flag somewhere in task_struct? Should it be > > > inheritable on clone? > > > > A TIF flag would do but I'd say leave it out for now (default opted in) > > until we figure out the best way to do this (can be a patch on top of > > this series). > > You mean leave the whole opt-in/prctl part out? So the only change > would be to move untagging for memory syscalls into generic code? Yes (or just wait until next week to see if the discussion settles down). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F3D7C04AB6 for ; Fri, 31 May 2019 16:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F74526C61 for ; Fri, 31 May 2019 16:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbfEaQqP (ORCPT ); Fri, 31 May 2019 12:46:15 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbfEaQqP (ORCPT ); Fri, 31 May 2019 12:46:15 -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 2DFE0A78; Fri, 31 May 2019 09:46:14 -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 48A043F59C; Fri, 31 May 2019 09:46:08 -0700 (PDT) Date: Fri, 31 May 2019 17:46:05 +0100 From: Catalin Marinas To: Andrey Konovalov Cc: Kees Cook , Evgenii Stepanov , Linux ARM , Linux Memory Management List , LKML , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , Vincenzo Frascino , Will Deacon , Mark Rutland , Andrew Morton , Greg Kroah-Hartman , Yishai Hadas , Felix Kuehling , Alexander Deucher , Christian Koenig , Mauro Carvalho Chehab , Jens Wiklander , Alex Williamson , Leon Romanovsky , Dmitry Vyukov , Kostya Serebryany , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Robin Murphy , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy , Elliott Hughes , Khalid Aziz Subject: Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel Message-ID: <20190531164605.GC3568@arrakis.emea.arm.com> References: <6049844a-65f5-f513-5b58-7141588fef2b@oracle.com> <20190523201105.oifkksus4rzcwqt4@mbp> <20190524101139.36yre4af22bkvatx@mbp> <20190530171540.GD35418@arrakis.emea.arm.com> <20190531161954.GA3568@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 Fri, May 31, 2019 at 06:24:06PM +0200, Andrey Konovalov wrote: > On Fri, May 31, 2019 at 6:20 PM Catalin Marinas wrote: > > On Fri, May 31, 2019 at 04:29:10PM +0200, Andrey Konovalov wrote: > > > On Thu, May 30, 2019 at 7:15 PM Catalin Marinas wrote: > > > > On Tue, May 28, 2019 at 04:14:45PM +0200, Andrey Konovalov wrote: > > > > > Thanks for a lot of valuable input! I've read through all the replies > > > > > and got somewhat lost. What are the changes I need to do to this > > > > > series? > > > > > > > > > > 1. Should I move untagging for memory syscalls back to the generic > > > > > code so other arches would make use of it as well, or should I keep > > > > > the arm64 specific memory syscalls wrappers and address the comments > > > > > on that patch? > > > > > > > > Keep them generic again but make sure we get agreement with Khalid on > > > > the actual ABI implications for sparc. > > > > > > OK, will do. I find it hard to understand what the ABI implications > > > are. I'll post the next version without untagging in brk, mmap, > > > munmap, mremap (for new_address), mmap_pgoff, remap_file_pages, shmat > > > and shmdt. > > > > It's more about not relaxing the ABI to accept non-zero top-byte unless > > we have a use-case for it. For mmap() etc., I don't think that's needed > > but if you think otherwise, please raise it. > > > > > > > 2. Should I make untagging opt-in and controlled by a command line argument? > > > > > > > > Opt-in, yes, but per task rather than kernel command line option. > > > > prctl() is a possibility of opting in. > > > > > > OK. Should I store a flag somewhere in task_struct? Should it be > > > inheritable on clone? > > > > A TIF flag would do but I'd say leave it out for now (default opted in) > > until we figure out the best way to do this (can be a patch on top of > > this series). > > You mean leave the whole opt-in/prctl part out? So the only change > would be to move untagging for memory syscalls into generic code? Yes (or just wait until next week to see if the discussion settles down). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas at arm.com (Catalin Marinas) Date: Fri, 31 May 2019 17:46:05 +0100 Subject: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel In-Reply-To: References: <6049844a-65f5-f513-5b58-7141588fef2b@oracle.com> <20190523201105.oifkksus4rzcwqt4@mbp> <20190524101139.36yre4af22bkvatx@mbp> <20190530171540.GD35418@arrakis.emea.arm.com> <20190531161954.GA3568@arrakis.emea.arm.com> Message-ID: <20190531164605.GC3568@arrakis.emea.arm.com> On Fri, May 31, 2019 at 06:24:06PM +0200, Andrey Konovalov wrote: > On Fri, May 31, 2019 at 6:20 PM Catalin Marinas wrote: > > On Fri, May 31, 2019 at 04:29:10PM +0200, Andrey Konovalov wrote: > > > On Thu, May 30, 2019 at 7:15 PM Catalin Marinas wrote: > > > > On Tue, May 28, 2019 at 04:14:45PM +0200, Andrey Konovalov wrote: > > > > > Thanks for a lot of valuable input! I've read through all the replies > > > > > and got somewhat lost. What are the changes I need to do to this > > > > > series? > > > > > > > > > > 1. Should I move untagging for memory syscalls back to the generic > > > > > code so other arches would make use of it as well, or should I keep > > > > > the arm64 specific memory syscalls wrappers and address the comments > > > > > on that patch? > > > > > > > > Keep them generic again but make sure we get agreement with Khalid on > > > > the actual ABI implications for sparc. > > > > > > OK, will do. I find it hard to understand what the ABI implications > > > are. I'll post the next version without untagging in brk, mmap, > > > munmap, mremap (for new_address), mmap_pgoff, remap_file_pages, shmat > > > and shmdt. > > > > It's more about not relaxing the ABI to accept non-zero top-byte unless > > we have a use-case for it. For mmap() etc., I don't think that's needed > > but if you think otherwise, please raise it. > > > > > > > 2. Should I make untagging opt-in and controlled by a command line argument? > > > > > > > > Opt-in, yes, but per task rather than kernel command line option. > > > > prctl() is a possibility of opting in. > > > > > > OK. Should I store a flag somewhere in task_struct? Should it be > > > inheritable on clone? > > > > A TIF flag would do but I'd say leave it out for now (default opted in) > > until we figure out the best way to do this (can be a patch on top of > > this series). > > You mean leave the whole opt-in/prctl part out? So the only change > would be to move untagging for memory syscalls into generic code? Yes (or just wait until next week to see if the discussion settles down). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas@arm.com (Catalin Marinas) Date: Fri, 31 May 2019 17:46:05 +0100 Subject: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel In-Reply-To: References: <6049844a-65f5-f513-5b58-7141588fef2b@oracle.com> <20190523201105.oifkksus4rzcwqt4@mbp> <20190524101139.36yre4af22bkvatx@mbp> <20190530171540.GD35418@arrakis.emea.arm.com> <20190531161954.GA3568@arrakis.emea.arm.com> Message-ID: <20190531164605.GC3568@arrakis.emea.arm.com> Content-Type: text/plain; charset="UTF-8" Message-ID: <20190531164605.lt3d5bKY0fns_JZxRR32vtW-uXOv0as9yc5LljoTAtE@z> On Fri, May 31, 2019@06:24:06PM +0200, Andrey Konovalov wrote: > On Fri, May 31, 2019@6:20 PM Catalin Marinas wrote: > > On Fri, May 31, 2019@04:29:10PM +0200, Andrey Konovalov wrote: > > > On Thu, May 30, 2019@7:15 PM Catalin Marinas wrote: > > > > On Tue, May 28, 2019@04:14:45PM +0200, Andrey Konovalov wrote: > > > > > Thanks for a lot of valuable input! I've read through all the replies > > > > > and got somewhat lost. What are the changes I need to do to this > > > > > series? > > > > > > > > > > 1. Should I move untagging for memory syscalls back to the generic > > > > > code so other arches would make use of it as well, or should I keep > > > > > the arm64 specific memory syscalls wrappers and address the comments > > > > > on that patch? > > > > > > > > Keep them generic again but make sure we get agreement with Khalid on > > > > the actual ABI implications for sparc. > > > > > > OK, will do. I find it hard to understand what the ABI implications > > > are. I'll post the next version without untagging in brk, mmap, > > > munmap, mremap (for new_address), mmap_pgoff, remap_file_pages, shmat > > > and shmdt. > > > > It's more about not relaxing the ABI to accept non-zero top-byte unless > > we have a use-case for it. For mmap() etc., I don't think that's needed > > but if you think otherwise, please raise it. > > > > > > > 2. Should I make untagging opt-in and controlled by a command line argument? > > > > > > > > Opt-in, yes, but per task rather than kernel command line option. > > > > prctl() is a possibility of opting in. > > > > > > OK. Should I store a flag somewhere in task_struct? Should it be > > > inheritable on clone? > > > > A TIF flag would do but I'd say leave it out for now (default opted in) > > until we figure out the best way to do this (can be a patch on top of > > this series). > > You mean leave the whole opt-in/prctl part out? So the only change > would be to move untagging for memory syscalls into generic code? Yes (or just wait until next week to see if the discussion settles down). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 337BCC04AB6 for ; Fri, 31 May 2019 16:46:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 028F626C66 for ; Fri, 31 May 2019 16:46:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 028F626C66 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7F7726B026E; Fri, 31 May 2019 12:46:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 781226B0274; Fri, 31 May 2019 12:46:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 648BB6B0278; Fri, 31 May 2019 12:46:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id 1736E6B026E for ; Fri, 31 May 2019 12:46:17 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id y22so14777943eds.14 for ; Fri, 31 May 2019 09:46:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:message-id:references:mime-version:content-disposition :in-reply-to:user-agent; bh=aT2yKJPBijRfh3I8dT7YFwqukzizGgjs99pM6UcU/IQ=; b=lS6VlqMxSC+vCvpkyRvkgjd2D2UwVNc4yt+qseSDqN93vlF6nHhzUW/releOF8McQF cO+u21Mjftivh4noq8lNWW6ls4A1MfWxzTrH+nWY5n1ECI93yoAjP5wL7hfAmzZR+sF6 BvauFSz0Wv7ji5CCULQERipDH2+wqFDIovA9PAAWW9Ci/h73dfPDHatjCIGujU5CMWPl BbIouNBLokIgehI+DkAoRSJ/RQ3whqBRfdW1Pe7P86pYHjtu1gCwXqfYkLjh3GltBSXE VuCPgEO0aMgaqntee5irp9BkU2XqrV3si5/bBJUlCj4/jVcmBZVJp1EylZEz20bpIWxw AwAQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of catalin.marinas@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=catalin.marinas@arm.com X-Gm-Message-State: APjAAAUi26jRoaWwasCieH6UHOWGw0XG0ElIXxJQy35blQxR/VwN+u/1 daD9rLWWzqRQQSZHrR0500UHNwtXSwvEzPva4biHd9hCsqezLMReDlJ0/Tfg2xo7N++dLXSeAJm d3tquJ7I8EDxjZY+bcX5Pk5sLpku1WbuxgFpbWZUmbOweWW7Sxq6D8/gtzwf/7Z+8fA== X-Received: by 2002:a17:906:2341:: with SMTP id m1mr10288064eja.165.1559321176627; Fri, 31 May 2019 09:46:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd4QAaiwxOUJFVbg8NEPNu5oWM8bqBOXw9RYTYRFDFqclVFrinnlLV/mbp2QQ0tSuBcF6O X-Received: by 2002:a17:906:2341:: with SMTP id m1mr10287988eja.165.1559321175507; Fri, 31 May 2019 09:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559321175; cv=none; d=google.com; s=arc-20160816; b=gXs9ZbRE6GKvYIN0InxRfw16neTGo0C/6vOlzCIQRfTNTvjbaLXXZbYCjl5I0m2Fm4 /Y38pBoeTojF3t4eQ+MpwANXCZ4mk7Xo1JGhV7Nv3xM/jhHP3j5HZKr+LNN9nrX7P6MT 6Qqbigr2yYAAZd/LlyvDwYz4AUfpIXr/djpXVvIclvjzepDXTnoxn0j/hcFGqbbT1eZT hduwwUyDQ+HdCDQUMxVnPEW/SLIzVALw5YoZzTXT6wLzy897ScDqBbxA8YyiiEkfGdFb pezHGKfSn+EBtrkZH2qupOepN0/2Sy81mB/xUSQaIM83/0Bx6aDEQ3gIQm9MeO7DOgeW 2Kug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date; bh=aT2yKJPBijRfh3I8dT7YFwqukzizGgjs99pM6UcU/IQ=; b=pxEzHPQXXQIya9zm7oRwzrAz80aQcA5lpZBUsPOpSz7Nh7djJbOUF4KZ35LmgRxtG7 cQSnBR07McZmEtrMakIz5ZSbI7YIvGFeqo/ZHM21vpSvEh103GE37rxigmx+OXxoRWIZ 9Esj9xdYbYYgUy9vIkwfSE1NG6116MQKqMlo4csAWs6vAMfsF/1oh2D/NHOFk91ZSVuy jkj09LOarccFcB3PK/oFlwlwRebQBb5p3hJd4cX8kXdMqO+arPgCENDz1Kvves8s1UrZ XUkB+uN3cAKf/Ve4uJL7sctOZjunJpSRDfsyP8DSMMrezNjAJ+b4eCHwKX1UAunogLMT 97Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of catalin.marinas@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=catalin.marinas@arm.com Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id b38si1941007edb.223.2019.05.31.09.46.15 for ; Fri, 31 May 2019 09:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of catalin.marinas@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of catalin.marinas@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=catalin.marinas@arm.com 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 2DFE0A78; Fri, 31 May 2019 09:46:14 -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 48A043F59C; Fri, 31 May 2019 09:46:08 -0700 (PDT) Date: Fri, 31 May 2019 17:46:05 +0100 From: Catalin Marinas To: Andrey Konovalov Cc: Kees Cook , Evgenii Stepanov , Linux ARM , Linux Memory Management List , LKML , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , Vincenzo Frascino , Will Deacon , Mark Rutland , Andrew Morton , Greg Kroah-Hartman , Yishai Hadas , Felix Kuehling , Alexander Deucher , Christian Koenig , Mauro Carvalho Chehab , Jens Wiklander , Alex Williamson , Leon Romanovsky , Dmitry Vyukov , Kostya Serebryany , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Robin Murphy , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy , Elliott Hughes , Khalid Aziz Subject: Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel Message-ID: <20190531164605.GC3568@arrakis.emea.arm.com> References: <6049844a-65f5-f513-5b58-7141588fef2b@oracle.com> <20190523201105.oifkksus4rzcwqt4@mbp> <20190524101139.36yre4af22bkvatx@mbp> <20190530171540.GD35418@arrakis.emea.arm.com> <20190531161954.GA3568@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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, May 31, 2019 at 06:24:06PM +0200, Andrey Konovalov wrote: > On Fri, May 31, 2019 at 6:20 PM Catalin Marinas wrote: > > On Fri, May 31, 2019 at 04:29:10PM +0200, Andrey Konovalov wrote: > > > On Thu, May 30, 2019 at 7:15 PM Catalin Marinas wrote: > > > > On Tue, May 28, 2019 at 04:14:45PM +0200, Andrey Konovalov wrote: > > > > > Thanks for a lot of valuable input! I've read through all the replies > > > > > and got somewhat lost. What are the changes I need to do to this > > > > > series? > > > > > > > > > > 1. Should I move untagging for memory syscalls back to the generic > > > > > code so other arches would make use of it as well, or should I keep > > > > > the arm64 specific memory syscalls wrappers and address the comments > > > > > on that patch? > > > > > > > > Keep them generic again but make sure we get agreement with Khalid on > > > > the actual ABI implications for sparc. > > > > > > OK, will do. I find it hard to understand what the ABI implications > > > are. I'll post the next version without untagging in brk, mmap, > > > munmap, mremap (for new_address), mmap_pgoff, remap_file_pages, shmat > > > and shmdt. > > > > It's more about not relaxing the ABI to accept non-zero top-byte unless > > we have a use-case for it. For mmap() etc., I don't think that's needed > > but if you think otherwise, please raise it. > > > > > > > 2. Should I make untagging opt-in and controlled by a command line argument? > > > > > > > > Opt-in, yes, but per task rather than kernel command line option. > > > > prctl() is a possibility of opting in. > > > > > > OK. Should I store a flag somewhere in task_struct? Should it be > > > inheritable on clone? > > > > A TIF flag would do but I'd say leave it out for now (default opted in) > > until we figure out the best way to do this (can be a patch on top of > > this series). > > You mean leave the whole opt-in/prctl part out? So the only change > would be to move untagging for memory syscalls into generic code? Yes (or just wait until next week to see if the discussion settles down). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_DKIMWL_WL_HIGH,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 600C7C04AB6 for ; Fri, 31 May 2019 16:46:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35CCF26C68 for ; Fri, 31 May 2019 16:46:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AO2/dF94" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35CCF26C68 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wQSEQAgJQoSnv2QcuhlNM9W0v5BicvPw0SSor2oV3Eo=; b=AO2/dF94rSD0ZZ NyG+e3ijnaT/MalYt6l33yJ9CyYMt/ElslfCgDGM/rQNOLayBv2rb8Sh2WXqwR9yV4Qrjbqy5OCzH lPMRwhCrkvjrpwqtZQOTTueBeprZHZxYmQNtZBRA+/S4KfT4XLGcngmilpXabG67BVIuBjrQG/ZAW cxXQeuKgljP7sBv+75PbvPa52Kv8Um0tcJkM6DKDdt0xs1D+l+ZK5kT39WfZEnm7LVopf8Muhfv8R bvJg8N6sOhYvWAfiTeS2tmZk7X64A01iGw5Ec4hHF9evyhkG4SSA9VEbGtKwEzrhrXCKGvyOHOHRg ByPS6Km1LkWGLHPl2ufw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWkfZ-0000ts-NU; Fri, 31 May 2019 16:46:17 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWkfW-0000tT-Ti for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2019 16:46:16 +0000 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 2DFE0A78; Fri, 31 May 2019 09:46:14 -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 48A043F59C; Fri, 31 May 2019 09:46:08 -0700 (PDT) Date: Fri, 31 May 2019 17:46:05 +0100 From: Catalin Marinas To: Andrey Konovalov Subject: Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel Message-ID: <20190531164605.GC3568@arrakis.emea.arm.com> References: <6049844a-65f5-f513-5b58-7141588fef2b@oracle.com> <20190523201105.oifkksus4rzcwqt4@mbp> <20190524101139.36yre4af22bkvatx@mbp> <20190530171540.GD35418@arrakis.emea.arm.com> <20190531161954.GA3568@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190531_094614_974245_15713BA0 X-CRM114-Status: GOOD ( 26.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kvm@vger.kernel.org, Szabolcs Nagy , Will Deacon , dri-devel@lists.freedesktop.org, Linux Memory Management List , Khalid Aziz , "open list:KERNEL SELFTEST FRAMEWORK" , Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, Dmitry Vyukov , Dave Martin , Evgenii Stepanov , linux-media@vger.kernel.org, Kevin Brodsky , Kees Cook , Ruben Ayrapetyan , Ramana Radhakrishnan , Alex Williamson , Yishai Hadas , Mauro Carvalho Chehab , Linux ARM , Kostya Serebryany , Greg Kroah-Hartman , Felix Kuehling , LKML , Jens Wiklander , Lee Smith , Alexander Deucher , Andrew Morton , Elliott Hughes , Robin Murphy , Christian Koenig , Luc Van Oostenryck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 31, 2019 at 06:24:06PM +0200, Andrey Konovalov wrote: > On Fri, May 31, 2019 at 6:20 PM Catalin Marinas wrote: > > On Fri, May 31, 2019 at 04:29:10PM +0200, Andrey Konovalov wrote: > > > On Thu, May 30, 2019 at 7:15 PM Catalin Marinas wrote: > > > > On Tue, May 28, 2019 at 04:14:45PM +0200, Andrey Konovalov wrote: > > > > > Thanks for a lot of valuable input! I've read through all the replies > > > > > and got somewhat lost. What are the changes I need to do to this > > > > > series? > > > > > > > > > > 1. Should I move untagging for memory syscalls back to the generic > > > > > code so other arches would make use of it as well, or should I keep > > > > > the arm64 specific memory syscalls wrappers and address the comments > > > > > on that patch? > > > > > > > > Keep them generic again but make sure we get agreement with Khalid on > > > > the actual ABI implications for sparc. > > > > > > OK, will do. I find it hard to understand what the ABI implications > > > are. I'll post the next version without untagging in brk, mmap, > > > munmap, mremap (for new_address), mmap_pgoff, remap_file_pages, shmat > > > and shmdt. > > > > It's more about not relaxing the ABI to accept non-zero top-byte unless > > we have a use-case for it. For mmap() etc., I don't think that's needed > > but if you think otherwise, please raise it. > > > > > > > 2. Should I make untagging opt-in and controlled by a command line argument? > > > > > > > > Opt-in, yes, but per task rather than kernel command line option. > > > > prctl() is a possibility of opting in. > > > > > > OK. Should I store a flag somewhere in task_struct? Should it be > > > inheritable on clone? > > > > A TIF flag would do but I'd say leave it out for now (default opted in) > > until we figure out the best way to do this (can be a patch on top of > > this series). > > You mean leave the whole opt-in/prctl part out? So the only change > would be to move untagging for memory syscalls into generic code? Yes (or just wait until next week to see if the discussion settles down). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel