From: Beomseok Kim <dilddream31@gmail.com>
To: emmanuel.fleury@u-bordeaux.fr
Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, dakr@kernel.org, airlied@gmail.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
simona@ffwll.ch
Subject: Re: [PATCH] drm/nouveau: Fix NULL pointer dereference in nouveau_fence_sync() when prev->cli == NULL
Date: Tue, 6 Oct 2026 18:58:41 +0900 [thread overview]
Message-ID: <20261006095841.35167-1-dilddream31@gmail.com> (raw)
In-Reply-To: <1690ea65-a1e0-4a34-bde1-bdd26e31c6c4@u-bordeaux.fr>
Hi Emmanuel,
I have been looking into what appears to be the same NULL dereference in
nouveau_fence_sync(), and I found a path that may explain how prev->cli
ends up NULL.
In the failure I traced, nouveau_fence_no_signaling() removes the fence
from the pending list, but leaves fence->channel pointing to the channel.
The fence itself can remain alive through a BO reservation. After the
channel is torn down, the same fence can later be encountered again in
nouveau_fence_sync() through that stale channel association.
The normal nouveau_fence_signal() path clears fence->channel when removing
the fence from the pending list, so the no-signaling path appears
asymmetric here.
I also did not find a normal path that explicitly sets channel->cli to
NULL while keeping the channel valid. If this is the path leading to the
crash, checking prev->cli here would prevent the dereference, but the stale
fence->channel association would still remain.
The existing fence/channel lifetime handling seems to rely on clearing
fence->channel once the fence is detached from the channel. If that is the
intended invariant, preserving it in the no-signaling path seems preferable
to allowing a non-NULL fence->channel to refer to a torn-down channel.
I sent a separate patch that clears fence->channel in
nouveau_fence_no_signaling():
[PATCH] drm/nouveau: Clear fence channel in no-signaling path
https://lore.kernel.org/r/20260928081450.19340-1-dilddream31@gmail.com
Thanks,
Beomseok
WARNING: multiple messages have this Message-ID (diff)
From: Beomseok Kim <dilddream31@gmail.com>
To: emmanuel.fleury@u-bordeaux.fr
Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, dakr@kernel.org,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
simona@ffwll.ch
Subject: Re: [PATCH] drm/nouveau: Fix NULL pointer dereference in nouveau_fence_sync() when prev->cli == NULL
Date: Tue, 6 Oct 2026 18:58:41 +0900 [thread overview]
Message-ID: <20261006095841.35167-1-dilddream31@gmail.com> (raw)
In-Reply-To: <1690ea65-a1e0-4a34-bde1-bdd26e31c6c4@u-bordeaux.fr>
Hi Emmanuel,
I have been looking into what appears to be the same NULL dereference in
nouveau_fence_sync(), and I found a path that may explain how prev->cli
ends up NULL.
In the failure I traced, nouveau_fence_no_signaling() removes the fence
from the pending list, but leaves fence->channel pointing to the channel.
The fence itself can remain alive through a BO reservation. After the
channel is torn down, the same fence can later be encountered again in
nouveau_fence_sync() through that stale channel association.
The normal nouveau_fence_signal() path clears fence->channel when removing
the fence from the pending list, so the no-signaling path appears
asymmetric here.
I also did not find a normal path that explicitly sets channel->cli to
NULL while keeping the channel valid. If this is the path leading to the
crash, checking prev->cli here would prevent the dereference, but the stale
fence->channel association would still remain.
The existing fence/channel lifetime handling seems to rely on clearing
fence->channel once the fence is detached from the channel. If that is the
intended invariant, preserving it in the no-signaling path seems preferable
to allowing a non-NULL fence->channel to refer to a torn-down channel.
I sent a separate patch that clears fence->channel in
nouveau_fence_no_signaling():
[PATCH] drm/nouveau: Clear fence channel in no-signaling path
https://lore.kernel.org/r/20260928081450.19340-1-dilddream31@gmail.com
Thanks,
Beomseok
next prev parent reply other threads:[~2026-10-07 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 10:06 [PATCH] drm/nouveau: Fix NULL pointer dereference in nouveau_fence_sync() when prev->cli == NULL Emmanuel Fleury
2026-07-23 10:06 ` Emmanuel Fleury
2026-10-06 9:58 ` Beomseok Kim [this message]
2026-10-06 9:58 ` Beomseok Kim
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=20261006095841.35167-1-dilddream31@gmail.com \
--to=dilddream31@gmail.com \
--cc=airlied@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=emmanuel.fleury@u-bordeaux.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=simona@ffwll.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.