From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f71.google.com (mail-it0-f71.google.com [209.85.214.71]) by kanga.kvack.org (Postfix) with ESMTP id B6CB26B0033 for ; Thu, 14 Dec 2017 16:48:51 -0500 (EST) Received: by mail-it0-f71.google.com with SMTP id p144so10681623itc.9 for ; Thu, 14 Dec 2017 13:48:51 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u35sor2688343iou.218.2017.12.14.13.48.50 for (Google Transport Security); Thu, 14 Dec 2017 13:48:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20171214112726.742649793@infradead.org> <20171214113851.647809433@infradead.org> From: Linus Torvalds Date: Thu, 14 Dec 2017 13:48:50 -0800 Message-ID: Subject: Re: [PATCH v2 11/17] selftests/x86/ldt_gdt: Prepare for access bit forced Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Peter Zijlstra , "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 On Thu, Dec 14, 2017 at 1:44 PM, Linus Torvalds wrote: > > So it clearly needs to have the PAGE_USER bit clear (to avoid users > accessing it directly), and it needs to be marked somehow for > get_user_pages() to refuse it too, and access_ok() needs to fail it so > that we can't do get_user/put_user on it. Actually, just clearing PAGE_USER should make gup avoid it automatically. So really the only other thing it needs is to have access_ok() avoid it so that the kernel can't be fooled into accessing it for the user. That does probably mean having to put it at the top of the user address space and playing games with user_addr_max(). Which is not wonderful, but certainly not rocket surgery either. 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