All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Linmao Li" <lilinmao@kylinos.cn>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/guc: Sort multi-lrc engines by logical instance
Date: Mon, 06 Jul 2026 11:26:10 +0000	[thread overview]
Message-ID: <20260706112611.460E81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706111328.618675-1-lilinmao@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [Critical] On failure to allocate a child request in multi_lrc_nop_request(), the already-submitted parent request (and possibly some child requests) are abandoned without waiting for them to complete. This leads to a Use-After-Free when the parent context is unpinned and freed by the caller.
--

commit 5b7b11cc22424a0209d44bac64a471f684e9959f
Author: Linmao Li <lilinmao@kylinos.cn>

drm/i915/guc: Sort multi-lrc engines by logical instance
    
This commit replaces a custom logical sorting loop with the standard sort()
function for multi-lrc engines. This fixes potential out-of-bounds stack
accesses and corrects the sorting logic to copy pointers rather than the
engine structure data.

> diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c
> index 28e8a092f4e7d..b56768d202b06 100644
> --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c

[ ... ]

While reviewing this code, I noticed a pre-existing issue in the same file:

drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c:multi_lrc_nop_request()
> 		child_rq = intel_context_create_request(child);
> 		if (IS_ERR(child_rq))
> 			goto child_error;

[Severity: Critical]
This is a pre-existing issue, but does this error path leave earlier parent
or child requests in flight without waiting for them to complete?

If so, when the caller __intel_guc_multi_lrc_basic() receives this error:

drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c:__intel_guc_multi_lrc_basic()
> out:
> 	multi_lrc_context_unpin(parent);
> 	multi_lrc_context_put(parent);

Could this lead to a use-after-free? The caller forces the unpin and drops
the final creation reference to the context while the stranded in-flight
requests still hold dangling pointers to it.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260706111328.618675-1-lilinmao@kylinos.cn?part=1

  reply	other threads:[~2026-07-06 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 11:13 [PATCH] drm/i915/guc: Sort multi-lrc engines by logical instance Linmao Li
2026-07-06 11:26 ` sashiko-bot [this message]
2026-07-06 14:31 ` ✗ i915.CI.BAT: failure for " 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=20260706112611.460E81F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lilinmao@kylinos.cn \
    --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.