Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1304854ybm; Tue, 21 May 2019 11:50:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu0WQ07ShviDpdDrHwSaoNwUD7KmvUVi7JWRiDdwQPBxGfKhTgelxwhy1AavCM9P+q9Q5R X-Received: by 2002:a62:1ec3:: with SMTP id e186mr43474030pfe.197.1558464617969; Tue, 21 May 2019 11:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558464617; cv=none; d=google.com; s=arc-20160816; b=ExrBH53A2I1+kCMEoJCTdzF2/FVwys2dTorS9xFT0a4rx73YJa9JmcPsF+Cc4b+r03 GklR2IBYIhnth8PNTkoudIhi7nQq3uomOyUSawglh3u9gZN/KPVmOfyCDBkpmESgdT8M pTotDf1HBEwaFb2dcaDCxScTUt7AydtriZj2CL8p16USFuyfLxFHoFlaQ7y3DgvZVHTp 9VRUgqRWm+KmzfXRu5rSSQ82wzeDjyI3ZrkL+2P2MeQ1XKDq212PLE0zJGAZmWRN70ZI fWSPVs+vNuD04Lojb5oeoq09ebMqX903BEfEz4dPYHCQmXoF3dEu1pKV+eCS6hobCNdh 0G7A== 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:dkim-signature; bh=Brh6Wum1Zthj/uQ2mtyHFIq9uQlvrAXKSZbEsVapKL8=; b=TTbXSgXckgUw4CH4r41l97lymR84PxmrFrLQA9qmFgackwoWbGKG4oqsmhd0U7I6Yk gE3iglx0h2RnbcYpxsdAFendT58U6YEWPpKanMNvXtG4slK1l4ujdR+JxptEc4a3Xple 3I4S7makKxFLQNqZrdLDmOaArQ0B93AK5ZK803XyJclVaE3BoHViAyxcaqC0IPMwscI6 O1h+pc2RhJn7DM465ZYzQMvXffEyJ/2Q6tO+T8X0+atQwA+vew7uJvarwMSsB/DHC0kW fw4q3G7a1nk4bN56VyYDaDPPbQTP7FTxqN8GSZrq52aSapJjnJB62iBTygviqPfBX1yb cBbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=JYscqSP1; 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 p25si23258814pli.202.2019.05.21.11.50.02; Tue, 21 May 2019 11:50:17 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=JYscqSP1; 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 S1729205AbfEUStA (ORCPT + 99 others); Tue, 21 May 2019 14:49:00 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46008 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbfEUSs7 (ORCPT ); Tue, 21 May 2019 14:48:59 -0400 Received: by mail-qk1-f194.google.com with SMTP id j1so11689528qkk.12 for ; Tue, 21 May 2019 11:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Brh6Wum1Zthj/uQ2mtyHFIq9uQlvrAXKSZbEsVapKL8=; b=JYscqSP1HPPRVqGuMd5owD3l/IDlGmL6FFL67m798Jm2AP4qGcOTqtawfRNo+5kAFu iEJ0vUz9qOZ+rvajt/fb76zKILX2m7sPHzCjQLxU/xpu8s+X3lkRy9CgqtNpDaf0XFJu m/SIilww4DfdKs62gi8wE4MGevsPrJgDS2TyvhL/7eUtavobHZ7DqCVwKBcDulDJUjVu MVt0CUr2fUDTtnd4Vvag66g4rnBT/cZ1xH3t4yZwYbfafoegD76V6HRafoLD0R1dZ62Z EbRvObIPEul9wb7eEhcBGsIGomq6YRkOd3NfdawsXW6Hn11cNpJ1sY5CjCpDM4tjfGZL aezw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Brh6Wum1Zthj/uQ2mtyHFIq9uQlvrAXKSZbEsVapKL8=; b=CfmoLhCKSxnpSG7l+ekXITJ4yfQnbH7ovAP+fM7Xtcy7BgAh3OCt1iNNPFKgP0ZEbN wWmqS34fY+wpBvXpaOtaYQ1zboYsj/IZTeBCHEAjvfeT//THXcMCgKxmqrAJQaYiIvg4 VHsPej3bTCuSXmXdTJYaP3AIouq1Hh/ATGDNCZLL4j9op74wahABmwPBpWdLe3LWtU0z wGD+YPRVHHW4nTsSBxyojEKCdYnasc/dQL7JB4Rrbmbb82GbKyLxVRip9nuLS3PxGgLw GltNNtI5NJ2PaH54uVMDpWQ+nhtaeUqICYUcyQ3CKLU9FVtULandGCszCTDw0Yamkhns zlvw== X-Gm-Message-State: APjAAAU3rIDNqPKt5WUqFZUje/EDQCLiUm3m+g16JtxsjtFKoLxqN4et HxpEHslFSZfVneeoSPF59rdW7w== X-Received: by 2002:a37:358:: with SMTP id 85mr63206066qkd.174.1558464538599; Tue, 21 May 2019 11:48:58 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id u2sm5545370qtq.45.2019.05.21.11.48.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 11:48:57 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hT9om-0004QR-Qs; Tue, 21 May 2019 15:48:56 -0300 Date: Tue, 21 May 2019 15:48:56 -0300 From: Jason Gunthorpe To: Catalin Marinas Cc: Andrey Konovalov , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Vincenzo Frascino , Will Deacon , Mark Rutland , Andrew Morton , Greg Kroah-Hartman , Kees Cook , Yishai Hadas , Felix Kuehling , Alexander Deucher , Christian Koenig , Mauro Carvalho Chehab , Jens Wiklander , Alex Williamson , Leon Romanovsky , Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Robin Murphy , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy Subject: Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel Message-ID: <20190521184856.GC2922@ziepe.ca> References: <20190517144931.GA56186@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190517144931.GA56186@arrakis.emea.arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 17, 2019 at 03:49:31PM +0100, Catalin Marinas wrote: > The tagged pointers (whether hwasan or MTE) should ideally be a > transparent feature for the application writer but I don't think we can > solve it entirely and make it seamless for the multitude of ioctls(). > I'd say you only opt in to such feature if you know what you are doing > and the user code takes care of specific cases like ioctl(), hence the > prctl() proposal even for the hwasan. I'm not sure such a dire view is warrented.. The ioctl situation is not so bad, other than a few special cases, most drivers just take a 'void __user *' and pass it as an argument to some function that accepts a 'void __user *'. sparse et al verify this. As long as the core functions do the right thing the drivers will be OK. The only place things get dicy is if someone casts to unsigned long (ie for vma work) but I think that reflects that our driver facing APIs for VMAs are compatible with static analysis (ie I have no earthly idea why get_user_pages() accepts an unsigned long), not that this is too hard. Jason