From a52299fcf0d391e1286db40db66912e31ecf3fbc Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 26 Jan 2006 14:53:56 +0000 Subject: 2006-01-26 Jeroen Dekkers * i386/i386/locore.S (trap_push_segs): Switch fs and gs to kernel data segment too. (syscall_entry_2): Likewise. * i386/i386/user_ldt.c (i386_set_ldt): Always copy the master LDT when there is no old user LDT. --- i386/i386/locore.S | 4 ++++ i386/i386/user_ldt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'i386') diff --git a/i386/i386/locore.S b/i386/i386/locore.S index 3a6d350..7d320d7 100644 --- a/i386/i386/locore.S +++ b/i386/i386/locore.S @@ -464,6 +464,8 @@ trap_push_segs: mov %ss,%ax /* switch to kernel data segment */ mov %ax,%ds /* (same as kernel stack segment) */ mov %ax,%es + mov %ax,%fs + mov %ax,%gs trap_set_segs: cld /* clear direction flag */ @@ -982,6 +984,8 @@ syscall_entry_2: mov %ss,%dx /* switch to kernel data segment */ mov %dx,%ds mov %dx,%es + mov %dx,%fs + mov %dx,%gs /* * Shuffle eflags,eip,cs into proper places diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c index 5c5df64..d259ea3 100644 --- a/i386/i386/user_ldt.c +++ b/i386/i386/user_ldt.c @@ -225,7 +225,7 @@ i386_set_ldt(thread, first_selector, desc_list, count, desc_list_inline) (char *)&new_ldt->ldt[0], old_ldt->desc.limit_low + 1); } - else if (thread == current_thread()) { + else { struct real_descriptor template = {0, 0, 0, ACC_P, 0, 0 ,0}; for (dp = &new_ldt->ldt[0], i = 0; i < first_desc; i++, dp++) { -- cgit v1.2.3