lkml.org 
[lkml]   [2017]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 05/23] x86, kaiser: unmap kernel from userspace page tables (core patch)
On Sun, Nov 26, 2017 at 8:24 AM, Dave Hansen
<dave.hansen@linux.intel.com> wrote:
> 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.

Right, forgot about that. So it's just initial setup, then.

\
 
 \ /
  Last update: 2017-11-26 17:30    [W:0.208 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site