linux/drivers/gpu/drm/display
Imre Deak be826b4451 drm/dp_mst: Fix resetting msg rx state after topology removal
commit a6fa67d26d upstream.

If the MST topology is removed during the reception of an MST down reply
or MST up request sideband message, the
drm_dp_mst_topology_mgr::up_req_recv/down_rep_recv states could be reset
from one thread via drm_dp_mst_topology_mgr_set_mst(false), racing with
the reading/parsing of the message from another thread via
drm_dp_mst_handle_down_rep() or drm_dp_mst_handle_up_req(). The race is
possible since the reader/parser doesn't hold any lock while accessing
the reception state. This in turn can lead to a memory corruption in the
reader/parser as described by commit bd2fccac61 ("drm/dp_mst: Fix MST
sideband message body length check").

Fix the above by resetting the message reception state if needed before
reading/parsing a message. Another solution would be to hold the
drm_dp_mst_topology_mgr::lock for the whole duration of the message
reception/parsing in drm_dp_mst_handle_down_rep() and
drm_dp_mst_handle_up_req(), however this would require a bigger change.
Since the fix is also needed for stable, opting for the simpler solution
in this patch.

Cc: Lyude Paul <lyude@redhat.com>
Cc: <stable@vger.kernel.org>
Fixes: 1d082618bb ("drm/display/dp_mst: Fix down/up message handling after sink disconnect")
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13056
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241203160223.2926014-2-imre.deak@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-12-14 20:03:28 +01:00
..
drm_bridge_connector.c drm/bridge-connector: reset the HDMI connector state 2024-09-03 10:18:31 +02:00
drm_display_helper_mod.c drm/display: Introduce a DRM display-helper module 2022-04-25 11:19:21 +02:00
drm_dp_aux_bus.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
drm_dp_aux_dev.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
drm_dp_cec.c drm/cec: add drm_dp_cec_attach() as the non-edid version of set edid 2023-09-01 11:47:53 +03:00
drm_dp_dual_mode_helper.c drm/display: fix typo 2024-04-01 22:35:16 +03:00
drm_dp_helper.c drm/dp: Add helper to dump an LTTPR PHY descriptor 2024-07-11 20:56:26 +03:00
drm_dp_helper_internal.h drm/display: Make DisplayPort AUX Chardev Kconfig name consistent 2024-03-28 11:26:46 +01:00
drm_dp_mst_topology.c drm/dp_mst: Fix resetting msg rx state after topology removal 2024-12-14 20:03:28 +01:00
drm_dp_mst_topology_internal.h drm/dp_mst: avoid includes in drm_dp_mst_topology_internal.h 2024-03-11 11:47:06 +02:00
drm_dp_tunnel.c Core Changes (DRM): 2024-04-19 16:48:54 +10:00
drm_dsc_helper.c drm/display/dsc: Add a helper to dump the DSC configuration 2024-07-03 18:05:12 +03:00
drm_hdcp_helper.c drm/sysfs: rename drm_sysfs_connector_status_event() 2023-06-23 15:54:00 +02:00
drm_hdmi_helper.c drm/display: hdmi: Add HDMI compute clock helper 2024-05-28 10:12:25 +02:00
drm_hdmi_state_helper.c drm/connector: hdmi: Fix writing Dynamic Range Mastering infoframes 2024-09-24 16:10:12 +02:00
drm_scdc_helper.c drm/scdc-helper: Pimp SCDC debugs 2023-04-06 01:30:12 +03:00
Kconfig drm/bridge-connector: reset the HDMI connector state 2024-09-03 10:18:31 +02:00
Makefile drm/bridge-connector: move to DRM_DISPLAY_HELPER module 2024-09-03 10:18:31 +02:00