]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Oct 2025 13:33:58 +0000 (15:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Oct 2025 13:33:58 +0000 (15:33 +0200)
added patches:
drm-amd-display-fix-potential-null-dereference.patch
drm-amd-display-remove-redundant-safeguards-for-dmub-srv-destroy.patch

queue-5.10/drm-amd-display-fix-potential-null-dereference.patch [new file with mode: 0644]
queue-5.10/drm-amd-display-remove-redundant-safeguards-for-dmub-srv-destroy.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/drm-amd-display-fix-potential-null-dereference.patch b/queue-5.10/drm-amd-display-fix-potential-null-dereference.patch
new file mode 100644 (file)
index 0000000..6177b7b
--- /dev/null
@@ -0,0 +1,38 @@
+From 52f1783ff4146344342422c1cd94fcb4ce39b6fe Mon Sep 17 00:00:00 2001
+From: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
+Date: Mon, 3 Apr 2023 16:10:37 +0300
+Subject: drm/amd/display: Fix potential null dereference
+
+From: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
+
+commit 52f1783ff4146344342422c1cd94fcb4ce39b6fe upstream.
+
+The adev->dm.dc pointer can be NULL and dereferenced in amdgpu_dm_fini()
+without checking.
+
+Add a NULL pointer check before calling dc_dmub_srv_destroy().
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: 9a71c7d31734 ("drm/amd/display: Register DMUB service with DC")
+Signed-off-by: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
+Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Eslam Khafagy <eslam.medhat1993@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -1142,7 +1142,8 @@ static void amdgpu_dm_fini(struct amdgpu
+               dc_deinit_callbacks(adev->dm.dc);
+ #endif
+-      dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
++      if (adev->dm.dc)
++              dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
+       if (adev->dm.dmub_bo)
+               amdgpu_bo_free_kernel(&adev->dm.dmub_bo,
diff --git a/queue-5.10/drm-amd-display-remove-redundant-safeguards-for-dmub-srv-destroy.patch b/queue-5.10/drm-amd-display-remove-redundant-safeguards-for-dmub-srv-destroy.patch
new file mode 100644 (file)
index 0000000..5ed63ad
--- /dev/null
@@ -0,0 +1,43 @@
+From 3beac533b8daa18358dabbe5059c417d192b2a93 Mon Sep 17 00:00:00 2001
+From: Roman Li <roman.li@amd.com>
+Date: Mon, 10 May 2021 11:29:29 -0400
+Subject: drm/amd/display: Remove redundant safeguards for dmub-srv destroy()
+
+From: Roman Li <roman.li@amd.com>
+
+commit 3beac533b8daa18358dabbe5059c417d192b2a93 upstream.
+
+[Why]
+dc_dmub_srv_destroy() has internal null-check and null assignment.
+No need to duplicate them externally.
+
+[How]
+Remove redundant safeguards.
+
+Signed-off-by: Lang Yu <Lang.Yu@amd.com>
+Signed-off-by: Roman Li <roman.li@amd.com>
+Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
+Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
+Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Eslam Khafagy <eslam.medhat1993@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -1141,10 +1141,8 @@ static void amdgpu_dm_fini(struct amdgpu
+       if (adev->dm.dc)
+               dc_deinit_callbacks(adev->dm.dc);
+ #endif
+-      if (adev->dm.dc->ctx->dmub_srv) {
+-              dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
+-              adev->dm.dc->ctx->dmub_srv = NULL;
+-      }
++
++      dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
+       if (adev->dm.dmub_bo)
+               amdgpu_bo_free_kernel(&adev->dm.dmub_bo,
index a0b9d674814422159b886ab43144211849ab38df..78783cb2c8223a772c27775857e5a8aaaccd6e7b 100644 (file)
@@ -14,3 +14,5 @@ serial-stm32-allow-selecting-console-when-the-driver-is-module.patch
 staging-axis-fifo-fix-maximum-tx-packet-length-check.patch
 staging-axis-fifo-flush-rx-fifo-on-read-errors.patch
 driver-core-pm-set-power.no_callbacks-along-with-power.no_pm.patch
+drm-amd-display-remove-redundant-safeguards-for-dmub-srv-destroy.patch
+drm-amd-display-fix-potential-null-dereference.patch