From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E96D4C43602 for ; Wed, 1 Jul 2026 07:56:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8723210E318; Wed, 1 Jul 2026 07:56:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="A0prOKV8"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A59F10E310; Wed, 1 Jul 2026 07:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782892589; x=1814428589; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cGLe2jx75wNr3SO1dAi4HYYNNyZgWcKZdidD0DgIzm4=; b=A0prOKV8F95obfmXL8e4Us8wvW9f7y+MFpgQUCsjWlDUPJqPMBuJoKb5 mts92D+cVGKlPn5lg2OkhNOPQNph7+RyPGVv/Ged2n2sgAl5Z8r5O4Ovr 4wwoTo15RruY/IPSwlH75iAtgfJNy/llre30t5M/Szn3KqktutojjcLLr O+LIiwedGhohl/qZ5hnCQjXxlExExN1wDqvpuwct8I0Y/Ie/J0ggqrUrZ IjH9rFwnguRgnxc0Z6G0Lt8SB1Nuq6YyCoPyYhEix5Z9M1740kGZUrjwP re2WCTBNTmv/xvTHILJrd1KI+ocd/e7KTUX6Rip6lDp/ZHLwlNt+mKioR w==; X-CSE-ConnectionGUID: 0HM1AzMnQkqOk2EbPTGIIw== X-CSE-MsgGUID: 84zq3rZ6T+WPss2xz3nGvQ== X-IronPort-AV: E=McAfee;i="6800,10657,11833"; a="83489029" X-IronPort-AV: E=Sophos;i="6.24,235,1774335600"; d="scan'208";a="83489029" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 00:56:29 -0700 X-CSE-ConnectionGUID: KrA5ud6sRq6dQjHeghZzPA== X-CSE-MsgGUID: VBlF5NDCSt+kGDq48pNYbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,235,1774335600"; d="scan'208";a="250783155" Received: from abityuts-desk.ger.corp.intel.com (HELO localhost) ([10.245.244.25]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 00:56:27 -0700 From: Joonas Lahtinen 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@vger.kernel.org Subject: [PATCH] drm/i915/gem: Fix NULL deref in I915_CONTEXT_PARAM_SSEU Date: Wed, 1 Jul 2026 10:55:55 +0300 Message-ID: <20260701075555.52142-1-joonas.lahtinen@linux.intel.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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