Skip to contentSkip to conversation

some questions about vmx

Question linmiaohe 2 participants 2 messages Feb 7, 2020 KVM

lore
Share & tools
lore

linmiaohe

author
#0 lore raw

Hi:

Quoted 7 lines · Vitaly Kuznetsov
Quoted 4 lines · linmiaohe

About nWMX.
When nested_vmx_handle_enlightened_vmptrld() return 0, it do not inject any exception or set rflags to Indicate VMLAUNCH instruction failed and skip this instruction. This would cause nested_vmx_run()

Quoted 9 lines

Yes, it seems it can.

nested_vmx_handle_enlightened_vmptrld() has two possible places where it can fail:

kvm_vcpu_map() -- meaning that the guest passed some invalid GPA. revision id check -- meaning that the supplied eVMCS is unsupported/garbage.

I think the right behavior would be to nested_vmx_failInvalid() in both these cases. We can also check what genuing Hyper-V does.

Many thanks for your reply. I think this would be a problem too. And would you like to fix this potential problem? I have no idea how to fix this correctly... Thanks again.

#1 lore raw
Quoted 13 lines · linmiaohe

Hi:

Quoted 11 lines · Vitaly Kuznetsov
Quoted 4 lines · linmiaohe

About nWMX.
When nested_vmx_handle_enlightened_vmptrld() return 0, it do not inject any exception or set rflags to Indicate VMLAUNCH instruction failed and skip this instruction. This would cause nested_vmx_run()

Yes, it seems it can.

nested_vmx_handle_enlightened_vmptrld() has two possible places where it can fail:

Quoted 8 lines
Quoted 5 lines

kvm_vcpu_map() -- meaning that the guest passed some invalid GPA. revision id check -- meaning that the supplied eVMCS is unsupported/garbage.

I think the right behavior would be to nested_vmx_failInvalid() in both these cases. We can also check what genuing Hyper-V does.

Many thanks for your reply. I think this would be a problem too. And would you like to fix this potential problem? I have no idea how to fix this correctly...

Yes,

let me check what happens on Hyper-V and I'll send a patch. The problem should not be that severe as it only affect misbehaving L1 hypervisors.

Signature · 1 line
Vitaly