linux/drivers/gpu/drm/i915/display
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
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
g4x_dp.c drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE 2021-03-23 16:36:42 -07:00
g4x_dp.h drm/i915: Give g4x_{dp,hdmi}.c g4x_ namespace 2021-03-19 18:31:49 +02:00
g4x_hdmi.c drm/i915: Give g4x_{dp,hdmi}.c g4x_ namespace 2021-03-19 18:31:49 +02:00
g4x_hdmi.h drm/i915: Give g4x_{dp,hdmi}.c g4x_ namespace 2021-03-19 18:31:49 +02:00
i9xx_plane.c drm/i915: Unify the FB and plane state view information into one struct 2021-03-29 22:58:11 +03:00
i9xx_plane.h drm/i915: migrate i9xx plane get config 2021-02-08 12:09:28 +02:00
icl_dsi.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_acpi.c drm/i915: Fix invalid access to ACPI _DSM objects 2021-04-07 19:07:44 -04:00
intel_acpi.h
intel_atomic_plane.c drm/i915: Fix enabled_planes bitmask 2021-03-23 08:27:03 -04:00
intel_atomic_plane.h drm/i915: Add bigjoiner aware plane clipping checks 2020-11-18 11:42:04 -08:00
intel_atomic.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_atomic.h drm/i915/dp: Add from_crtc_state to copy color blobs 2020-11-15 18:30:05 -08:00
intel_audio.c drm/i915/audio: set HDA link parameters in driver 2021-03-24 23:55:32 +05:30
intel_audio.h
intel_bios.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_bios.h drm/i915/bios: add intel_bios_encoder_data to encoder, use for iboost 2021-03-18 14:44:16 +02:00
intel_bw.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_bw.h
intel_cdclk.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_cdclk.h drm/i915: Nuke force_min_cdclk_changed 2020-09-17 20:10:21 +03:00
intel_color.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_color.h
intel_combo_phy.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_combo_phy.h
intel_connector.c drm/i915: Split intel_attach_colorspace_property() into HDMI vs. DP variants 2020-12-02 01:29:31 +05:30
intel_connector.h drm/i915: Split intel_attach_colorspace_property() into HDMI vs. DP variants 2020-12-02 01:29:31 +05:30
intel_crt.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_crt.h drm/i915: Remove repeated declaration 2021-03-29 12:39:35 -07:00
intel_crtc.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_crtc.h drm/i915: refactor some crtc code out of intel display. (v2) 2021-01-16 00:08:58 +02:00
intel_csr.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_csr.h
intel_cursor.c drm/i915: Unify the FB and plane state view information into one struct 2021-03-29 22:58:11 +03:00
intel_cursor.h drm/i915: refactor cursor code out of i915_display.c 2020-12-22 10:09:05 +02:00
intel_ddi_buf_trans.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_ddi_buf_trans.h drm/i915: refactor ddi translations into a separate file (v2) 2021-02-05 15:43:36 +02:00
intel_ddi.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_ddi.h drm/i915: Extend icl_sanitize_encoder_pll_mapping() to all DDI platforms 2021-03-08 18:39:54 +02:00
intel_de.h
intel_display_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
intel_display_debugfs.h drm/i915/display: Record the plane update times for debugging 2020-12-02 22:17:28 +00:00
intel_display_power.c drm/i915: rename DISP_STEPPING->DISPLAY_STEP and GT_STEPPING->GT_STEP 2021-03-29 14:56:17 +03:00
intel_display_power.h drm/i915/tgl+: Sanitize the DDI LANES/IO and AUX power domain names 2021-02-24 14:05:39 +02:00
intel_display_types.h drm/i915: Add support for FBs requiring a POT stride alignment 2021-03-29 22:58:12 +03:00
intel_display.c drm/i915: Restore lost glk ccs w/a 2021-04-26 11:54:08 +03:00
intel_display.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_dp_aux_backlight.c drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT 2021-04-12 08:00:24 -04:00
intel_dp_aux_backlight.h
intel_dp_aux.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_dp_aux.h drm/i915/dp: split out aux functionality to intel_dp_aux.c 2021-01-21 13:27:42 +02:00
intel_dp_hdcp.c drm/i915/hdcp: Add DP HDCP2.2 timeout to read entire msg 2021-03-31 14:27:24 +03:00
intel_dp_link_training.c drm tegra-next + fixes for 5.13-rc1 2021-04-30 12:44:02 -07:00
intel_dp_link_training.h drm/i915: Disable LTTPR support when the DPCD rev < 1.4 2021-03-23 08:26:55 -04:00
intel_dp_mst.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_dp_mst.h
intel_dp.c drm/i915/display: fix compiler warning about array overrun 2021-05-08 11:30:22 -07:00
intel_dp.h drm/i915: Introduce g4x_dp.c 2021-03-19 18:31:15 +02:00
intel_dpio_phy.c drm/i915: Plumb crtc_state to link training 2020-10-01 16:45:57 +03:00
intel_dpio_phy.h drm/i915: Plumb crtc_state to link training 2020-10-01 16:45:57 +03:00
intel_dpll_mgr.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_dpll_mgr.h drm/i915: Use pipes instead crtc indices in PLL state tracking 2021-03-08 18:38:21 +02:00
intel_dpll.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_dpll.h drm/i915: migrate pll enable/disable code to intel_dpll.[ch] 2021-02-08 12:03:34 +02:00
intel_dsb.c drm/i915: Add missing ww lock in intel_dsb_prepare. 2021-03-24 17:29:02 +01:00
intel_dsb.h
intel_dsi_dcs_backlight.c drm/i915: Pass port to intel_panel_bl_funcs.get() 2021-01-15 16:19:12 +02:00
intel_dsi_dcs_backlight.h
intel_dsi_vbt.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_dsi.c drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3. 2020-11-18 11:41:10 -08:00
intel_dsi.h drm/i915/dsi: Initiate frame request in cmd mode 2020-09-28 20:02:14 +03:00
intel_dvo_dev.h
intel_dvo.c drm/i915: remove last traces of I915_READ(), I915_WRITE() and POSTING_READ() 2020-12-02 17:29:46 +02:00
intel_dvo.h
intel_fb.c drm/i915: Add support for FBs requiring a POT stride alignment 2021-03-29 22:58:12 +03:00
intel_fb.h drm/i915: Simplify copying the FB view state to the plane state 2021-03-29 22:58:12 +03:00
intel_fbc.c drm/i915: Restore lost glk FBC 16bpp w/a 2021-04-26 11:54:03 +03:00
intel_fbc.h
intel_fbdev.c drm/i915: Pass ww ctx to intel_pin_to_display_plane 2021-03-24 17:27:20 +01:00
intel_fbdev.h
intel_fdi.c drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE 2021-03-23 16:36:42 -07:00
intel_fdi.h drm/i915: migrate hsw fdi code to new file. 2021-02-05 15:50:43 +02:00
intel_fifo_underrun.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_fifo_underrun.h
intel_frontbuffer.c Merge drm/drm-next into drm-intel-next 2021-03-11 08:52:53 +02:00
intel_frontbuffer.h
intel_global_state.c
intel_global_state.h
intel_gmbus.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_gmbus.h
intel_hdcp.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_hdcp.h drm/i915/hdcp: Pass dig_port to intel_hdcp_init 2021-01-13 08:29:32 +05:30
intel_hdmi.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_hdmi.h drm/i915: Introduce g4x_hdmi.c 2021-03-19 18:31:29 +02:00
intel_hotplug.c drm/i915: Refactor .hpd_irq_setup() calls a bit 2020-10-20 20:18:53 +03:00
intel_hotplug.h drm/i915: Reorder hpd init vs. display resume 2020-10-20 20:18:32 +03:00
intel_lpe_audio.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
intel_lpe_audio.h
intel_lspcon.c drm/i915/display: Implement DRM infoframe read for LSPCON 2020-12-02 01:29:52 +05:30
intel_lspcon.h drm/i915/display: Implement DRM infoframe read for LSPCON 2020-12-02 01:29:52 +05:30
intel_lvds.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_lvds.h
intel_opregion.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
intel_opregion.h
intel_overlay.c drm/i915: fix an error code in intel_overlay_do_put_image() 2021-04-26 11:54:27 +03:00
intel_overlay.h
intel_panel.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_panel.h drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now) 2021-01-19 12:35:52 -05:00
intel_pipe_crc.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_pipe_crc.h
intel_pps.c drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE 2021-03-23 16:36:42 -07:00
intel_pps.h drm/i915/pps: move pps code over from intel_display.c and refactor 2021-01-21 13:26:19 +02:00
intel_psr.c drm/i915/display/psr: Fix cppcheck warnings 2021-04-26 11:54:21 +03:00
intel_psr.h drm/i915/display: Support PSR Multiple Instances 2021-02-05 05:29:15 -08:00
intel_quirks.c drm/i915: Remove references to struct drm_device.pdev 2021-02-02 13:58:42 +02:00
intel_quirks.h
intel_sdvo_regs.h
intel_sdvo.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_sdvo.h
intel_sprite.c drm/i915: Unify the FB and plane state view information into one struct 2021-03-29 22:58:11 +03:00
intel_sprite.h drm/i915/intel_fb: Pull FB plane functions from intel_sprite.c 2021-03-29 22:54:50 +03:00
intel_tc.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_tc.h
intel_tv.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_tv.h
intel_vbt_defs.h drm/i915/vbt: update DP max link rate table 2021-02-20 12:16:38 +02:00
intel_vdsc.c drm/i915/display: Simplify GLK display version tests 2021-03-23 16:41:19 -07:00
intel_vdsc.h drm/i915/dp: Modify VDSC helpers to configure DSC for Bigjoiner slave 2020-11-18 11:41:10 -08:00
intel_vga.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
intel_vga.h
intel_vrr.c drm/i915: Fix vblank timestamps with VRR 2021-01-25 15:23:34 -08:00
intel_vrr.h drm/i915: Remove repeated declaration 2021-03-29 12:39:35 -07:00
skl_scaler.c drm/i915/display: Eliminate most usage of INTEL_GEN() 2021-03-23 16:41:11 -07:00
skl_scaler.h drm/i915: refactor skylake scaler code into new file. 2021-02-08 12:12:41 +02:00
skl_universal_plane.c drm/i915: Simplify copying the FB view state to the plane state 2021-03-29 22:58:12 +03:00
skl_universal_plane.h drm/i915/intel_fb: Pull FB plane functions from skl_universal_plane.c 2021-03-29 22:54:50 +03:00
vlv_dsi_pll.c
vlv_dsi.c drm for 5.13-rc1 2021-04-28 10:01:40 -07:00