Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754339AbdLNWxF (ORCPT ); Thu, 14 Dec 2017 17:53:05 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:37846 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754277AbdLNWw7 (ORCPT ); Thu, 14 Dec 2017 17:52:59 -0500 X-Google-Smtp-Source: ACJfBoveM2RpfOvCew24TRMCZ9TnylZQ+ux9qzYiuXdswtzDVbXxa/v/fs6BRZ0dBqV8/KUYJA1PL7u7dr1AGpFJ9iY= MIME-Version: 1.0 In-Reply-To: <20171214222439.rovm3t7iaakefati@hirez.programming.kicks-ass.net> References: <20171214112726.742649793@infradead.org> <20171214113851.647809433@infradead.org> <20171214220226.GL3326@worktop> <20171214222439.rovm3t7iaakefati@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Thu, 14 Dec 2017 14:52:58 -0800 X-Google-Sender-Auth: ZTQyu3XPguIC9qQl5X-GgLV4Bks Message-ID: Subject: Re: [PATCH v2 11/17] selftests/x86/ldt_gdt: Prepare for access bit forced To: Peter Zijlstra Cc: Andy Lutomirski , "linux-kernel@vger.kernel.org" , Thomas Gleixner , X86 ML , Dave Hansen , 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@kvack.org" , "Kirill A. Shutemov" , Dan Williams Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 712 Lines: 23 On Thu, Dec 14, 2017 at 2:24 PM, Peter Zijlstra wrote: > > get_user_pages_fast() (both of them) do indeed test access_ok(), but the > regular get_user_pages() does not, I suspect because it can operate on a > foreign mm. That sounds wrong. We actually had some very serious reasons why get_user_pages_fast() needed to check access_ok(). I happen to forget what those reasons were, though. My mind may be going. But I think it was something like "you could walk off the page tables because the undefined address range generates nonsensical values for the pgd_offset() functions" etc. But maybe the regular get_user_pages() has some other way to protect against that. Linus