From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 23EF96B0266 for ; Fri, 15 Dec 2017 20:25:23 -0500 (EST) Received: by mail-pf0-f198.google.com with SMTP id e26so9187413pfi.15 for ; Fri, 15 Dec 2017 17:25:23 -0800 (PST) Received: from mga12.intel.com (mga12.intel.com. [192.55.52.136]) by mx.google.com with ESMTPS id m15si5436153pgn.59.2017.12.15.17.25.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 17:25:22 -0800 (PST) Subject: Re: [PATCH v2 01/17] mm/gup: Fixup p*_access_permitted() 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> From: Dave Hansen Message-ID: <629d90d9-df33-2c31-e644-0bc356b61f25@intel.com> Date: Fri, 15 Dec 2017 17:25:20 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds , Dan Williams Cc: 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 12/15/2017 05:10 PM, Linus Torvalds wrote: > Because *if* we want to check protection keys, I think we should do > that at the vma layer, partly exactly because the exact implementation > of protection keys is so architecture-specific, and partly because I > don't think it makes sense to check them for every page anyway. So, there are VMA checks against protection keys. The problem _here_ is that we are checking against the VMA (and correctly skipping the PKRU checks) and then _mistakenly_ applying the PTE checks against PKRU. I think the reason we needed VMA and PTE checks was the get_user_pages_fast() path not having a VMA. I need to go re-read the commits, though. -- 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