drm/i915/guc: prevent a possible int overflow in wq offsets
authorjsg <jsg@openbsd.org>
Thu, 19 Sep 2024 04:26:25 +0000 (04:26 +0000)
committerjsg <jsg@openbsd.org>
Thu, 19 Sep 2024 04:26:25 +0000 (04:26 +0000)
From Nikita Zhandarovich
86238603c8f4df09b2a926617511310fd550737c in linux-6.6.y/6.6.52
d3d37f74683e2f16f2635ee265884f7ca69350ae in mainline linux

sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c

index 2c9de9a..875dfa5 100644 (file)
@@ -2695,9 +2695,9 @@ static void prepare_context_registration_info_v70(struct intel_context *ce,
                ce->parallel.guc.wqi_tail = 0;
                ce->parallel.guc.wqi_head = 0;
 
-               wq_desc_offset = i915_ggtt_offset(ce->state) +
+               wq_desc_offset = (u64)i915_ggtt_offset(ce->state) +
                                 __get_parent_scratch_offset(ce);
-               wq_base_offset = i915_ggtt_offset(ce->state) +
+               wq_base_offset = (u64)i915_ggtt_offset(ce->state) +
                                 __get_wq_offset(ce);
                info->wq_desc_lo = lower_32_bits(wq_desc_offset);
                info->wq_desc_hi = upper_32_bits(wq_desc_offset);