mirror_ubuntu-kernels/drivers/gpu/drm/i915
Linus Torvalds fec4d42724 drm/i915/display: fix compiler warning about array overrun
intel_dp_check_mst_status() uses a 14-byte array to read the DPRX Event
Status Indicator data, but then passes that buffer at offset 10 off as
an argument to drm_dp_channel_eq_ok().

End result: there are only 4 bytes remaining of the buffer, yet
drm_dp_channel_eq_ok() wants a 6-byte buffer.  gcc-11 correctly warns
about this case:

  drivers/gpu/drm/i915/display/intel_dp.c: In function ‘intel_dp_check_mst_status’:
  drivers/gpu/drm/i915/display/intel_dp.c:3491:22: warning: ‘drm_dp_channel_eq_ok’ reading 6 bytes from a region of size 4 [-Wstringop-overread]
   3491 |                     !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
        |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/gpu/drm/i915/display/intel_dp.c:3491:22: note: referencing argument 1 of type ‘const u8 *’ {aka ‘const unsigned char *’}
  In file included from drivers/gpu/drm/i915/display/intel_dp.c:38:
  include/drm/drm_dp_helper.h:1466:6: note: in a call to function ‘drm_dp_channel_eq_ok’
   1466 | bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
        |      ^~~~~~~~~~~~~~~~~~~~
       6:14 elapsed

This commit just extends the original array by 2 zero-initialized bytes,
avoiding the warning.

There may be some underlying bug in here that caused this confusion, but
this is at least no worse than the existing situation that could use
random data off the stack.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-08 11:30:22 -07:00
..
display drm/i915/display: fix compiler warning about array overrun 2021-05-08 11:30:22 -07:00
gem Merge branch 'stable/for-linus-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-05-04 10:58:49 -07:00
gt drm for 5.13-rc1 2021-04-28 10:01:40 -07:00
gvt drm tegra-next + fixes for 5.13-rc1 2021-04-30 12:44:02 -07:00
selftests drm for 5.13-rc1 2021-04-28 10:01:40 -07:00
.gitignore
dma_resv_utils.c drm/i915/gem: Optimistically prune dma-resv from the shrinker. 2020-12-23 21:58:00 +00:00
dma_resv_utils.h drm/i915/gem: Optimistically prune dma-resv from the shrinker. 2020-12-23 21:58:00 +00:00
i915_active_types.h
i915_active.c drm/i915: make lockdep slightly happier about execbuf. 2021-03-24 11:51:38 +01:00
i915_active.h
i915_buddy.c drm/i915/buddy: document the unused header bits 2021-03-24 19:30:35 +01:00
i915_buddy.h drm/i915/buddy: document the unused header bits 2021-03-24 19:30:35 +01:00
i915_cmd_parser.c drm/i915: Move cmd parser pinning to execbuffer 2021-03-24 11:39:59 +01:00
i915_config.c
i915_debugfs_params.c
i915_debugfs_params.h
i915_debugfs.c Merge tag 'drm-intel-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 14:02:21 +10:00
i915_debugfs.h
i915_drv.c Merge tag 'drm-intel-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 14:02:21 +10:00
i915_drv.h i915: use io_mapping_map_user 2021-04-30 11:20:39 -07:00
i915_fixed.h
i915_gem_evict.c drm/i915/gem: Protect used framebuffers from casual eviction 2021-01-20 21:05:12 +00:00
i915_gem_gtt.c drm/i915: Finally remove obj->mm.lock. 2021-03-24 17:47:20 +01:00
i915_gem_gtt.h
i915_gem.c drm/i915: Finally remove obj->mm.lock. 2021-03-24 17:47:20 +01:00
i915_gem.h drm/i915: Use tasklet_unlock_spin_wait() in __tasklet_disable_sync_once() 2021-03-25 18:21:03 +01:00
i915_getparam.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
i915_globals.c
i915_globals.h
i915_gpu_error.c Merge drm/drm-next into drm-intel-next 2021-03-11 08:52:53 +02:00
i915_gpu_error.h drm/i915: Improve record of hung engines in error state 2020-11-09 11:59:43 +00:00
i915_ioc32.c
i915_ioc32.h
i915_irq.c drm/i915: Convert INTEL_GEN() to DISPLAY_VER() as appropriate in i915_irq.c 2021-03-23 16:41:19 -07:00
i915_irq.h drm/i915: Add plane vfuncs to enable/disable flip_done interrupt 2021-01-19 19:14:21 +02:00
i915_memcpy.c drm/i915: Move cmd parser pinning to execbuffer 2021-03-24 11:39:59 +01:00
i915_memcpy.h drm/i915: Move cmd parser pinning to execbuffer 2021-03-24 11:39:59 +01:00
i915_mitigations.c drm/i915: Allow the sysadmin to override security mitigations 2021-01-12 19:03:40 +02:00
i915_mitigations.h drm/i915: Allow the sysadmin to override security mitigations 2021-01-12 19:03:40 +02:00
i915_mm.c i915: fix remap_io_sg to verify the pgprot 2021-04-30 11:20:39 -07:00
i915_params.c drm/i915: Allow configuring default request expiry via modparam 2021-03-26 01:01:38 +01:00
i915_params.h drm/i915: Allow configuring default request expiry via modparam 2021-03-26 01:01:38 +01:00
i915_pci.c Merge tag 'drm-intel-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 14:02:21 +10:00
i915_perf_types.h i915/perf: Store a mask of valid OA formats for a platform 2021-02-09 13:26:29 +02:00
i915_perf.c drm/i915: Increase ww locking for perf. 2021-03-24 17:27:21 +01:00
i915_perf.h
i915_pmu.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
i915_pmu.h Merge tag 'drm-intel-gt-next-2021-01-14' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-01-15 15:03:36 +10:00
i915_priolist_types.h drm/i915: Remove I915_USER_PRIORITY_SHIFT 2021-03-24 19:30:34 +01:00
i915_pvinfo.h
i915_query.c
i915_query.h
i915_reg.h drm/i915: reserve stolen for LMEM region 2021-03-24 19:30:36 +01:00
i915_request.c drm/i915: Take request reference before arming the watchdog timer 2021-04-26 11:53:56 +03:00
i915_request.h Merge tag 'drm-intel-gt-next-2021-04-06' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 12:46:12 +10:00
i915_scatterlist.c
i915_scatterlist.h Merge tag 'drm-intel-gt-next-2020-11-12-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2020-11-13 15:01:57 +10:00
i915_scheduler_types.h drm/i915: Lift waiter/signaler iterators 2020-11-19 20:34:18 +00:00
i915_scheduler.c drm/i915: Remove I915_USER_PRIORITY_SHIFT 2021-03-24 19:30:34 +01:00
i915_scheduler.h drm/i915: Strip out internal priorities 2021-03-24 19:30:34 +01:00
i915_selftest.h drm/i915: Pin timeline map after first timeline pin, v4. 2021-03-24 11:39:46 +01:00
i915_suspend.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
i915_suspend.h
i915_sw_fence_work.c
i915_sw_fence_work.h
i915_sw_fence.c drm/i915: Encode fence specific waitqueue behaviour into the wait.flags 2020-12-16 20:59:56 +00:00
i915_sw_fence.h
i915_switcheroo.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
i915_switcheroo.h
i915_syncmap.c
i915_syncmap.h
i915_sysfs.c
i915_sysfs.h
i915_trace_points.c
i915_trace.h
i915_user_extensions.c
i915_user_extensions.h
i915_utils.c drm/i915: Wrap our timer_list.expires checking 2021-01-07 21:37:14 +00:00
i915_utils.h drm/i915: Wrap our timer_list.expires checking 2021-01-07 21:37:14 +00:00
i915_vgpu.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
i915_vgpu.h
i915_vma_types.h drm/i915: Add support for FBs requiring a POT stride alignment 2021-03-29 22:58:12 +03:00
i915_vma.c drm/i915: Use a single page table lock for each gtt. 2021-03-24 17:30:37 +01:00
i915_vma.h drm/i915: Take reservation lock around i915_vma_pin. 2021-03-24 17:27:20 +01:00
intel_device_info.c Merge tag 'drm-intel-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 14:02:21 +10:00
intel_device_info.h Merge tag 'drm-intel-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 14:02:21 +10:00
intel_dram.c drm/i915/display: support ddr5 mem types 2021-02-05 05:23:15 -08:00
intel_dram.h
intel_gvt.c drm/i915/gvt: Save/restore HW status to support GVT suspend/resume 2020-11-10 14:37:56 +08:00
intel_gvt.h drm/i915/gvt: Save/restore HW status to support GVT suspend/resume 2020-11-10 14:37:56 +08:00
intel_memory_region.c drm/i915: give stolen system memory its own class 2021-03-24 19:31:59 +01:00
intel_memory_region.h drm/i915: give stolen system memory its own class 2021-03-24 19:31:59 +01:00
intel_pch.c drm/i915/gen9_bc: Recognize TGP PCH + CML combos 2021-02-11 18:19:29 -05:00
intel_pch.h drm/i915/adl_s: Add PCH support 2021-01-26 07:10:44 -08:00
intel_pm.c drm for 5.13-rc1 2021-04-28 10:01:40 -07:00
intel_pm.h drm/i915: Check tgl+ SAGV watermarks properly 2021-03-03 14:24:20 +02:00
intel_runtime_pm.c drm/i915: Fix docbook header for __intel_runtime_pm_get_if_active() 2021-03-31 16:57:33 +03:00
intel_runtime_pm.h drm/i915: Fix the GT fence revocation runtime PM logic 2021-03-24 09:12:07 -04:00
intel_sideband.c drm/i915: remove last traces of I915_READ(), I915_WRITE() and POSTING_READ() 2020-12-02 17:29:46 +02:00
intel_sideband.h
intel_step.c drm/i915: rename i915_rev_steppings->intel_step_info 2021-03-29 14:56:26 +03:00
intel_step.h drm/i915: rename i915_rev_steppings->intel_step_info 2021-03-29 14:56:26 +03:00
intel_uncore.c drm/i915: Try to detect sudden loss of MMIO access 2021-02-12 18:44:44 -08:00
intel_uncore.h drm/i915: remove last traces of I915_READ(), I915_WRITE() and POSTING_READ() 2020-12-02 17:29:46 +02:00
intel_wakeref.c
intel_wakeref.h
intel_wopcm.c
intel_wopcm.h
Kconfig i915: use io_mapping_map_user 2021-04-30 11:20:39 -07:00
Kconfig.debug drm/i915: Restrict DRM_I915_DEBUG to developer builds 2021-02-08 16:56:36 -05:00
Kconfig.profile drm/i915: Fail too long user submissions by default 2021-03-26 01:01:27 +01:00
Kconfig.unstable
Makefile Merge tag 'drm-intel-next-2021-04-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2021-04-08 14:02:21 +10:00
TODO.txt drm/i915: add gem/gt TODO 2021-03-26 09:24:31 +01:00
vlv_suspend.c
vlv_suspend.h