From: Andi Shyti <andi.shyti@linux.intel.com>
To: Eugene Kobyak <eugene.kobyak@intel.com>
Cc: intel-gfx@lists.freedesktop.org, John.C.Harrison@intel.com,
andi.shyti@linux.intel.com
Subject: Re: [PATCH v3] drm/i915: Fixed NULL pointer dereference in capture_engine
Date: Thu, 28 Nov 2024 12:00:04 +0100 [thread overview]
Message-ID: <Z0hNNPLktl4e1haH@ashyti-mobl2.lan> (raw)
In-Reply-To: <etwgucaj4hu7buvrvzgxkhxjtl526qd6fdyfmxzsdacphrg667@nrd35hese3t5>
Hi,
On Mon, Nov 25, 2024 at 03:27:11PM +0000, Eugene Kobyak wrote:
> When the intel_context structure contains NULL,
> it raises a NULL pointer dereference error in drm_info().
>
> Fixes: e8a3319c31a1 ("drm/i915: Allow error capture without a request")
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12309
>
> Signed-off-by: Eugene Kobyak <eugene.kobyak@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gpu_error.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 135ded17334e..1c614c74c2cf 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -1643,9 +1643,16 @@ capture_engine(struct intel_engine_cs *engine,
> return NULL;
>
> intel_engine_get_hung_entity(engine, &ce, &rq);
> - if (rq && !i915_request_started(rq))
> - drm_info(&engine->gt->i915->drm, "Got hung context on %s with active request %lld:%lld [0x%04X] not yet started\n",
> - engine->name, rq->fence.context, rq->fence.seqno, ce->guc_id.id);
> + if (rq && !i915_request_started(rq)) {
> + char guc_id[9];
> + if (ce)
> + scnprintf(guc_id, sizeof(guc_id), "[0x%04X]", ce->guc_id.id);
> + else
> + scnprintf(guc_id, sizeof(guc_id), " ");
> +
> + drm_info(&engine->gt->i915->drm, "Got hung context on %s with active request %lld:%lld%s not yet started\n",
> + engine->name, rq->fence.context, rq->fence.seqno, guc_id);
> + }
I've discussed offline with Eugene this scenario and we tested
the cases when ce is NULL. I'm looking forward to your v4.
Thanks,
Andi
next prev parent reply other threads:[~2024-11-28 11:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 15:27 [PATCH v3] drm/i915: Fixed NULL pointer dereference in capture_engine Eugene Kobyak
2024-11-25 19:31 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fixed NULL pointer dereference in capture_engine (rev3) Patchwork
2024-11-25 19:49 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-25 22:33 ` ✗ i915.CI.Full: failure " Patchwork
2024-11-28 11:00 ` Andi Shyti [this message]
2024-11-28 12:57 ` [PATCH v3] drm/i915: Fixed NULL pointer dereference in capture_engine Jani Nikula
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=Z0hNNPLktl4e1haH@ashyti-mobl2.lan \
--to=andi.shyti@linux.intel.com \
--cc=John.C.Harrison@intel.com \
--cc=eugene.kobyak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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