From: sashiko-bot@kernel.org
To: "Marco Crivellari" <marco.crivellari@suse.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Change system_unbound_wq with system_dfl_wq
Date: Tue, 07 Jul 2026 09:52:26 +0000 [thread overview]
Message-ID: <20260707095227.1D3E81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260707093812.109176-1-marco.crivellari@suse.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing explicit cancellation of asynchronous interrupt work items (ih_soft_work, ih1_work, ih2_work) during device teardown, leading to a Use-After-Free.
--
--- Patch [1]: [PATCH] drm/amdgpu: Change system_unbound_wq with system_dfl_wq ---
commit 65cddcba7474a0c152afd7f127fd2e2ad98c63ac
Author: Marco Crivellari <marco.crivellari@suse.com>
drm/amdgpu: Change system_unbound_wq with system_dfl_wq
This commit replaces the deprecated system_unbound_wq with the newer
system_dfl_wq to avoid deprecation warnings. The patch aims to keep the
existing workqueue behavior intact.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> @@ -547,7 +547,7 @@ void amdgpu_irq_delegate(struct amdgpu_device *adev,
> unsigned int num_dw)
> {
> amdgpu_ih_ring_write(adev, &adev->irq.ih_soft, entry->iv_entry, num_dw);
> - queue_work(system_unbound_wq, &adev->irq.ih_soft_work);
> + queue_work(system_dfl_wq, &adev->irq.ih_soft_work);
[Severity: High]
This is a pre-existing issue, but since we are modifying the workqueue
submission here, does the teardown path leave ih_soft_work pending?
If a hardware interrupt fires just before device unbind or module unload,
adev->irq.ih_soft_work can be queued onto the global system workqueue. When
the driver proceeds with teardown, it frees the interrupt handler and the
ring buffers:
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:amdgpu_irq_fini_hw() {
if (adev->irq.installed) {
free_irq(adev->irq.irq, adev_to_drm(adev));
...
amdgpu_ih_ring_fini(adev, &adev->irq.ih_soft);
}
However, it doesn't appear to explicitly call cancel_work_sync() for the
pending work items before freeing the adev structure. Could this result
in a use-after-free if the global workqueue asynchronously executes the
amdgpu_irq_handle_ih_soft() work item after the device memory is freed?
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707093812.109176-1-marco.crivellari@suse.com?part=1
next prev parent reply other threads:[~2026-07-07 9:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 9:38 [PATCH] drm/amdgpu: Change system_unbound_wq with system_dfl_wq Marco Crivellari
2026-07-07 9:52 ` sashiko-bot [this message]
2026-07-07 11:02 ` Timur Kristóf
2026-07-07 18:12 ` Alex Deucher
2026-07-08 6:23 ` Marco Crivellari
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=20260707095227.1D3E81F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=marco.crivellari@suse.com \
--cc=sashiko-reviews@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 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.