From 954caecd2ecebc5d1382efd1185b5736aaf99d8e Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 7 Nov 2003 21:59:23 -0800 Subject: [PATCH] Fix TSS limit on x86-64 The limit of the TSS segment was incorrectly set to a too big value on x86-64. This lead to the CPU reading random memory behind the main TSS when iopl was >0, but there was no ioperm bitmap set. This caused random failures in port accesses in this state. Set the correct limit. --- include/asm-x86_64/desc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h index f9d7d6a1a131..f1270929cd63 100644 --- a/include/asm-x86_64/desc.h +++ b/include/asm-x86_64/desc.h @@ -118,7 +118,7 @@ static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned 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); -- cgit v1.2.3