Re: [PATCH v2 11/17] selftests/x86/ldt_gdt: Prepare for access bit forced
From: Andy Lutomirski
Date: Thu Dec 14 2017 - 16:22:53 EST
On Thu, Dec 14, 2017 at 11:43 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, Dec 14, 2017 at 8:20 AM, Andy Lutomirski <luto@xxxxxxxxxx> wrote:
>>
>> If this turns out to need reverting because it breaks Wine or
>> something, we're really going to regret it.
>
> I really don't see that as very likely. We already play other (much
> more fundamental) games with segments.
>
I dunno. Maybe Wine or DOSEMU apps expect to be able to create a
non-accessed segment and then read out the accessed bit using LAR or
modify_ldt() later.
> But I do agree that it would be good to consider this "turn LDT
> read-only" a separate series just in case.
Which kind of kills the whole thing. There's no way the idea of
putting the LDT in a VMA is okay if it's RW. You just get the kernel
to put_user() a call gate into it and it's game over.
I have a competing patch that just aliases the LDT high up in kernel
land and shares it in the user tables. I like a lot of the cleanups
in this series, but I don't like the actual LDT-in-a-VMA part.