From: John Hubbard <jhubbard@nvidia.com>
To: airlied@redhat.com, Lyude Paul <lyude@redhat.com>,
Danilo Krummrich <dakr@kernel.org>,
Alexandre Courbot <acourbot@nvidia.com>
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
nova-gpu@lists.linux.dev
Subject: Re: [PATCH v3 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers
Date: Tue, 24 Nov 2026 19:21:41 -0800 [thread overview]
Message-ID: <41dac367-ab55-4e0e-91a2-9fd68ef0c8ce@nvidia.com> (raw)
In-Reply-To: <20261124-nova-nouveau-gsp-v3-1-e1440479ded6@redhat.com>
On 11/23/26 9:50 PM, Dave Airlie via B4 Relay wrote:
> From: Dave Airlie <airlied@redhat.com>...
> @@ -3446,9 +3483,11 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
>
> ret = nvkm_intr_install(device);
> done:
> - if (ret && device->pri) {
> - iounmap(device->pri);
> - device->pri = NULL;
> + if (ret) {
> + /* Unwind the partially constructed device, so that the caller
> + * only has to release the resources it allocated itself.
> + */
> + nvkm_device_dtor(device);
This also fixes a user-after-free on Tegra (not just a leak), because struct
nvkm_device_tegra embeds a struct nvkm_device by value. In other words, if
nvkm_device_ctor() fails after adding the device to the nv_devices list,
nvkm_device_tegra_new() frees tdev while tdev->device is still on that list,
so the next nvkm_device_find_locked() call would read freed memory.
I'm not sure how important that is, but if it matters, then splitting
the fix back into its own patch might be the way to go here, after all.
thanks,
--
John Hubbard
next prev parent reply other threads:[~2026-11-25 3:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 5:50 [PATCH v3 0/2] nova/nouveau: add configs/module options to control binding behaviour (v2) Dave Airlie via B4 Relay
2026-11-24 5:50 ` [PATCH v3 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers Dave Airlie via B4 Relay
2026-11-25 3:21 ` John Hubbard [this message]
2026-11-24 5:50 ` [PATCH v3 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
2026-11-24 11:59 ` Danilo Krummrich
2026-11-24 14:25 ` Gary Guo
2026-11-25 2:24 ` John Hubbard
2026-11-24 14:27 ` [PATCH v3 0/2] nova/nouveau: add configs/module options to control binding behaviour (v2) Gary Guo
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=41dac367-ab55-4e0e-91a2-9fd68ef0c8ce@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=acourbot@nvidia.com \
--cc=airlied@redhat.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lyude@redhat.com \
--cc=nouveau@lists.freedesktop.org \
--cc=nova-gpu@lists.linux.dev \
/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