Re: [patch 13/16] x86/ldt: Introduce LDT write fault handler

From: Linus Torvalds
Date: Tue Dec 12 2017 - 14:51:50 EST


On Tue, Dec 12, 2017 at 11:21 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> That has nothing to do with the user installed LDT. The kernel does not use
> and rely on LDT at all.

Sure it does. We end up loading the selector for %gs and %fs, and
those selectors end up being connected with whatever user-mode has set
up for them.

We then set the FS/GS base pointer to a kernel-specific value, but
that is _separately_ from the actual accessed bit that is in the
selector.

So the kernel doesn't care, but the kernel definitely uses them.

Linus