]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Feb 2024 15:26:04 +0000 (16:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Feb 2024 15:26:04 +0000 (16:26 +0100)
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

queue-6.6/drm-amd-display-avoid-enum-conversion-warning.patch [new file with mode: 0644]
queue-6.6/drm-amd-display-fix-buffer-overflow-in-get_host_router_total_dp_tunnel_bw.patch [new file with mode: 0644]
queue-6.6/revert-drm-amd-display-increased-min_dcfclk_mhz-and-min_fclk_mhz.patch [new file with mode: 0644]
queue-6.6/series
queue-6.6/smb3-add-missing-null-server-pointer-check.patch [new file with mode: 0644]

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 (file)
index 0000000..d3124e8
--- /dev/null
@@ -0,0 +1,44 @@
+From d7643fe6fb76edb1f2f1497bf5e8b8f4774b5129 Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Wed, 10 Jan 2024 13:46:47 -0700
+Subject: drm/amd/display: Avoid enum conversion warning
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+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 <nathan@kernel.org>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..dd9158c
--- /dev/null
@@ -0,0 +1,50 @@
+From 97cba232549b9fe7e491fb60a69cf93075015f29 Mon Sep 17 00:00:00 2001
+From: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
+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 <srinivasan.shanmugam@amd.com>
+
+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 <peichen.huang@amd.com>
+Cc: Aric Cyr <aric.cyr@amd.com>
+Cc: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
+Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
+Cc: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>
+Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
+Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..a7aec6f
--- /dev/null
@@ -0,0 +1,38 @@
+From a538dabf772c169641e151834e161e241802ab33 Mon Sep 17 00:00:00 2001
+From: Sohaib Nadeem <sohaib.nadeem@amd.com>
+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 <sohaib.nadeem@amd.com>
+
+commit a538dabf772c169641e151834e161e241802ab33 upstream.
+
+[why]:
+This reverts commit 2ff33c759a4247c84ec0b7815f1f223e155ba82a.
+
+The commit caused corruption when running some applications in fullscreen
+
+Cc: Mario Limonciello <mario.limonciello@amd.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
+Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
+Signed-off-by: Sohaib Nadeem <sohaib.nadeem@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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};
index d1ad72ddaf3a950b8aa87a4b1799fc12c152703d..eccd42d80ccdd0842d91fea3a752b385ca1ce3e9 100644 (file)
@@ -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 (file)
index 0000000..4ebef98
--- /dev/null
@@ -0,0 +1,34 @@
+From 45be0882c5f91e1b92e645001dd1a53b3bd58c97 Mon Sep 17 00:00:00 2001
+From: Steve French <stfrench@microsoft.com>
+Date: Mon, 5 Feb 2024 14:43:17 -0600
+Subject: smb3: add missing null server pointer check
+
+From: Steve French <stfrench@microsoft.com>
+
+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 <dan.carpenter@linaro.org>
+Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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++) {