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] [thread-next>] [day] [month] [year] [list]
Message-ID: <A3397C8B8B789E45844E7EC5DEAD89D03ECB1956@satlexdag05.amd.com>
Date:	Mon, 14 Apr 2014 21:43:26 +0000
From:	"Deucher, Alexander" <Alexander.Deucher@....com>
To:	Quentin Casasnovas <quentin.casasnovas@...cle.com>,
	David Airlie <airlied@...ux.ie>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"stable@...r.kernel.org" <stable@...r.kernel.org>,
	"Koenig, Christian" <Christian.Koenig@....com>
Subject: RE: [PATCH] drm/radeon: memory leak on bo reservation failure.

> -----Original Message-----
> From: Quentin Casasnovas [mailto:quentin.casasnovas@...cle.com]
> Sent: Tuesday, March 18, 2014 12:17 PM
> To: David Airlie
> Cc: linux-kernel@...r.kernel.org; Quentin Casasnovas;
> stable@...r.kernel.org; Koenig, Christian; Deucher, Alexander
> Subject: [PATCH] drm/radeon: memory leak on bo reservation failure.
> 
> On bo reservation failure, we end up leaking fpriv.
> 
> Fixes: 5e386b574cf7e1 ("drm/radeon: fix missing bo reservation")
> Cc: stable@...r.kernel.org
> Cc: Christian König <christian.koenig@....com>
> Cc: Alex Deucher <alexander.deucher@....com>
> Signed-off-by: Quentin Casasnovas <quentin.casasnovas@...cle.com>

Sorry I missed this.  It looks like we probably want an updated version for newer kernels where radeon_vm_init() can fail as well.

Reviewed-by: Alex Deucher <alexander.deucher@....com>

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_kms.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c
> b/drivers/gpu/drm/radeon/radeon_kms.c
> index 66ed3ea..51cda80 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -546,8 +546,11 @@ int radeon_driver_open_kms(struct drm_device
> *dev, struct drm_file *file_priv)
>  		radeon_vm_init(rdev, &fpriv->vm);
> 
>  		r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
> -		if (r)
> +		if (r) {
> +			radeon_vm_fini(rdev, &fpriv->vm);
> +			kfree(fpriv);
>  			return r;
> +		}
> 
>  		/* map the ib pool buffer read only into
>  		 * virtual address space */
> --
> 1.8.3.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ