]> git.hungrycats.org Git - linux/commitdiff
[PATCH] x86_64: fix tss off by one
authorAndi Kleen <ak@muc.de>
Wed, 6 Oct 2004 01:15:12 +0000 (18:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 01:15:12 +0000 (18:15 -0700)
From: "Siddha, Suresh B" <suresh.b.siddha@intel.com>

Fix off by one in TSS limit.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-x86_64/desc.h

index b4543649b44ebc0a80c90d91e1c3e77579c73ced..004888f2fdbd40ed8d0513d8dcf469423920f6ec 100644 (file)
@@ -128,13 +128,13 @@ static inline void set_tss_desc(unsigned cpu, void *addr)
 { 
        set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS], (unsigned long)addr, 
                              DESC_TSS,
-                             sizeof(struct tss_struct)); 
+                             sizeof(struct tss_struct) - 1);
 } 
 
 static inline void set_ldt_desc(unsigned cpu, void *addr, int size)
 { 
        set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_LDT], (unsigned long)addr, 
-                             DESC_LDT, size * 8);
+                             DESC_LDT, size * 8 - 1);
 }
 
 static inline void set_seg_base(unsigned cpu, int entry, void *base)