Bug 204175

Summary: Segmentation: incorrect base calculation in VMX
Product: Virtualization Reporter: Maxime Villard (max)
Component: kvmAssignee: virtualization_kvm
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 5.* Subsystem:
Regression: No Bisected commit-id:

Description Maxime Villard 2019-07-14 15:42:06 UTC
In vmx/nested.c::get_vmx_mem_address(), when the guest runs in long mode, the base address of the memory operand is computed with a simple:

    *ret = s.base + off;

This is incorrect, the base applies only to FS and GS, not to the others.

Because of that, if the guest uses a VMX instruction based on DS and has a DS.base that is non-zero, KVM wrongfully adds the base to the resulting address.