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: <20191125092230.GJ29965@phenom.ffwll.local>
Date:   Mon, 25 Nov 2019 10:22:30 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     Navid Emamdoost <navid.emamdoost@...il.com>
Cc:     Sumit Semwal <sumit.semwal@...aro.org>,
        Gustavo Padovan <gustavo@...ovan.org>,
        linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linaro-mm-sig@...ts.linaro.org, linux-kernel@...r.kernel.org,
        emamd001@....edu
Subject: Re: [PATCH] dma-buf: Fix memory leak in sync_file_merge()

On Fri, Nov 22, 2019 at 04:09:55PM -0600, Navid Emamdoost wrote:
> In the implementation of sync_file_merge() the allocated sync_file is
> leaked if number of fences overflows. Release sync_file by goto err.
> 
> Fixes: a02b9dc90d84 ("dma-buf/sync_file: refactor fence storage in struct sync_file")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>

Thanks for your patch, applied with a cc:stable.
-Daniel

> ---
>  drivers/dma-buf/sync_file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index 25c5c071645b..91185db9a952 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -221,7 +221,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
>  	a_fences = get_fences(a, &a_num_fences);
>  	b_fences = get_fences(b, &b_num_fences);
>  	if (a_num_fences > INT_MAX - b_num_fences)
> -		return NULL;
> +		goto err;
>  
>  	num_fences = a_num_fences + b_num_fences;
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ