Protect the setting of the fsbase/gsbase MSR registers and the

pcb_[fg]sbase values with a critical section, like the rest of the kernel.
This commit is contained in:
peter 2008-03-23 22:44:56 +00:00
parent fb74f62b24
commit 075e9da352

View File

@ -715,10 +715,12 @@ ia32_setregs(td, entry, stack, ps_strings)
struct trapframe *regs = td->td_frame;
struct pcb *pcb = td->td_pcb;
critical_enter();
wrmsr(MSR_FSBASE, 0);
wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */
pcb->pcb_fsbase = 0;
pcb->pcb_gsbase = 0;
critical_exit();
load_ds(_udatasel);
load_es(_udatasel);
load_fs(_udatasel);