drm/i915: Fix potential spectre vulnerability
authorjsg <jsg@openbsd.org>
Thu, 30 Nov 2023 02:47:39 +0000 (02:47 +0000)
committerjsg <jsg@openbsd.org>
Thu, 30 Nov 2023 02:47:39 +0000 (02:47 +0000)
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

index 9271130..2057278 100644 (file)
@@ -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. */