From: sashiko-bot@kernel.org
To: "Tales A. Mendonça" <talesam@gmail.com>
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 1/3] drm/xe: Capture devcoredump on TLB invalidation timeout
Date: Thu, 13 Aug 2026 02:47:40 +0000 [thread overview]
Message-ID: <20260813024741.139A71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813023016.805573-2-talesam@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The asynchronous devcoredump capture work is never canceled if the driver unloads before it runs, leading to a Use-After-Free of `xe_device` and execution of unmapped module text.
--
--- Patch [1]: [PATCH v2 1/3] drm/xe: Capture devcoredump on TLB invalidation timeout ---
commit 32f12415ddea719f0004ff662a031ef828c48ba8
Author: Tales A. Mendonça <talesam@gmail.com>
drm/xe: Capture devcoredump on TLB invalidation timeout
This commit introduces a variant of xe_devcoredump() designed to capture
the GuC log and CT state on GTs for hangs that aren't tied to an exec queue
or job. It then hooks this up to the TLB invalidation timeout path to
diagnose GuC TLB invalidation ack stalls.
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/8678
> diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c
> index 5f2b90b18f97b..6bee8933f9578 100644
> --- a/drivers/gpu/drm/xe/xe_devcoredump.c
> +++ b/drivers/gpu/drm/xe/xe_devcoredump.c
> @@ -323,40 +318,44 @@ static void xe_devcoredump_deferred_snap_work(struct work_struct *work)
> }
>
> static void devcoredump_snapshot(struct xe_devcoredump *coredump,
> + struct xe_gt *gt,
> struct xe_exec_queue *q,
> struct xe_sched_job *job)
> {
[ ... ]
> - ss->gt = q->gt;
> + ss->gt = gt;
> INIT_WORK(&ss->work, xe_devcoredump_deferred_snap_work);
>
> /* keep going if fw fails as we still want to save the memory and SW data */
[ ... ]
> queue_work(system_dfl_wq, &ss->work);
[Severity: High]
This is a pre-existing issue, but is it possible for this work item to run
after the module is unloaded?
If the driver unbinds or the module unloads before this work executes, the
devm action xe_driver_devcoredump_fini() runs and calls dev_coredump_put().
Since the devcoredump device hasn't been created yet (which happens inside
the work via dev_coredumpm_timeout()), that function does nothing.
The xe_device memory is then freed by devres, and the module text may be
unmapped. When system_dfl_wq eventually executes
xe_devcoredump_deferred_snap_work(), could this result in a Use-After-Free
of the xe_device and a jump to unmapped module memory?
>
> dma_fence_end_signalling(cookie);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813023016.805573-1-talesam@gmail.com?part=1
next prev parent reply other threads:[~2026-08-13 2:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 2:30 [PATCH v2 0/3] drm/xe: fix GuC TLB invalidation ack stalls on ARL (Wa_22016122933) Tales A. Mendonça
2026-08-13 2:30 ` [PATCH v2 1/3] drm/xe: Capture devcoredump on TLB invalidation timeout Tales A. Mendonça
2026-08-13 2:47 ` sashiko-bot [this message]
2026-08-13 2:30 ` [PATCH v2 2/3] drm/xe: Log when a timed out TLB invalidation ack finally arrives Tales A. Mendonça
2026-08-13 2:30 ` [PATCH v2 3/3] drm/xe: Implement Wa_22016122933 Tales A. Mendonça
2026-08-13 2:47 ` sashiko-bot
2026-08-13 2:37 ` ✗ CI.checkpatch: warning for drm/xe: fix GuC TLB invalidation ack stalls on ARL (Wa_22016122933) Patchwork
2026-08-13 2:39 ` ✓ CI.KUnit: success " 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=20260813024741.139A71F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=talesam@gmail.com \
/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.