From 995354c8e016d5c109f34ab0b320a8ae2d19e773 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 30 Nov 2023 02:47:39 +0000 Subject: [PATCH] drm/i915: Fix potential spectre vulnerability From Kunwu Chan 07e94f204f38b0d36eb377b3cda088b4a8b6f9a2 in linux-6.1.y/6.1.64 1a8e9bad6ef563c28ab0f8619628d5511be55431 in mainline linux --- sys/dev/pci/drm/i915/gem/i915_gem_context.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_context.c b/sys/dev/pci/drm/i915/gem/i915_gem_context.c index 92711306e0b..2057278c2c5 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_context.c +++ b/sys/dev/pci/drm/i915/gem/i915_gem_context.c @@ -852,6 +852,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.20.1