Re: [x86] do_arch_prctl - bug?

From: Jeremy Fitzhardinge
Date: Wed Nov 19 2008 - 16:06:26 EST


Eric Lacombe wrote:
Ok, thanks, so I suppose now that only doing :
asm volatile("movl %0,%%gs" :: "r" (0));
could corrupt the address of the PDA that resides actually in the MSR_GS_BASE. And that's why load_gs_index is used as it contains "swapgs" before and after the "mov to gs".

Is that correct?

Yes, loading a selector into a segment register will load the lower 32 bits of the base from the ldt/gdt into the msr and zero the rest.

J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/