Skip to contentSkip to conversation

KVM: VMX: fix page leak in hardware_setup()

PATCH Applied Jim Mattson 5 participants 5 messages Dec 1, 2017 – Dec 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: VMX: fix page leak in hardware_setup()

vmx_io_bitmap_b should not be allocated twice.

Fixes 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
---
 arch/x86/kvm/vmx.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/vmx.c +0 -1
index 4704aaf6d19e..5fb5c4aff1cf 100644
@@ -6751,7 +6751,6 @@ static __init int hardware_setup(void)
 			goto out;
 	}
 
-	vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
 	memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
 	memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);
 
Signature · 1 line
2.15.0.531.g2ccb3012c9-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Jim Mattson

vmx_io_bitmap_b should not be allocated twice.

Fixes 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
---
  arch/x86/kvm/vmx.c | 1 -
  1 file changed, 1 deletion(-)
arch/x86/kvm/vmx.c +0 -0
index 4704aaf6d19e..5fb5c4aff1cf 100644

arch/x86/kvm/vmx.c static __init int hardware_setup(void) · line 6756

Quoted 7 lines
arch/x86/kvm/vmx.c +0 -1
@@ -6751,7 +6751,6 @@ static __init int hardware_setup(void)
  			goto out;
  	}
 
-	vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
  	memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
  	memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jim Mattson
Quoted 14 lines · Jim Mattson

vmx_io_bitmap_b should not be allocated twice.

Fixes 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
---
 arch/x86/kvm/vmx.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/vmx.c +0 -0
index 4704aaf6d19e..5fb5c4aff1cf 100644

arch/x86/kvm/vmx.c static __init int hardware_setup(void) · line 6756

Quoted 7 lines
arch/x86/kvm/vmx.c +0 -1
@@ -6751,7 +6751,6 @@ static __init int hardware_setup(void)
 			goto out;
 	}
 
-	vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
 	memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
 	memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);
 
Signature · 3 lines
Thanks,

David / dhildenb
#3 lore raw
In reply to Jim Mattson

2017-12-01 09:57-0800, Jim Mattson:

Quoted 5 lines

vmx_io_bitmap_b should not be allocated twice.

Fixes 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")

---

Applied, thanks.

Quoted 18 lines
 arch/x86/kvm/vmx.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/vmx.c +0 -1
index 4704aaf6d19e..5fb5c4aff1cf 100644
@@ -6751,7 +6751,6 @@ static __init int hardware_setup(void)
 			goto out;
 	}
 
-	vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
 	memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
 	memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);
 
Signature · 1 line
2.15.0.531.g2ccb3012c9-goog
Reviewed-by on v1 1/1
#4 lore raw
In reply to Jim Mattson
Quoted 13 lines · Jim Mattson

vmx_io_bitmap_b should not be allocated twice.

Fixes 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
---
  arch/x86/kvm/vmx.c | 1 -
  1 file changed, 1 deletion(-)
arch/x86/kvm/vmx.c +0 -0
index 4704aaf6d19e..5fb5c4aff1cf 100644

arch/x86/kvm/vmx.c static __init int hardware_setup(void) · line 6756

Quoted 7 lines
arch/x86/kvm/vmx.c +0 -1
@@ -6751,7 +6751,6 @@ static __init int hardware_setup(void)
  			goto out;
  	}
 
-	vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
  	memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE);
  	memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE);