mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhang Boyang <zhangboyang.id@gmail.com>
To: "Andrey Grodzovsky" <andrey.grodzovsky@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org
Cc: "David C . Rankin" <drankinatty@suddenlinkmail.com>,
	Steven J Abner <pheonix.sja@att.net>
Subject: [RFC PATCH 0/1] drm/amdgpu: Fix NULL-deref in amdgpu_device_fini_sw()
Date: Sat,  1 Oct 2022 05:41:09 +0800	[thread overview]
Message-ID: <20220930214110.1074226-1-zhangboyang.id@gmail.com> (raw)

Hi,

There are several reports of "Fatal error during GPU init" will cause
NULL-deref in amdgpu_device_fini_sw(). Although the NULL-deref is result
instead of reason, this NULL-deref will confuse user.

https://lore.kernel.org/lkml/a8bce489-8ccc-aa95-3de6-f854e03ad557@suddenlinkmail.com/
https://lore.kernel.org/lkml/AT9WHR.3Z1T3VI9A2AQ3@att.net/

This is probably because "adev" is not fully initialized when
amdgpu_device_init() failed. Thus subsequent amdgpu_device_fini_sw()
will try to release "adev->reset_domain" and cause NULL-deref.

This patch fixes this problem by guarding the code with an "if".
However, I'm new to this module and I didn't fully understand the code,
so please review my code carefully.

Best Regards,
Zhang Boyang



             reply	other threads:[~2022-09-30 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 21:41 Zhang Boyang [this message]
2022-09-30 21:41 ` [RFC PATCH 1/1] drm/amdgpu: Fix null-ptr-deref " Zhang Boyang
2022-09-30 22:38   ` Steven J Abner

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=20220930214110.1074226-1-zhangboyang.id@gmail.com \
    --to=zhangboyang.id@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrey.grodzovsky@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=drankinatty@suddenlinkmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pheonix.sja@att.net \
    /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

all inboxes | Powered by JetHome®