summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/user_ldt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
index 3f37599..f1b5f6b 100644
--- a/i386/i386/user_ldt.c
+++ b/i386/i386/user_ldt.c
@@ -437,6 +437,13 @@ i386_set_gdt (thread_t thread, int *selector, struct real_descriptor desc)
else
thread->pcb->ims.user_gdt[idx] = desc;
+ /*
+ * If we are modifying the GDT for the current thread,
+ * make sure it is properly set.
+ */
+ if (thread == current_thread())
+ switch_ktss(thread->pcb);
+
return KERN_SUCCESS;
}