ChangeSet 1.2231.1.77, 2005/03/28 19:37:59-08:00, [EMAIL PROTECTED]

        [PATCH] x86_64: Fix LDT descriptor
        
        Fix bug introduced with the TLS system calls in 2.5.  The LDT 
descriptor needs
        two entries, not one.  It would overlap into the TLS range, which means
        setting an LDT would corrupt the first TLS descriptor.
        
        Noticed by Jan Beulich
        
        Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
        Cc: <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 arch/x86_64/kernel/head.S    |    3 +--
 include/asm-x86_64/segment.h |    7 +++----
 2 files changed, 4 insertions(+), 6 deletions(-)


diff -Nru a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
--- a/arch/x86_64/kernel/head.S 2005-03-28 21:23:25 -08:00
+++ b/arch/x86_64/kernel/head.S 2005-03-28 21:23:25 -08:00
@@ -377,9 +377,8 @@
        .quad   0x00affa000000ffff      /* __USER_CS */
        .quad   0x00cf9a000000ffff      /* __KERNEL32_CS */
        .quad   0,0                     /* TSS */
-       .quad   0                       /* LDT */
+       .quad   0,0                     /* LDT */
        .quad   0,0,0                   /* three TLS descriptors */ 
-       .quad   0                       /* unused now */
        .quad   0x00009a000000ffff      /* __KERNEL16_CS - 16bit PM for S3 
wakeup. */
                                        /* base must be patched for real base 
address. */
 gdt_end:       
diff -Nru a/include/asm-x86_64/segment.h b/include/asm-x86_64/segment.h
--- a/include/asm-x86_64/segment.h      2005-03-28 21:23:25 -08:00
+++ b/include/asm-x86_64/segment.h      2005-03-28 21:23:25 -08:00
@@ -24,10 +24,9 @@
 
 #define GDT_ENTRY_TLS 1
 #define GDT_ENTRY_TSS 8        /* needs two entries */
-#define GDT_ENTRY_LDT 10
-#define GDT_ENTRY_TLS_MIN 11
-#define GDT_ENTRY_TLS_MAX 13
-/* 14 free */
+#define GDT_ENTRY_LDT 10 /* needs two entries */
+#define GDT_ENTRY_TLS_MIN 12
+#define GDT_ENTRY_TLS_MAX 14
 #define GDT_ENTRY_KERNELCS16 15
 
 #define GDT_ENTRY_TLS_ENTRIES 3
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to