]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/display: Fix slab-use-after-free on hdcp_work
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 28 Feb 2025 19:18:14 +0000 (13:18 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 10 Mar 2025 18:16:42 +0000 (14:16 -0400)
[Why]
A slab-use-after-free is reported when HDCP is destroyed but the
property_validate_dwork queue is still running.

[How]
Cancel the delayed work when destroying workqueue.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4006
Fixes: da3fd7ac0bcf ("drm/amd/display: Update CP property based on HW query")
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 725a04ba5a95e89c89633d4322430cfbca7ce128)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

index e339c7a8d541c962aa44ae25ad97b864285394b8..c0dc23244049089f0416a58a115f3fa78d237de9 100644 (file)
@@ -455,6 +455,7 @@ void hdcp_destroy(struct kobject *kobj, struct hdcp_workqueue *hdcp_work)
        for (i = 0; i < hdcp_work->max_link; i++) {
                cancel_delayed_work_sync(&hdcp_work[i].callback_dwork);
                cancel_delayed_work_sync(&hdcp_work[i].watchdog_timer_dwork);
+               cancel_delayed_work_sync(&hdcp_work[i].property_validate_dwork);
        }
 
        sysfs_remove_bin_file(kobj, &hdcp_work[0].attr);