lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 23 Sep 2022 16:52:30 -0400
From:   Hamza Mahfooz <hamza.mahfooz@....com>
To:     <linux-kernel@...r.kernel.org>
CC:     Hamza Mahfooz <hamza.mahfooz@....com>,
        Harry Wentland <harry.wentland@....com>,
        Leo Li <sunpeng.li@....com>,
        Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Nicholas Kazlauskas <nicholas.kazlauskas@....com>,
        Aurabindo Pillai <aurabindo.pillai@....com>,
        Roman Li <roman.li@....com>, Jude Shih <shenshih@....com>,
        Bhawanpreet Lakha <Bhawanpreet.Lakha@....com>,
        Wayne Lin <Wayne.Lin@....com>,
        Qingqing Zhuo <qingqing.zhuo@....com>,
        "Thomas Zimmermann" <tzimmermann@...e.de>,
        hersen wu <hersenxs.wu@....com>,
        "Fangzhi Zuo" <Jerry.Zuo@....com>, <amd-gfx@...ts.freedesktop.org>,
        <dri-devel@...ts.freedesktop.org>
Subject: [PATCH 3/3] drm/amd/display: fix a crash caused by hot plugging on certain MST hubs

Currently we aren't considering the mode_changed property of struct
drm_crtc_state, which can mean that we might not update the display when
it is otherwise necessary, and cause a crash. So, consider mode_changed
in is_content_protection_different().

Signed-off-by: Hamza Mahfooz <hamza.mahfooz@....com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 8d8788792f7d..78bd1a5099f1 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7222,9 +7222,11 @@ is_scaling_state_different(const struct dm_connector_state *dm_state,
 }
 
 #ifdef CONFIG_DRM_AMD_DC_HDCP
-static bool is_content_protection_different(struct drm_connector_state *state,
+static bool is_content_protection_different(const struct drm_crtc_state *crtc_state,
+					    struct drm_connector_state *state,
 					    const struct drm_connector_state *old_state,
-					    const struct drm_connector *connector, struct hdcp_workqueue *hdcp_w)
+					    const struct drm_connector *connector,
+					    struct hdcp_workqueue *hdcp_w)
 {
 	struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
 	struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state);
@@ -7289,7 +7291,9 @@ static bool is_content_protection_different(struct drm_connector_state *state,
 	 *		ENABLED -> ENABLED
 	 */
 	if (old_state->content_protection == state->content_protection)
-		return false;
+		return state->content_protection >=
+			DRM_MODE_CONTENT_PROTECTION_DESIRED &&
+			crtc_state && crtc_state->mode_changed;
 
 	/*
 	 * Handles:	UNDESIRED -> DESIRED
@@ -8171,7 +8175,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
 			continue;
 		}
 
-		if (is_content_protection_different(new_con_state,
+		if (is_content_protection_different(new_crtc_state,
+						    new_con_state,
 						    old_con_state,
 						    connector,
 						    adev->dm.hdcp_workqueue)) {
-- 
2.37.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ