Re: [PATCH x86/mm 6/6] x86-64 ia32 ptrace get/putreg32 current task

Linus Torvalds
2007-11-29T20:26:01Z

On Thu, 29 Nov 2007, Andi Kleen wrote:
>
> How would you catch (common) the case of them having different bases in the
> GDT TLS entries? At some point the selector has to be reloaded, otherwise
> it won't be picked up by the CPU.

You're right. I somehow thought we were using the LDT for TLS entries,
which I guess we did back before kernel support, but yeah, we're using
per-CPU GDT entries, and would need to check that those match too.

So yeah, the only safe ones are the ones we don't ever change, and that is
basically just the kernel entries (that users cannot load anyway).

So scratch that. You're right - the NUL selector is the only special one
for the context switcher.

Linus