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=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_MED,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 4858AC28CC3 for ; Fri, 31 May 2019 16:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21E6026BFD for ; Fri, 31 May 2019 16:24:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WkbNgEwA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726749AbfEaQYU (ORCPT ); Fri, 31 May 2019 12:24:20 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35801 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726774AbfEaQYU (ORCPT ); Fri, 31 May 2019 12:24:20 -0400 Received: by mail-pg1-f194.google.com with SMTP id t1so791790pgc.2 for ; Fri, 31 May 2019 09:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h/x2RsdaGEeomdfj9zckwm1ZuXHc7ti1LUsxVKWauDI=; b=WkbNgEwAtHoOpsgf2n/OOj9tvUzmqxkk0wFQPqMbZDhKXrycKmph8DKGky42GC+koN LJDEln958wkwnmRH28ZEap3NrGgf1V1D0g9IZCcP3z1+J4jMqALHLTOUy5KwiFNCWFFp J5Vof1T/5pKxOH0N8kkgt3VneNxkghx7TLiVO3NO5Dfw0XE9zLDEnv4oejnEpiTXZOeJ tDxDbRBsv0ZCYRogl5V2uwQD8iTi3aUBJXQrVEho7perE1vFrdRi0BvQ0ve9Pq7qowuL FRZuY21tQBRvNHvnsPyF6is+8mWCTar820ssvKvNtiwoTjNWK3ZyaVAaR6TMz/HMowZi esrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h/x2RsdaGEeomdfj9zckwm1ZuXHc7ti1LUsxVKWauDI=; b=SXeC7qP3XsDIMSnWRQgUZolNO5DNCPtakipOxWFKAD7Ap0WXWngzjrPmjOCP9wQjSv V6b9SUIo7b+5I6yAMA2XWI3U6pRcIuEQLKFe8QyP4nMk1nUqBWoE0phEnRASZBSbj/xv 9AlIQj4on0MGZYupudoGiVrjFZcT4DbPg4vbh3IXGt3xMK3aMggxDafLT8kcLlikeqVg CqswgwmlnnaSWoLACY7I+aPa15nAW4TeOVCRm+d9q7CYnjgIFaFV4uTzqfSYL512yM6N WLjkfUW2t0Gv8+pbL1NebcnW1yKqMlXcg9myGI/0oAOX5W4Q0Sxm76i/1OqaBEi7+a6z GIPA== X-Gm-Message-State: APjAAAUSzrgMs8mNTD8IGtDm6E66ExKaTxbxNa8DAS1XhhyOUWaiyWA0 VF+0A1U5btZDlhEckclwDvQmJzwkuJ6C+8NRui8HSWVWPHc= X-Google-Smtp-Source: APXvYqxuY1CYuxd04Kewq/lINHwhx4xTvJLFZIhJ6+qsHKD7HtPQ0W1vOSTfUsi9VyOoypjJcb2qINRGGNrlijbQeNg= X-Received: by 2002:a62:2c17:: with SMTP id s23mr11223321pfs.51.1559319859023; Fri, 31 May 2019 09:24:19 -0700 (PDT) MIME-Version: 1.0 References: <20190521182932.sm4vxweuwo5ermyd@mbp> <201905211633.6C0BF0C2@keescook> <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> In-Reply-To: <20190531161954.GA3568@arrakis.emea.arm.com> From: Andrey Konovalov Date: Fri, 31 May 2019 18:24:06 +0200 Message-ID: Subject: Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel To: Catalin Marinas 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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? > > Thanks. > > -- > Catalin