[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e4773b2-2cb3-284e-f0a7-3eaebc2676e5@linux.intel.com>
Date: Sun, 26 Nov 2017 08:24:37 -0800
From: Dave Hansen <dave.hansen@...ux.intel.com>
To: Andy Lutomirski <luto@...nel.org>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
richard.fellner@...dent.tugraz.at, moritz.lipp@...k.tugraz.at,
Daniel Gruss <daniel.gruss@...k.tugraz.at>,
michael.schwarz@...k.tugraz.at,
Linus Torvalds <torvalds@...ux-foundation.org>,
Kees Cook <keescook@...gle.com>,
Hugh Dickins <hughd@...gle.com>, X86 ML <x86@...nel.org>
Subject: Re: [PATCH 05/23] x86, kaiser: unmap kernel from userspace page
tables (core patch)
On 11/26/2017 08:10 AM, Andy Lutomirski wrote:
>> As a side benefit, this shouldn't have magical interactions with the
>> vsyscall page any more.
>>
>> Are there cases that this would get wrong?
>>
> Quick ping: did this get lost?
It does drop a warning that the other version of the code has, but
that's pretty minor.
Basically, we need two checks:
pgd_userspace_access() (aka _PAGE_USER) and
pgdp_maps_userspace()
The original code does pgd_userspace_access() in a top-level if and then
the pgdp_maps_userspace() checks at the second level. I think you are
basically suggesting that we flip that.
Logically, I'm sure we can make it work. It's just a matter of needing
to look at other things first.
BTW, this comment is, I think incorrect:
> if (pgdp_maps_userspace(pgdp)) {
...
> } else {
> /*
> * We can get here due to vmalloc, a vmalloc fault, memory
> hot-add, or initial setup
> * of kernelmode page tables. Regardless of which particular code
> path we're in,
> * these mappings should not be automatically propagated to the
> usermode tables.
> */
Since we pre-populated the entire kernel area's PGDs, I don't think
we'll ever have a valid reason to be doing a set_pgd() again on the
kernel area.
Powered by blists - more mailing lists