From: Andi Kleen <ak@muc.de>

The TSS limit was incorrectly set on x86-64.  This lead to the CPU reading
random memory beyond the TSS as ioperm bitmap when iopl is > 0, but there
is no ioperm bitmap initialized.  Result were random failures of io port
accesses in this case.

Set the upper 4 bits of the limit correctly.



 include/asm-x86_64/desc.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN include/asm-x86_64/desc.h~x86_64-tss-limit-fix include/asm-x86_64/desc.h
--- 25/include/asm-x86_64/desc.h~x86_64-tss-limit-fix	2003-11-01 21:24:40.000000000 -0800
+++ 25-akpm/include/asm-x86_64/desc.h	2003-11-01 21:24:40.000000000 -0800
@@ -118,7 +118,7 @@ static inline void set_tssldt_descriptor
 	d.base1 = PTR_MIDDLE(tss) & 0xFF; 
 	d.type = type;
 	d.p = 1; 
-	d.limit1 = 0xF;
+	d.limit1 = (size >> 16) & 0xF;
 	d.base2 = (PTR_MIDDLE(tss) >> 8) & 0xFF; 
 	d.base3 = PTR_HIGH(tss); 
 	memcpy(ptr, &d, 16); 

_