From: sashiko-bot@kernel.org
To: "Michael J. Ruhl" <michael.j.ruhl@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v7 17/20] drm/xe/vsec: Support late bind fw information
Date: Wed, 09 Sep 2026 16:08:00 +0000 [thread overview]
Message-ID: <20260909160801.60CE71F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909154739.1515514-39-michael.j.ruhl@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Use-After-Free and Resource Leak due to devres addition race during teardown.
- [Low] Build Error: The function `xe_is_oobmsm_fw_ready` is called but neither declared nor defined anywhere in the kernel tree.
--
commit b7956351d5d5da18fd9bd94f1d6cfe8332cfde1f
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
drm/xe/vsec: Support late bind fw information
This patch adds support for late bind firmware information for CRI FW, which
is loaded on power on. It updates the XE PMT probe and access routines to
check for late bind devices, and uses a delayed workqueue to wait for the
FW state before probing or accessing PMT telemetry.
> diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
> index 58421e3157a8f..bf75adb73f27e 100644
> --- a/drivers/gpu/drm/xe/xe_vsec.c
> +++ b/drivers/gpu/drm/xe/xe_vsec.c
[ ... ]
> @@ -281,6 +291,48 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
> return -ENODEV;
> }
>
> +static void cri_late_bind_probe_work(struct work_struct *work)
> +{
> + struct xe_device *xe = container_of(work, struct xe_device, pmt.work.work);
> +
> + if (xe_is_oobmsm_fw_ready(xe)) {
[Severity: Low]
Does this code compile successfully? It appears xe_is_oobmsm_fw_ready() is
called here (and in wait_for_fw() and xe_vsec_init()) but it does not seem
to be declared or defined anywhere in the kernel tree.
> + cri_late_bind_probe(xe);
> + xe_pm_runtime_put(xe);
> + return;
> + }
[ ... ]
> +static void vsec_disable_late_bind_work(void *arg)
> +{
> + struct xe_device *xe = arg;
> +
> + /*
> + * If the queued work is canceled, the runtime reference needs to be
> + * released here.
> + */
> + if (disable_delayed_work_sync(&xe->pmt.work))
> + xe_pm_runtime_put(xe);
> +}
> +
> /**
> * xe_vsec_init - Initialize resources and add intel_vsec auxiliary
> * interface
> * @xe: valid xe instance
> */
> -void xe_vsec_init(struct xe_device *xe)
> +int xe_vsec_init(struct xe_device *xe)
> {
[ ... ]
> case XE_VSEC_CRI:
> if (IS_SRIOV_VF(xe))
> - return;
> + return 0;
> +
> xe->pmt.base_offset = CRI_PMT_OFFSET;
> +
> + xe->pmt.retry_count = 0;
> + INIT_DELAYED_WORK(&xe->pmt.work, cri_late_bind_probe_work);
> +
> + xe_pm_runtime_get_noresume(xe);
> + if (!xe_is_oobmsm_fw_ready(xe)) {
> + schedule_delayed_work(&xe->pmt.work,
> + msecs_to_jiffies(VSEC_LATE_BIND_DELAY_MSEC));
> + return devm_add_action_or_reset(xe->drm.dev,
> + vsec_disable_late_bind_work,
> + xe);
> + }
[Severity: High]
Can this lead to a devres leak and use-after-free during driver teardown?
If the driver teardown is initiated concurrently, devres_release_all() will
splice the devres list to a local todo list before executing the cleanup
actions.
When vsec_disable_late_bind_work() executes from that local list, it blocks
on the delayed work using disable_delayed_work_sync(). If the worker thread
(cri_late_bind_probe_work) is already executing, it proceeds to call
intel_vsec_register(), which adds new devm actions to the parent device.
Since the parent devres list was already spliced, these newly added devm
actions sit on the empty devres_head and are never processed. Could this
cause the auxiliary device to be leaked and accessed after the parent
device is freed?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909154739.1515514-22-michael.j.ruhl@intel.com?part=17
next prev parent reply other threads:[~2026-09-09 16:08 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 15:47 [PATCH v7 00/20] Crescent Island PMT support Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 01/20] platform/x86/intel/pmt: complete pcidev to device update Michael J. Ruhl
2026-09-09 16:01 ` sashiko-bot
2026-09-09 15:47 ` [PATCH v7 02/20] platform/x86/intel/pmt: refactor rmw with a return value Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 03/20] platform/x86/intel/pmt: refactor rc " Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 04/20] platform/x86/intel/pmt: Add register access callbacks Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 05/20] platform/x86/intel/pmt: Do not remap when using callbacks Michael J. Ruhl
2026-09-09 16:00 ` sashiko-bot
2026-09-09 15:47 ` [PATCH v7 06/20] drm/xe/vsec: Do not register BMG PMT for VF Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 07/20] drm/xe/vsec: Correct locking order Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 08/20] drm/xe/vsec: Use correct pm state get Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 09/20] drm/xe/vsec: Add DOC text for VSEC Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 10/20] drm/xe/vsec: Support possible hotplug exit Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 11/20] drm/xe/vsec: Refactor BattleMage PMT defines Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 12/20] drm/xe/vsec: Support EAGAIN return value Michael J. Ruhl
2026-09-09 16:01 ` sashiko-bot
2026-09-11 20:01 ` Ruhl, Michael J
2026-09-09 15:47 ` [PATCH v7 13/20] drm/xe/vsec: Add base_offset to allow for more flexibilty Michael J. Ruhl
2026-09-09 16:02 ` sashiko-bot
2026-09-11 20:03 ` Ruhl, Michael J
2026-09-09 15:47 ` [PATCH v7 14/20] drm/xe/vsec: Support Crescent Island PMT Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 15/20] drm/xe/vsec: Crescent Island PMT decode Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 16/20] drm/xe/vsec: Crescent Island PMT callbacks Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 17/20] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
2026-09-09 16:08 ` sashiko-bot [this message]
2026-09-09 15:47 ` [PATCH v7 18/20] drm/xe/vsec: Add PMT GUID internal access Michael J. Ruhl
2026-09-10 18:55 ` Poosa, Karthik
2026-09-09 15:47 ` [PATCH v7 19/20] drm/xe/vsec: Update PMT " Michael J. Ruhl
2026-09-09 15:47 ` [PATCH v7 20/20] drm/xe/vsec: Refactor platform check Michael J. Ruhl
2026-09-09 15:56 ` ✗ CI.checkpatch: warning for Crescent Island PMT support (rev9) Patchwork
2026-09-09 15:57 ` ✗ CI.KUnit: failure " Patchwork
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=20260909160801.60CE71F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=michael.j.ruhl@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox