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: <a4ee8918-d647-4028-affb-0bdc202cc183@amd.com>
Date: Mon, 24 Nov 2025 20:25:09 +0100
From: Christian König <christian.koenig@....com>
To: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>,
 Alex Deucher <alexander.deucher@....com>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>, "David (Ming Qiang) Wu" <David.Wu3@....com>
Cc: amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/2] drm/amdgpu: clear job on failure in
 amdgpu_job_alloc(_with_ib)

On 11/24/25 17:36, Pierre-Eric Pelloux-Prayer wrote:
> If memory is freed we need to nullify the pointer or the caller
> might call kfree again (eg: amdgpu_cs_parser_fini calls kfree on
> all non-null job pointers).
> 
> Fixes: a35c520c1611 ("drm/amdgpu: clean up and unify hw fence handling")
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>

Reviewed-by: Christian König <christian.koenig@....com> for both patches.

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index efa3281145f6..2fc3d9da0fe7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -225,6 +225,7 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>  	kfree((*job)->hw_fence);
>  err_job:
>  	kfree(*job);
> +	*job = NULL;
>  
>  	return r;
>  }
> @@ -246,6 +247,7 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev,
>  		if (entity)
>  			drm_sched_job_cleanup(&(*job)->base);
>  		kfree(*job);
> +		*job = NULL;
>  	}
>  
>  	return r;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ