Skip to content

Commit

Permalink
KVM: VMX: Restore tss even on x86_64
Browse files Browse the repository at this point in the history
The vmx hardware state restore restores the tss selector and base address, but
not its length.  Usually, this does not matter since most of the tss contents
is within the default length of 0x67.  However, if a process is using ioperm()
to grant itself I/O port permissions, an additional bitmap within the tss,
but outside the default length is consulted.  The effect is that the process
will receive a SIGSEGV instead of transparently accessing the port.

Fix by restoring the tss length.  Note that i386 had this working already.

Closes bugzilla 10246.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Mar 25, 2008
1 parent a4083c9 commit 5dc8326
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)

static void reload_tss(void)
{
#ifndef CONFIG_X86_64

/*
* VT restores TR but not its size. Useless.
*/
Expand All @@ -361,7 +359,6 @@ static void reload_tss(void)
descs = (void *)gdt.base;
descs[GDT_ENTRY_TSS].type = 9; /* available TSS */
load_TR_desc();
#endif
}

static void load_transition_efer(struct vcpu_vmx *vmx)
Expand Down

0 comments on commit 5dc8326

Please sign in to comment.