summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-09-19 04:26:26 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-09-19 04:26:26 +0000
commit60fc3bcba144fa3cdd11b9d62731fd1069aac7c3 (patch)
tree9521258992e952adbbea164b82f4c1b948b223fe
parent9775e4adcf1578e3e50b0977eec3cd230bae9ec6 (diff)
drm/i915/guc: prevent a possible int overflow in wq offsets
From Nikita Zhandarovich 86238603c8f4df09b2a926617511310fd550737c in linux-6.6.y/6.6.52 d3d37f74683e2f16f2635ee265884f7ca69350ae in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c b/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
index 2c9de9a67e8..875dfa55395 100644
--- a/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
+++ b/sys/dev/pci/drm/i915/gt/uc/intel_guc_submission.c
@@ -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);