From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Yizhuo Zhai <yzhai003@ucr.edu>,
"Deucher, Alexander" <Alexander.Deucher@amd.com>,
"Zhou, David(ChunMing)" <David1.Zhou@amd.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Sam Ravnborg <sam@ravnborg.org>, "Quan, Evan" <Evan.Quan@amd.com>,
"Xiao, Jack" <Jack.Xiao@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Zhiyun Qian <zhiyunq@cs.ucr.edu>, Chengyu Song <csong@cs.ucr.edu>
Subject: Re: Potential NULL pointer deference in drm/amdgpu
Date: Thu, 10 Oct 2019 06:52:29 +0000 [thread overview]
Message-ID: <4b4166e6-738a-5c64-4ca7-e183a6c94aac@amd.com> (raw)
In-Reply-To: <CABvMjLQuxeZnRMV0T5VDeEj7zV7mD4wzp5QPFCJ_oVhH0vRihQ@mail.gmail.com>
Hi Yizhuo,
Am 10.10.19 um 07:09 schrieb Yizhuo Zhai:
> Hi All:
> drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c:
> The function to_amdgpu_fence() could return NULL, but callers
> in this file does not check the return value but directly dereference it,
> which seems potentially unsafe.
> Such callers include amdgpu_fence_get_timeline_name(),
> amdgpu_fence_enable_signaling() and amdgpu_fence_free().
That is expected behavior and no need to worry.
The functions in amdgpu_fence.c are the callbacks to implement
amdgpu_fence_ops. The function to_amdgpu_fence() checks if the ops of
the fence are amdgpu_fence_ops, so it is guaranteed that the functions
are called with an amdgpu_fence structure.
Regards,
Christian.
prev parent reply other threads:[~2019-10-10 6:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 5:09 Yizhuo Zhai
2019-10-10 6:52 ` Koenig, Christian [this message]
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=4b4166e6-738a-5c64-4ca7-e183a6c94aac@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=David1.Zhou@amd.com \
--cc=Evan.Quan@amd.com \
--cc=Jack.Xiao@amd.com \
--cc=airlied@linux.ie \
--cc=amd-gfx@lists.freedesktop.org \
--cc=csong@cs.ucr.edu \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=yzhai003@ucr.edu \
--cc=zhiyunq@cs.ucr.edu \
/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®