Fix array-index-out-of-bounds in intel_cmtg_disable()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 3 repliesIn review
- v11 patch 1 replySuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | drm/i915/display: Guard CMTG disable with intel_cmtg_is_allowed()drivers/ | +3 | 1 reply | |
| 2/2 | drm/i915/cmtg: Warn on invalid CMTG transcoder in intel_cmtg_disable()drivers/ | +3 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Suraj Kandpal |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] Fix array-index-out-of-bounds in intel_cmtg_disable()
intel_cmtg_disable() maps crtc_state->cpu_transcoder to a CMTG transcoder via to_cmtg_transcoder(), which only returns a valid transcoder for TRANSCODER_A/B. The disable call sites only checked the sticky crtc->cmtg.enabled flag, so during a big-joiner reconfiguration that moves the eDP across pipes intel_cmtg_disable() could be reached with a cpu_transcoder that does not map to a CMTG transcoder. That led to a negative register-array index (trans_offsets[-1]) and a UBSAN array-index-out-of-bounds splat.
v1 fixed this with a silent early return inside intel_cmtg_disable(). Following review feedback, v2 instead gates the call sites with intel_cmtg_is_allowed() (the actual fix) and keeps a drm_WARN_ON() inside intel_cmtg_disable() as a backstop that documents the invariant.
The patches are ordered so that the series stays splat-free at every step:
patch 1 prevents any invalid call from reaching intel_cmtg_disable(), and patch 2 then adds the drm_WARN_ON() that should never fire in normal operation.
Animesh Manna (2):
drm/i915/display: Guard CMTG disable with intel_cmtg_is_allowed() drm/i915/cmtg: Warn on invalid CMTG transcoder in intel_cmtg_disable()
drivers/gpu/drm/i915/display/intel_cmtg.c | 3 +++ drivers/gpu/drm/i915/display/intel_display.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.29.0