Skip to contentSkip to conversation

drm/amd/display: Fix NULL ptr deref for commit_planes_to_stream

PATCH In review Nicholas Kazlauskas 4 participants 4 messages Nov 30, 2018 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Fix NULL ptr deref for commit_planes_to_stream

[Why]
With scaling, underscan and abm changes we can end up calling commit_planes_to_stream in commit_tail. This call uses dm_state->context which can be NULL if the commit was a fast update.

[How]
Use dc_state instead since that can't be NULL unless the system ran out of memory.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108912

Fixes e64abff2f133 ("drm/amd/display: Use private obj helpers for dm_atomic_state")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 76b1aebdca0c..8ecd78657d43 100644
@@ -5011,7 +5011,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
 				status->plane_count,
 				dm_new_crtc_state,
 				to_dm_crtc_state(old_crtc_state),
-				dm_state->context))
+				dc_state))
 			dm_error("%s: Failed to update stream scaling!\n", __func__);
 	}
 
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181130150928.26420-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org

#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Nicholas Kazlauskas <[email protected]>
Sent: Friday, November 30, 2018 10:09:28 AM
To: [email protected]
Cc: Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Fix NULL ptr deref for commit_planes_to_stream

[Why]
With scaling, underscan and abm changes we can end up calling commit_planes_to_stream in commit_tail. This call uses dm_state->context which can be NULL if the commit was a fast update.

[How]
Use dc_state instead since that can't be NULL unless the system ran out of memory.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108912

Fixes e64abff2f133 ("drm/amd/display: Use private obj helpers for dm_atomic_state")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 76b1aebdca0c..8ecd78657d43 100644
@@ -5011,7 +5011,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
                                 status->plane_count,
                                 dm_new_crtc_state,
                                 to_dm_crtc_state(old_crtc_state),
-                               dm_state->context))
+                               dc_state))
                         dm_error("%s: Failed to update stream scaling!\n", __func__);
         }
 

--
2.17.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB18095A60473A856DEE992843F7D30-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Leo Li
#4 lore raw
Quoted 1 line · Alexander
Quoted 43 lines

------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Nicholas Kazlauskas <[email protected]>
*Sent:* Friday, November 30, 2018 10:09:28 AM
*To:* [email protected]
*Cc:* Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas *Subject:* [PATCH] drm/amd/display: Fix NULL ptr deref for commit_planes_to_stream
[Why]
With scaling, underscan and abm changes we can end up calling commit_planes_to_stream in commit_tail. This call uses dm_state->context which can be NULL if the commit was a fast update.

[How]
Use dc_state instead since that can't be NULL unless the system ran out of memory.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108912

Fixes e64abff2f133 ("drm/amd/display: Use private obj helpers for

dm_atomic_state")

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 76b1aebdca0c..8ecd78657d43 100644
@@ -5011,7 +5011,7 @@ static void amdgpu_dm_atomic_commit_tail(struct 
 drm_atomic_state *state)
                                  status->plane_count,
                                  dm_new_crtc_state,
                                  to_dm_crtc_state(old_crtc_state),
-                               dm_state->context))
+                               dc_state))
                          dm_error("%s: Failed to update stream 
 scaling!\n", __func__);
Quoted 9 lines

         }

Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Harry Wentland
#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Nicholas Kazlauskas

[Why]
With scaling, underscan and abm changes we can end up calling commit_planes_to_stream in commit_tail. This call uses dm_state->context which can be NULL if the commit was a fast update.

[How]
Use dc_state instead since that can't be NULL unless the system ran out of memory.

Quoted 6 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108912

Fixes e64abff2f133 ("drm/amd/display: Use private obj helpers for dm_atomic_state")

Harry

Quoted 10 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 76b1aebdca0c..8ecd78657d43 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · line 5017

Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -5011,7 +5011,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
 				status->plane_count,
 				dm_new_crtc_state,
 				to_dm_crtc_state(old_crtc_state),
-				dm_state->context))
+				dc_state))
 			dm_error("%s: Failed to update stream scaling!\n", __func__);
 	}
 

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx