From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Tue, 25 Jun 2019 07:43:53 +0000 Subject: Re: [PATCH 01/16] mm: use untagged_addr() for get_user_pages_fast addresses Message-Id: <20190625074353.GC30815@lst.de> List-Id: References: <20190611144102.8848-1-hch@lst.de> <20190611144102.8848-2-hch@lst.de> <20190621133911.GL19891@ziepe.ca> In-Reply-To: <20190621133911.GL19891@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jason Gunthorpe Cc: Christoph Hellwig , Linus Torvalds , Paul Burton , James Hogan , Yoshinori Sato , Rich Felker , "David S. Miller" , Nicholas Piggin , Khalid Aziz , Andrey Konovalov , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org On Fri, Jun 21, 2019 at 10:39:11AM -0300, Jason Gunthorpe wrote: > Hmm, this function, and the other, goes on to do: > > if (unlikely(!access_ok((void __user *)start, len))) > return 0; > > and I thought that access_ok takes in the tagged pointer? > > How about re-order it a bit? Actually.. I we reorder this we'd need to to duplicate a few things due to the zero/negative length checking. Given the feedback from Khalid I'd thus rather skip the reorder for now. If we have a good reason we could add it back, but it would be a bit involved.