All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU
@ 2026-07-01  7:55 Joonas Lahtinen
  2026-07-01  8:11 ` sashiko-bot
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Joonas Lahtinen @ 2026-07-01  7:55 UTC (permalink / raw)
  To: Intel graphics driver community testing & development
  Cc: Direct Rendering Infrastructure - Development, Joonas Lahtinen,
	Martin Hodo, Faith Ekstrand, Simona Vetter, Tvrtko Ursulin,
	Maarten Lankhorst, stable

Setting context engine slot N into I915_ENGINE_CLASS_INVALID /
I915_ENGINE_CLASS_INVALID_NONE and attempting to apply
I915_CONTEXT_PARAM_SSEU to the same slot N will deref NULL.
Fix that.

Discovered using AI-assisted static analysis confirmed by
Intel Product Security.

Reported-by: Martin Hodo <martin.hodo@intel.com>
Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
Cc: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: Simona Vetter <simona.vetter@ffwll.ch>
Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.15+
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index aeafe1742d30..347d1f2c05f5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -850,7 +850,7 @@ static int set_proto_ctx_sseu(struct drm_i915_file_private *fpriv,
 		pe = &pc->user_engines[idx];
 
 		/* Only render engine supports RPCS configuration. */
-		if (pe->engine->class != RENDER_CLASS)
+		if (!pe->engine || pe->engine->class != RENDER_CLASS)
 			return -EINVAL;
 
 		sseu = &pe->sseu;
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-07-03 12:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01  7:55 [PATCH] drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU Joonas Lahtinen
2026-07-01  8:11 ` sashiko-bot
2026-07-01  9:00 ` ✓ i915.CI.BAT: success for " Patchwork
2026-07-02 13:13   ` Joonas Lahtinen
2026-07-01 11:20 ` [PATCH] " Maarten Lankhorst
2026-07-01 15:03 ` Andi Shyti
2026-07-01 20:05 ` ✗ i915.CI.Full: failure for " Patchwork
2026-07-02 13:15   ` Joonas Lahtinen
2026-07-02 17:02 ` ✓ i915.CI.BAT: success for drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU (rev2) Patchwork
2026-07-03 12:00 ` ✗ i915.CI.Full: failure " Patchwork

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.