Skip to content

Commit e7b8686

Browse files
committed
scsi: megaraid_sas: Fix for a potential deadlock
JIRA: https://issues.redhat.com/browse/RHEL-21980 CVE: CVE-2024-57807 This fixes a 'possible circular locking dependency detected' warning CPU0 CPU1 ---- ---- lock(&instance->reset_mutex); lock(&shost->scan_mutex); lock(&instance->reset_mutex); lock(&shost->scan_mutex); Fix this by temporarily releasing the reset_mutex. Signed-off-by: Tomas Henzl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Chandrakanth Patil <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> (cherry picked from commit 50740f4) Signed-off-by: Tomas Henzl <[email protected]>
1 parent 5150d3a commit e7b8686

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8905,8 +8905,11 @@ megasas_aen_polling(struct work_struct *work)
89058905
(ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL),
89068906
(ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL),
89078907
0);
8908-
if (sdev1)
8908+
if (sdev1) {
8909+
mutex_unlock(&instance->reset_mutex);
89098910
megasas_remove_scsi_device(sdev1);
8911+
mutex_lock(&instance->reset_mutex);
8912+
}
89108913

89118914
event_type = SCAN_VD_CHANNEL;
89128915
break;

0 commit comments

Comments
 (0)