From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C28FB450414; Thu, 30 Jul 2026 16:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427619; cv=none; b=Xu3MCWWSZ8xuKbTFCwYTHmkEFVWRohwTwoE17mgUyjWdx4T0l92qNy20CPY88sbYraxzVrUuBtiFOPgR+RjMt/HNV9ix6C2Uz43C/0fus3K+T5mithhe6rDG/J/yUJfgns3O4qtnMaEwuA7ZTHUJW1wwqxlIEVkZ3SMNjJnsGWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427619; c=relaxed/simple; bh=ZHm8VOnOuKK98SrBmkbOoOn2JDfOqEA/mlNoiQc2U4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=my3K9tkN1Vl2GCIpzmrOdUoencv3GZSbq2jrpHemGvUQlMdJgx58LbBE1JmYZhykiBgQD+Srh8ev15ZoB68q0aIe53d2uTkLxLsh2hdU/FCxdR3Cs2MxEU/RPjKFDHV9qUyTM+/M5a+Jg4iO3k1t4POeUb5bvcPLECa5BqSczC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=twArHR2d; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="twArHR2d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 250631F000E9; Thu, 30 Jul 2026 16:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785427618; bh=TM9gW0Pmu2+p2sDf1FQAyi5Vj3HL9DywZ38nXqS3au4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=twArHR2d2wzrWaRdtEX9Xi5DSjQEjoNxJ/rEd+rlKGHiB/gNTOu8xZvYDFrqAUdSf BHYeQmzyaVla2dcBQqjT/nSMHj/6zBY1apdPEfdO9K59nuVs3Cs+FvD83HYwUmswI2 PV2flp4ewrc2QesFIZm5VjJJmZU9PqdZmNmlAwfs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Martin Hodo , Faith Ekstrand , Simona Vetter , Tvrtko Ursulin , Maarten Lankhorst , Joonas Lahtinen , Andi Shyti , Rodrigo Vivi Subject: [PATCH 6.6 227/484] drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU Date: Thu, 30 Jul 2026 16:12:04 +0200 Message-ID: <20260730141428.406794385@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141423.392222816@linuxfoundation.org> References: <20260730141423.392222816@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joonas Lahtinen commit 2b56757a9a7456825eb668fde92299e01c5e2721 upstream. 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 Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)") Cc: Faith Ekstrand Cc: Simona Vetter Cc: Tvrtko Ursulin Cc: Maarten Lankhorst Cc: # v5.15+ Signed-off-by: Joonas Lahtinen Reviewed-by: Maarten Lankhorst Reviewed-by: Andi Shyti Link: https://patch.msgid.link/20260701075555.52142-1-joonas.lahtinen@linux.intel.com (cherry picked from commit 36eda5b5c2d40da41cc0a5403c26986237cf9e87) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c @@ -855,7 +855,7 @@ static int set_proto_ctx_sseu(struct drm 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;