lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <48a2ad9b-bcdb-6146-0911-37961e07b1d9@redhat.com>
Date:   Tue, 1 Oct 2019 08:15:23 +0200
From:   Hans de Goede <hdegoede@...hat.com>
To:     Navid Emamdoost <navid.emamdoost@...il.com>
Cc:     emamd001@....edu, smccaman@....edu, kjlu@....edu,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] virt: vbox: fix memory leak in
 hgcm_call_preprocess_linaddr

Hi,

On 30-09-2019 22:42, Navid Emamdoost wrote:
> In hgcm_call_preprocess_linaddr memory is allocated for bounce_buf but
> is not released if copy_form_user fails. In order to prevent memory leak
> in case of failure, the assignment to bounce_buf_ret is moved before the
> error check. This way the allocated bounce_buf will be released by the
> caller.
> 
> Fixes: 579db9d45cb4 ("virt: Add vboxguest VMMDEV communication code")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>

Thank you.

Patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@...hat.com>

Regards,

Hans



> ---
>   drivers/virt/vboxguest/vboxguest_utils.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/virt/vboxguest/vboxguest_utils.c b/drivers/virt/vboxguest/vboxguest_utils.c
> index 75fd140b02ff..43c391626a00 100644
> --- a/drivers/virt/vboxguest/vboxguest_utils.c
> +++ b/drivers/virt/vboxguest/vboxguest_utils.c
> @@ -220,6 +220,8 @@ static int hgcm_call_preprocess_linaddr(
>   	if (!bounce_buf)
>   		return -ENOMEM;
>   
> +	*bounce_buf_ret = bounce_buf;
> +
>   	if (copy_in) {
>   		ret = copy_from_user(bounce_buf, (void __user *)buf, len);
>   		if (ret)
> @@ -228,7 +230,6 @@ static int hgcm_call_preprocess_linaddr(
>   		memset(bounce_buf, 0, len);
>   	}
>   
> -	*bounce_buf_ret = bounce_buf;
>   	hgcm_call_add_pagelist_size(bounce_buf, len, extra);
>   	return 0;
>   }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ