summaryrefslogtreecommitdiff
path: root/debian/patches/31_tls_ldt.patch
blob: 5cbc6d2b7f0d820bfecd03a6e929da1bce7e48e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#DPATCHLEVEL=0

2005-09-18  Jeroen Dekkers  <jeroen@dekkers.cx>

	* 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.


Index: i386/i386/locore.S
===================================================================
RCS file: /cvsroot/hurd/gnumach/i386/i386/locore.S,v
retrieving revision 1.6.2.1
diff -u -p -r1.6.2.1 locore.S
--- i386/i386/locore.S	28 Nov 2004 17:29:35 -0000	1.6.2.1
+++ i386/i386/locore.S	30 Aug 2005 10:34:02 -0000
@@ -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
Index: i386/i386/user_ldt.c
===================================================================
RCS file: /cvsroot/hurd/gnumach/i386/i386/user_ldt.c,v
retrieving revision 1.2
diff -u -p -r1.2 user_ldt.c
--- i386/i386/user_ldt.c	16 Sep 1999 02:17:48 -0000	1.2
+++ i386/i386/user_ldt.c	30 Aug 2005 10:34:02 -0000
@@ -225,7 +225,7 @@ i386_set_ldt(thread, first_selector, des
 		      (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++) {