linux/drivers/gpu/drm
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
..
amd IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
arm drm/komeda: Fix bit check to import to value of proper type 2021-04-01 13:48:48 +01:00
armada drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
aspeed drm/gem: Move drm_gem_fb_prepare_fb() to GEM atomic helpers 2021-02-23 08:54:22 +01:00
ast drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
atmel-hlcdc drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
bochs drm/bochs: Remove references to struct drm_device.pdev 2021-01-06 15:42:55 +01:00
bridge A few fixes for the next merge window, with some build fixes for anx7625 2021-04-23 13:53:07 +10:00
etnaviv Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
exynos Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
fsl-dcu drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
gma500 gma500: Use DEFINE_SPINLOCK() for spinlock 2021-04-08 13:19:56 +02:00
gud drm/gud: Remove unneeded semicolon 2021-03-23 10:32:14 +01:00
hisilicon drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
i2c
i810
i915 drm/i915/display: fix compiler warning about array overrun 2021-05-08 11:30:22 -07:00
imx Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
ingenic drm/ingenic: Register devm action to cleanup encoders 2021-03-29 16:47:12 +01:00
kmb drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
lib
lima drm for 5.13-rc1 2021-04-28 10:01:40 -07:00
mcde drm/mcde/panel: Inverse misunderstood flag 2021-03-04 14:31:06 +01:00
mediatek Mediatek DRM Next for Linux 5.13 2021-04-08 12:42:14 +10:00
meson drm/meson: Fix few typo 2021-03-19 10:40:54 +01:00
mga drm/mga/mga_ioc32: Fix some formatting issues in 'mga_compat_ioctl's header 2021-01-18 15:41:12 +01:00
mgag200 drm/mgag200: Move vmap out of commit tail 2021-02-08 13:00:26 +01:00
msm IOMMU Updates for Linux v5.13 2021-05-01 09:33:00 -07:00
mxsfb drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
nouveau 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
omapdrm Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
panel Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
panfrost drm for 5.13-rc1 2021-04-28 10:01:40 -07:00
pl111 drm-misc-next for 5.13: 2021-03-16 17:08:46 +10:00
qxl treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
r128 drm/r128/r128_ioc32: Fix formatting issues in 'r128_compat_ioctl()'s header 2021-01-18 15:41:04 +01:00
radeon drm tegra-next + fixes for 5.13-rc1 2021-04-30 12:44:02 -07:00
rcar-du Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
rockchip drm/rockchip: Remove unused variable 2021-03-24 09:31:22 +01:00
savage
scheduler drm/amd/amdgpu implement tdr advanced mode 2021-04-09 16:45:45 -04:00
selftests
shmobile
sis
sti drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
stm drm/stm: dsi: Avoid printing errors for -EPROBE_DEFER 2021-03-08 15:06:56 +01:00
sun4i drm-misc-next for 5.13: 2021-03-16 17:08:46 +10:00
tdfx drm: Constify drm_driver in drivers that don't modify it 2021-01-05 07:20:36 +02:00
tegra drm/tegra: Changes for v5.13-rc1 2021-04-30 09:57:07 +10:00
tidss drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
tilcdc drm/tilcdc: fix pixel clock setting warning message 2021-03-24 12:05:28 +02:00
tiny drm-misc-next for 5.13: 2021-03-16 17:08:46 +10:00
ttm Two patches in drm-misc-next-fixes this week, one to fix the error 2021-04-30 10:13:48 +10:00
tve200 drm/gem: Move drm_gem_fb_prepare_fb() to GEM atomic helpers 2021-02-23 08:54:22 +01:00
udl drm-misc-next for 5.13: 2021-03-16 17:08:46 +10:00
v3d Revert "drm/scheduler: Job timeout handler returns status (v3)" 2021-02-10 15:26:00 +01:00
vboxvideo drm/vboxvideo: Use managed VRAM-helper initialization 2021-03-11 14:19:43 +01:00
vc4 Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
vgem drm/prime: split array import functions v4 2020-11-30 15:00:45 +01:00
via via/via_irq: use __func__ to replace string function name 2020-11-27 16:14:02 +01:00
virtio drm/virtio: fix possible leak/unlock virtio_gpu_object_array 2021-03-09 12:06:18 +01:00
vkms drm/vkms: fix misuse of WARN_ON 2021-03-25 08:23:28 -03:00
vmwgfx drm tegra-next + fixes for 5.13-rc1 2021-04-30 12:44:02 -07:00
xen Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
xlnx drm: xlnx: zynqmp: fix a memset in zynqmp_dp_train() 2021-04-08 12:52:10 +02:00
zte drm: Use state helper instead of the plane state pointer 2021-02-25 08:05:28 +01:00
drm_agpsupport.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_atomic_helper.c drm: Fix 3 typos in the inline doc 2021-03-26 11:46:33 +01:00
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_atomic.c drm/atomic: Couple of typo fixes 2021-04-09 16:42:09 -04:00
drm_auth.c
drm_blend.c drm/doc: introduce new section for standard plane properties 2020-12-17 16:56:40 +01:00
drm_bridge_connector.c
drm_bridge.c
drm_bufs.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_cache.c drm: Include <linux/mem_encrypt.h> in drm_cache.c 2021-01-14 09:42:31 +01:00
drm_client_modeset.c drm: replace drm_modeset_lock_all() in drm_client_modeset_dpms_legacy() 2021-02-09 17:16:57 +01:00
drm_client.c drm/client: Depend on GEM object kmap ref-counting 2020-11-24 09:27:54 +01:00
drm_color_mgmt.c drm: add legacy support for using degamma for gamma 2020-12-15 15:46:03 +02:00
drm_connector.c drm/uapi: Add USB connector type 2021-03-16 12:45:28 +01:00
drm_context.c
drm_crtc_helper_internal.h drm: remove drm_fb_helper_modinit 2021-02-08 12:20:38 +01:00
drm_crtc_helper.c
drm_crtc_internal.h
drm_crtc.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_damage_helper.c
drm_debugfs_crc.c
drm_debugfs.c
drm_displayid.c drm/displayid: rename displayid_hdr to displayid_header 2021-03-31 15:42:39 +03:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dp_helper: Define options for FRL training for HDMI2.1 PCON 2021-03-31 12:21:06 +03:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm/dp_mst: Drop DRM_ERROR() on kzalloc() fail in drm_dp_mst_handle_up_req() 2021-04-08 17:47:26 -04:00
drm_drv.c drm/drv: Remove initialization of static variables 2021-02-21 19:49:17 -05:00
drm_dsc.c drm/dsc: add helper for calculating rc buffer size from DPCD 2020-12-10 10:49:47 +02:00
drm_dumb_buffers.c drm: Don't export the drm_gem_dumb_destroy() function 2021-01-05 07:20:25 +02:00
drm_edid_load.c
drm_edid.c drm/edid: use the new displayid iterator for tile info 2021-03-31 15:42:02 +03:00
drm_encoder_slave.c
drm_encoder.c drm: add drmm_encoder_alloc() 2021-01-04 12:59:33 +01:00
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb-helper: only unmap if buffer not null 2021-03-11 11:08:14 +01:00
drm_file.c drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-02-24 21:05:54 +05:30
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_gem_atomic_helper.c drm/gem: Move drm_gem_fb_prepare_fb() to GEM atomic helpers 2021-02-23 08:54:22 +01:00
drm_gem_cma_helper.c drm/cma-helper: Implement mmap as GEM CMA object functions 2020-11-30 13:38:27 +01:00
drm_gem_framebuffer_helper.c drm/gem: Move drm_gem_fb_prepare_fb() to GEM atomic helpers 2021-02-23 08:54:22 +01:00
drm_gem_shmem_helper.c drm/shmem-helpers: vunmap: Don't put pages for dma-buf 2021-03-11 11:11:33 +01:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm-misc-next for 5.13: 2021-03-16 17:08:46 +10:00
drm_gem.c drm/gem: Export drm_gem_vmap() and drm_gem_vunmap() 2021-02-08 13:00:06 +01:00
drm_hashtab.c
drm_hdcp.c
drm_internal.h drm/drm_internal.h: Remove repeated struct declaration 2021-04-08 13:05:38 +02:00
drm_ioc32.c drm/compat: Clear bounce structures 2021-03-11 11:11:33 +01:00
drm_ioctl.c
drm_irq.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_kms_helper_common.c drm: remove drm_fb_helper_modinit 2021-02-08 12:20:38 +01:00
drm_lease.c
drm_legacy_misc.c
drm_legacy.h drm: Merge CONFIG_DRM_VM into CONFIG_DRM_LEGACY 2021-01-13 14:22:37 +01:00
drm_lock.c
drm_managed.c
drm_memory.c drm: Implement drm_need_swiotlb() in drm_cache.c 2021-01-13 14:22:29 +01:00
drm_mipi_dbi.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c drm-misc-next for v5.12: 2021-01-07 13:40:20 +01:00
drm_mode_object.c
drm_modes.c drm for 5.13-rc1 2021-04-28 10:01:40 -07:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel_orientation_quirks.c drm: Added orientation quirk for OneGX1 Pro 2021-01-20 22:33:01 +01:00
drm_panel.c
drm_pci.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_plane_helper.c
drm_plane.c drm-misc-next for 5.13: 2021-03-16 17:08:46 +10:00
drm_prime.c drm: Set vm_ops to GEM object's values during mmap 2021-01-18 10:37:26 +01:00
drm_print.c
drm_probe_helper.c drm/probe-helper: Check epoch counter in output_poll_execute() 2021-03-16 12:45:52 +01:00
drm_property.c drm: Few typo fixes 2021-03-18 14:22:50 +01:00
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/atomic: Pass the full state to planes atomic disable and update 2021-02-25 08:05:28 +01:00
drm_syncobj.c drm/syncobj: use newly allocated stub fences 2021-04-08 12:21:13 +02:00
drm_sysfs.c drm/sysfs: Convert sysfs sprintf/snprintf family to sysfs_emit 2021-03-23 07:41:39 -04:00
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c drm/vblank: Do not store a new vblank timestamp in drm_vblank_restore() 2021-04-01 20:29:17 +03:00
drm_vm.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_vma_manager.c
drm_writeback.c
Kconfig drm/radeon: fix AGP dependency 2021-03-23 23:25:21 -04:00
Makefile drm/displayid: add separate drm_displayid.c 2021-03-31 15:41:35 +03:00