diff mbox

KVM: VMX: fix page leak in hardware_setup()

Message ID 20171201175756.16841-1-jmattson@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Mattson Dec. 1, 2017, 5:57 p.m. UTC
vmx_io_bitmap_b should not be allocated twice.

Fixes: 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Krish Sadhukhan Dec. 1, 2017, 8:59 p.m. UTC | #1
On 12/01/2017 09:57 AM, Jim Mattson wrote:
> vmx_io_bitmap_b should not be allocated twice.
>
> Fixes: 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
>   arch/x86/kvm/vmx.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 4704aaf6d19e..5fb5c4aff1cf 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -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: Krish Sadhukhan <krish.sadhukhan@oracle.com>
David Hildenbrand Dec. 4, 2017, 9:09 a.m. UTC | #2
On 01.12.2017 18:57, Jim Mattson wrote:
> vmx_io_bitmap_b should not be allocated twice.
> 
> Fixes: 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
>  arch/x86/kvm/vmx.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 4704aaf6d19e..5fb5c4aff1cf 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -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: David Hildenbrand <david@redhat.com>
Radim Krčmář Dec. 5, 2017, 9:37 p.m. UTC | #3
2017-12-01 09:57-0800, Jim Mattson:
> vmx_io_bitmap_b should not be allocated twice.
> 
> Fixes: 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---

Applied, thanks.

>  arch/x86/kvm/vmx.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 4704aaf6d19e..5fb5c4aff1cf 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -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);
>  
> -- 
> 2.15.0.531.g2ccb3012c9-goog
>
Quan Xu Dec. 7, 2017, 3:57 a.m. UTC | #4
On 2017/12/02 01:57, Jim Mattson wrote:
> vmx_io_bitmap_b should not be allocated twice.
>
> Fixes: 23611332938d ("KVM: VMX: refactor setup of global page-sized bitmaps")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
>   arch/x86/kvm/vmx.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 4704aaf6d19e..5fb5c4aff1cf 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -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: Quan Xu <quan.xu0@gmail.com>
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 4704aaf6d19e..5fb5c4aff1cf 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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);