From: Greg Kroah-Hartman Date: Mon, 26 Feb 2024 15:26:04 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v4.19.308~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1de94dd0493773c3787b79efd77c9d06f770f7bc;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: drm-amd-display-avoid-enum-conversion-warning.patch drm-amd-display-fix-buffer-overflow-in-get_host_router_total_dp_tunnel_bw.patch revert-drm-amd-display-increased-min_dcfclk_mhz-and-min_fclk_mhz.patch smb3-add-missing-null-server-pointer-check.patch --- diff --git a/queue-6.6/drm-amd-display-avoid-enum-conversion-warning.patch b/queue-6.6/drm-amd-display-avoid-enum-conversion-warning.patch new file mode 100644 index 00000000000..d3124e8dcad --- /dev/null +++ b/queue-6.6/drm-amd-display-avoid-enum-conversion-warning.patch @@ -0,0 +1,44 @@ +From d7643fe6fb76edb1f2f1497bf5e8b8f4774b5129 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Wed, 10 Jan 2024 13:46:47 -0700 +Subject: drm/amd/display: Avoid enum conversion warning + +From: Nathan Chancellor + +commit d7643fe6fb76edb1f2f1497bf5e8b8f4774b5129 upstream. + +Clang warns (or errors with CONFIG_WERROR=y) when performing arithmetic +with different enumerated types, which is usually a bug: + + drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_dpia_bw.c:548:24: error: arithmetic between different enumeration types ('const enum dc_link_rate' and 'const enum dc_lane_count') [-Werror,-Wenum-enum-conversion] + 548 | link_cap->link_rate * link_cap->lane_count * LINK_RATE_REF_FREQ_IN_KHZ * 8; + | ~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~ + 1 error generated. + +In this case, there is not a problem because the enumerated types are +basically treated as '#define' values. Add an explicit cast to an +integral type to silence the warning. + +Closes: https://github.com/ClangBuiltLinux/linux/issues/1976 +Fixes: 5f3bce13266e ("drm/amd/display: Request usb4 bw for mst streams") +Signed-off-by: Nathan Chancellor +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c ++++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +@@ -544,8 +544,9 @@ int link_dp_dpia_get_dp_overhead_in_dp_t + */ + const struct dc_link_settings *link_cap = + dc_link_get_link_cap(link); +- uint32_t link_bw_in_kbps = +- link_cap->link_rate * link_cap->lane_count * LINK_RATE_REF_FREQ_IN_KHZ * 8; ++ uint32_t link_bw_in_kbps = (uint32_t)link_cap->link_rate * ++ (uint32_t)link_cap->lane_count * ++ LINK_RATE_REF_FREQ_IN_KHZ * 8; + link_mst_overhead = (link_bw_in_kbps / 64) + ((link_bw_in_kbps % 64) ? 1 : 0); + } + diff --git a/queue-6.6/drm-amd-display-fix-buffer-overflow-in-get_host_router_total_dp_tunnel_bw.patch b/queue-6.6/drm-amd-display-fix-buffer-overflow-in-get_host_router_total_dp_tunnel_bw.patch new file mode 100644 index 00000000000..dd9158c64cb --- /dev/null +++ b/queue-6.6/drm-amd-display-fix-buffer-overflow-in-get_host_router_total_dp_tunnel_bw.patch @@ -0,0 +1,50 @@ +From 97cba232549b9fe7e491fb60a69cf93075015f29 Mon Sep 17 00:00:00 2001 +From: Srinivasan Shanmugam +Date: Mon, 29 Jan 2024 21:17:09 +0530 +Subject: drm/amd/display: Fix buffer overflow in 'get_host_router_total_dp_tunnel_bw()' + +From: Srinivasan Shanmugam + +commit 97cba232549b9fe7e491fb60a69cf93075015f29 upstream. + +The error message buffer overflow 'dc->links' 12 <= 12 suggests that the +code is trying to access an element of the dc->links array that is +beyond its bounds. In C, arrays are zero-indexed, so an array with 12 +elements has valid indices from 0 to 11. Trying to access dc->links[12] +would be an attempt to access the 13th element of a 12-element array, +which is a buffer overflow. + +To fix this, ensure that the loop does not go beyond the last valid +index when accessing dc->links[i + 1] by subtracting 1 from the loop +condition. + +This would ensure that i + 1 is always a valid index in the array. + +Fixes the below: +drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_dpia_bw.c:208 get_host_router_total_dp_tunnel_bw() error: buffer overflow 'dc->links' 12 <= 12 + +Fixes: 59f1622a5f05 ("drm/amd/display: Add dpia display mode validation logic") +Cc: PeiChen Huang +Cc: Aric Cyr +Cc: Rodrigo Siqueira +Cc: Aurabindo Pillai +Cc: Meenakshikumar Somasundaram +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Tom Chung +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c ++++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c +@@ -196,7 +196,7 @@ static int get_host_router_total_dp_tunn + struct dc_link *link_dpia_primary, *link_dpia_secondary; + int total_bw = 0; + +- for (uint8_t i = 0; i < MAX_PIPES * 2; ++i) { ++ for (uint8_t i = 0; i < (MAX_PIPES * 2) - 1; ++i) { + + if (!dc->links[i] || dc->links[i]->ep_type != DISPLAY_ENDPOINT_USB4_DPIA) + continue; diff --git a/queue-6.6/revert-drm-amd-display-increased-min_dcfclk_mhz-and-min_fclk_mhz.patch b/queue-6.6/revert-drm-amd-display-increased-min_dcfclk_mhz-and-min_fclk_mhz.patch new file mode 100644 index 00000000000..a7aec6fc29b --- /dev/null +++ b/queue-6.6/revert-drm-amd-display-increased-min_dcfclk_mhz-and-min_fclk_mhz.patch @@ -0,0 +1,38 @@ +From a538dabf772c169641e151834e161e241802ab33 Mon Sep 17 00:00:00 2001 +From: Sohaib Nadeem +Date: Mon, 29 Jan 2024 17:33:40 -0500 +Subject: Revert "drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz" + +From: Sohaib Nadeem + +commit a538dabf772c169641e151834e161e241802ab33 upstream. + +[why]: +This reverts commit 2ff33c759a4247c84ec0b7815f1f223e155ba82a. + +The commit caused corruption when running some applications in fullscreen + +Cc: Mario Limonciello +Cc: Alex Deucher +Cc: stable@vger.kernel.org +Reviewed-by: Alvin Lee +Acked-by: Aurabindo Pillai +Signed-off-by: Sohaib Nadeem +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +@@ -2452,7 +2452,7 @@ static int build_synthetic_soc_states(bo + struct _vcs_dpi_voltage_scaling_st entry = {0}; + struct clk_limit_table_entry max_clk_data = {0}; + +- unsigned int min_dcfclk_mhz = 399, min_fclk_mhz = 599; ++ unsigned int min_dcfclk_mhz = 199, min_fclk_mhz = 299; + + static const unsigned int num_dcfclk_stas = 5; + unsigned int dcfclk_sta_targets[DC__VOLTAGE_STATES] = {199, 615, 906, 1324, 1564}; diff --git a/queue-6.6/series b/queue-6.6/series index d1ad72ddaf3..eccd42d80cc 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -202,3 +202,7 @@ selftests-mptcp-diag-check-currestab-counters.patch selftests-mptcp-diag-fix-bash-warnings-on-older-kernels.patch selftests-mptcp-diag-unique-in-use-subtest-names.patch selftests-mptcp-diag-unique-cestab-subtest-names.patch +smb3-add-missing-null-server-pointer-check.patch +drm-amd-display-avoid-enum-conversion-warning.patch +drm-amd-display-fix-buffer-overflow-in-get_host_router_total_dp_tunnel_bw.patch +revert-drm-amd-display-increased-min_dcfclk_mhz-and-min_fclk_mhz.patch diff --git a/queue-6.6/smb3-add-missing-null-server-pointer-check.patch b/queue-6.6/smb3-add-missing-null-server-pointer-check.patch new file mode 100644 index 00000000000..4ebef988a1e --- /dev/null +++ b/queue-6.6/smb3-add-missing-null-server-pointer-check.patch @@ -0,0 +1,34 @@ +From 45be0882c5f91e1b92e645001dd1a53b3bd58c97 Mon Sep 17 00:00:00 2001 +From: Steve French +Date: Mon, 5 Feb 2024 14:43:17 -0600 +Subject: smb3: add missing null server pointer check + +From: Steve French + +commit 45be0882c5f91e1b92e645001dd1a53b3bd58c97 upstream. + +Address static checker warning in cifs_ses_get_chan_index(): + warn: variable dereferenced before check 'server' +To be consistent, and reduce risk, we should add another check +for null server pointer. + +Fixes: 88675b22d34e ("cifs: do not search for channel if server is terminating") +Reported-by: Dan Carpenter +Reviewed-by: Shyam Prasad N +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/smb/client/sess.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/smb/client/sess.c ++++ b/fs/smb/client/sess.c +@@ -76,7 +76,7 @@ cifs_ses_get_chan_index(struct cifs_ses + unsigned int i; + + /* if the channel is waiting for termination */ +- if (server->terminate) ++ if (server && server->terminate) + return CIFS_INVAL_CHAN_INDEX; + + for (i = 0; i < ses->chan_count; i++) {