From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id 6A0E76B0253 for ; Fri, 15 Dec 2017 21:28:38 -0500 (EST) Received: by mail-io0-f200.google.com with SMTP id r140so3543229iod.12 for ; Fri, 15 Dec 2017 18:28:38 -0800 (PST) Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id s22sor4759324ite.3.2017.12.15.18.28.37 for (Google Transport Security); Fri, 15 Dec 2017 18:28:37 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <629d90d9-df33-2c31-e644-0bc356b61f25@intel.com> References: <20171214112726.742649793@infradead.org> <20171214113851.146259969@infradead.org> <20171214124117.wfzcjdczyta2sery@hirez.programming.kicks-ass.net> <20171214143730.s6w7sd6c7b5t6fqp@hirez.programming.kicks-ass.net> <20171214205450.GI3326@worktop> <8eedb9a3-0ba2-52df-58f6-3ed869d18ca3@intel.com> <20171215075147.nzpsmb7asyr6etig@hirez.programming.kicks-ass.net> <629d90d9-df33-2c31-e644-0bc356b61f25@intel.com> From: Linus Torvalds Date: Fri, 15 Dec 2017 18:28:36 -0800 Message-ID: Subject: Re: [PATCH v2 01/17] mm/gup: Fixup p*_access_permitted() Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: Dan Williams , Peter Zijlstra , Linux Kernel Mailing List , Thomas Gleixner , the arch/x86 maintainers , Andy Lutomirsky , Borislav Petkov , Greg KH , Kees Cook , Hugh Dickins , Brian Gerst , Josh Poimboeuf , Denys Vlasenko , Boris Ostrovsky , Juergen Gross , David Laight , Eduardo Valentin , "Liguori, Anthony" , Will Deacon , linux-mm , "Kirill A. Shutemov" On Fri, Dec 15, 2017 at 5:25 PM, Dave Hansen wrote: > > I think the reason we needed VMA and PTE checks was the > get_user_pages_fast() path not having a VMA. That is indeed the point of get_user_pages_fast(): no vma lookup, no locking, just "do the default case as streamlined as possible". But part of it is also that we should fall back to the slow case if the fast case doesn't work (eg because the page isn't there or whatever). So what we could do - perhaps - is to just make get_user_pages_fast() check whether any of the protection key bits are set, and fail for that case. If we care, that is. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org