[PATCH 2/3] drm/amd/amdgpu: Fix crash in amdgpu_bo_reserve

Vishwakarma, Pratik Pratik.Vishwakarma at amd.com
Fri Jun 8 05:53:25 UTC 2018


Ok. Abandoning the series.
I am working on identifying the root cause and will post the new patch soon.

Regards
Pratik

-----Original Message-----
From: Koenig, Christian 
Sent: Wednesday, June 6, 2018 3:17 PM
To: Vishwakarma, Pratik <Pratik.Vishwakarma at amd.com>; amd-gfx at lists.freedesktop.org; alexdeucher at gmail.com; Wentland, Harry <Harry.Wentland at amd.com>
Subject: Re: [PATCH 2/3] drm/amd/amdgpu: Fix crash in amdgpu_bo_reserve

NAK, when bo->tbo.resv is NULL then the BO is corrupted (or already released).

Please find the root cause of that corruption or freed memory access instead of adding such crude workarounds.

Regards,
Christian.

Am 06.06.2018 um 11:25 schrieb Pratik Vishwakarma:
> Fixes null pointer access in ww_mutex_lock where lock->base is NULL
>
> Crash dump is as follows:
> Call Trace:
> ww_mutex_lock+0x3a/0x8e
> amdgpu_bo_reserve+0x40/0x87
> amdgpu_device_suspend+0xf4/0x210
> pci_pm_suspend+0x12a/0x1a5
> ? pci_dev_driver+0x36/0x36
> dpm_run_callback+0x59/0xbf
> __device_suspend+0x215/0x33f
> async_suspend+0x1f/0x5c
> async_run_entry_fn+0x3d/0xd2
> process_one_work+0x1b0/0x314
> worker_thread+0x1cb/0x2c1
> ? create_worker+0x1da/0x1da
> kthread+0x156/0x15e
> ? kthread_flush_work+0xea/0xea
> ret_from_fork+0x22/0x40
>
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index 7317480..c9df7ae 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> @@ -152,6 +152,8 @@ static inline int amdgpu_bo_reserve(struct amdgpu_bo *bo, bool no_intr)
>   	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
>   	int r;
>   
> +	if (&(bo->tbo.resv->lock) == NULL)
> +		return -EINVAL;
>   	r = ttm_bo_reserve(&bo->tbo, !no_intr, false, NULL);
>   	if (unlikely(r != 0)) {
>   		if (r != -ERESTARTSYS)



More information about the amd-gfx mailing list