Skip to content

Commit 1a8e9ba

Browse files
KunWuChanjnikula
authored andcommitted
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) Fixes: d4433c7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)") Cc: <[email protected]> # v5.15+ Signed-off-by: Kunwu Chan <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Signed-off-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 27b0863) Signed-off-by: Jani Nikula <[email protected]>
1 parent 0cb89cd commit 1a8e9ba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ static int set_proto_ctx_sseu(struct drm_i915_file_private *fpriv,
844844
if (idx >= pc->num_user_engines)
845845
return -EINVAL;
846846

847+
idx = array_index_nospec(idx, pc->num_user_engines);
847848
pe = &pc->user_engines[idx];
848849

849850
/* Only render engine supports RPCS configuration. */

0 commit comments

Comments
 (0)