AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
To: Pratik Vishwakarma
	<Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Harry.Wentland-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH 2/3] drm/amd/amdgpu: Fix crash in amdgpu_bo_reserve
Date: Wed, 6 Jun 2018 11:47:23 +0200	[thread overview]
Message-ID: <0cf36801-aee8-c6bf-9e42-d57197821dd9@amd.com> (raw)
In-Reply-To: <1528277142-20316-3-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>

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@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)

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-06-06  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06  9:25 [PATCH 0/3] Fix S3 entry crashes Pratik Vishwakarma
     [not found] ` <1528277142-20316-1-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-06  9:25   ` [PATCH 1/3] drm/amd/display: remove cursor hack for S3 Pratik Vishwakarma
2018-06-06  9:25   ` [PATCH 2/3] drm/amd/amdgpu: Fix crash in amdgpu_bo_reserve Pratik Vishwakarma
     [not found]     ` <1528277142-20316-3-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-06  9:47       ` Christian König [this message]
     [not found]         ` <0cf36801-aee8-c6bf-9e42-d57197821dd9-5C7GfCeVMHo@public.gmane.org>
2018-06-08  5:53           ` Vishwakarma, Pratik
2018-06-06  9:25   ` [PATCH 3/3] drm/amd/amdgpu: Fix NULL pointer OOPS during S3 Pratik Vishwakarma
     [not found]     ` <1528277142-20316-4-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-06  9:49       ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cf36801-aee8-c6bf-9e42-d57197821dd9@amd.com \
    --to=christian.koenig-5c7gfcevmho@public.gmane.org \
    --cc=Harry.Wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org \
    --cc=alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox