[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241209092514.506660-1-guocai.he.cn@windriver.com>
Date: Mon, 9 Dec 2024 17:25:14 +0800
From: guocai.he.cn@...driver.com
To: harry.wentland@....com, sunpeng.li@....com, alexander.deucher@....com,
christian.koenig@....com, Xinhui.Pan@....com, airlied@...ux.ie,
daniel@...ll.ch
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] drm/amd/display: Skip inactive planes within ModeSupportAndSystemConfiguration
From: Guocai He <guocai.he.cn@...driver.com>
commit a54f7e866cc73a4cb71b8b24bb568ba35c8969df upstream.
[Why]
Coverity reports Memory - illegal accesses.
[How]
Skip inactive planes.
Reviewed-by: Alex Hung <alex.hung@....com>
Acked-by: Tom Chung <chiahsuan.chung@....com>
Signed-off-by: Hersen Wu <hersenxs.wu@....com>
Tested-by: Daniel Wheeler <daniel.wheeler@....com>
Signed-off-by: Alex Deucher <alexander.deucher@....com>
Cherry-pick from a54f7e866cc73a4cb71b8b24bb568ba35c8969df
CVE-2024-46812
Signed-off-by: Guocai He <guocai.he.cn@...driver.com>
---
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
index 0fad15020c74..b5ce2a8f4f1c 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
@@ -892,6 +892,11 @@ void ModeSupportAndSystemConfiguration(struct display_mode_lib *mode_lib)
// Total Available Pipes Support Check
for (k = 0; k < mode_lib->vba.NumberOfActivePlanes; ++k) {
+ pipe_idx = get_pipe_idx(mode_lib, k);
+ if (pipe_idx == -1) {
+ ASSERT(0);
+ continue; // skip inactive planes
+ }
total_pipes += mode_lib->vba.DPPPerPlane[k];
}
ASSERT(total_pipes <= DC__NUM_DPP__MAX);
--
2.34.1
Powered by blists - more mailing lists