Skip to content

Commit 4769886

Browse files
Dan Carpenterrkrcmar
authored andcommitted
kvm: nVMX: off by one in vmx_write_pml_buffer()
There are PML_ENTITY_NUM elements in the pml_address[] array so the > should be >= or we write beyond the end of the array when we do: pml_address[vmcs12->guest_pml_index--] = gpa; Fixes: c5f983f ("nVMX: Implement emulated Page Modification Logging") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Radim Krčmář <[email protected]>
1 parent 65acb89 commit 4769886

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11213,7 +11213,7 @@ static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
1121311213
if (!nested_cpu_has_pml(vmcs12))
1121411214
return 0;
1121511215

11216-
if (vmcs12->guest_pml_index > PML_ENTITY_NUM) {
11216+
if (vmcs12->guest_pml_index >= PML_ENTITY_NUM) {
1121711217
vmx->nested.pml_full = true;
1121811218
return 1;
1121911219
}

0 commit comments

Comments
 (0)