From: Yu Liao liaoyu15@huawei.com
Yu Liao (1): drm/amd/display: fix mixed declarations warning
winstang (1): drm/amd/display: added NULL check at start of dc_validate_stream
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/12605 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/G...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/12605 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/G...
From: winstang winstang@amd.com
mainline inclusion from mainline-v6.11-rc1 commit 26c56049cc4f1705b498df013949427692a4b0d5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9N4 CVE: CVE-2024-46802
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
[Why] prevent invalid memory access
[How] check if dc and stream are NULL
Co-authored-by: winstang winstang@amd.com Reviewed-by: Alvin Lee alvin.lee2@amd.com Acked-by: Zaeem Mohamed zaeem.mohamed@amd.com Signed-off-by: winstang winstang@amd.com Tested-by: Daniel Wheeler daniel.wheeler@amd.com Signed-off-by: Alex Deucher alexander.deucher@amd.com Signed-off-by: Yu Liao liaoyu15@huawei.com --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 0a13c06eea44..6a993cdb101e 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2914,6 +2914,9 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
enum dc_status dc_validate_stream(struct dc *dc, struct dc_stream_state *stream) { + if (dc == NULL || stream == NULL) + return DC_ERROR_UNEXPECTED; + struct dc_link *link = stream->link; struct timing_generator *tg = dc->res_pool->timing_generators[0]; enum dc_status res = DC_OK;
From: Yu Liao liaoyu15@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9N4 CVE: CVE-2024-46802
--------------------------------
The previous commit introduce a compile warning: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c: In function ‘dc_validate_stream’: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:2920:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] struct dc_link *link = stream->link; ^~~~~~
Fix this by moving those declarations before code.
Fixes: d61f7961de27 ("drm/amd/display: added NULL check at start of dc_validate_stream") Signed-off-by: Yu Liao liaoyu15@huawei.com --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 6a993cdb101e..233edabc97d4 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2914,12 +2914,15 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,
enum dc_status dc_validate_stream(struct dc *dc, struct dc_stream_state *stream) { + struct dc_link *link; + struct timing_generator *tg; + enum dc_status res = DC_OK; + if (dc == NULL || stream == NULL) return DC_ERROR_UNEXPECTED;
- struct dc_link *link = stream->link; - struct timing_generator *tg = dc->res_pool->timing_generators[0]; - enum dc_status res = DC_OK; + link = stream->link; + tg = dc->res_pool->timing_generators[0];
calculate_phy_pix_clks(stream);