[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231102101642.52988-1-chentao@kylinos.cn>
Date: Thu, 2 Nov 2023 18:16:42 +0800
From: chentao <chentao@...inos.cn>
To: jani.nikula@...ux.intel.com, joonas.lahtinen@...ux.intel.com,
rodrigo.vivi@...el.com, tvrtko.ursulin@...ux.intel.com,
airlied@...il.com, daniel@...ll.ch, andi.shyti@...ux.intel.com,
robdclark@...omium.org, jonathan.cavitt@...el.com,
andrzej.hajda@...el.com, chris.p.wilson@...el.com,
alan.previn.teres.alexis@...el.com
Cc: intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, kunwu.chan@...mail.com,
chentao <chentao@...inos.cn>
Subject: [PATCH] drm/i915: Fix potential spectre vulnerability
Fix smatch warning:
drivers/gpu/drm/i915/gem/i915_gem_context.c:847 set_proto_ctx_sseu()
warn: potential spectre issue 'pc->user_engines' [r] (local cap)
Signed-off-by: chentao <chentao@...inos.cn>
---
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 9a9ff84c90d7..b2fdfc7ca4de 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -843,7 +843,7 @@ static int set_proto_ctx_sseu(struct drm_i915_file_private *fpriv,
if (idx >= pc->num_user_engines)
return -EINVAL;
-
+ idx = array_index_nospec(idx, pc->num_user_engines);
pe = &pc->user_engines[idx];
/* Only render engine supports RPCS configuration. */
--
2.34.1
Powered by blists - more mailing lists