# CVE-2024-42294: block: fix deadlock between sd\_remove & sd\_release

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-08-17T09:09:02.984Z
- **Modified:** 2026-06-17T07:49:11.880Z

## Who should check

- Anyone running Linux \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< 5a5625a83eac91fdff1d5f0202ecfc45a31983c9; \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< f5418f48a93b69ed9e6a2281eee06b412f14a544; \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< 7e04da2dc7013af50ed3a2beb698d5168d1e594b
- Anyone running Linux 6.5

## Description

In the Linux kernel, the following vulnerability has been resolved:

block: fix deadlock between sd\_remove & sd\_release

Our test report the following hung task:

\[ 2538.459400\] INFO: task "kworker/0:0":7 blocked for more than 188 seconds.
\[ 2538.459427\] Call trace:
\[ 2538.459430\]  \_\_switch\_to+0x174/0x338
\[ 2538.459436\]  \_\_schedule+0x628/0x9c4
\[ 2538.459442\]  schedule+0x7c/0xe8
\[ 2538.459447\]  schedule\_preempt\_disabled+0x24/0x40
\[ 2538.459453\]  \_\_mutex\_lock+0x3ec/0xf04
\[ 2538.459456\]  \_\_mutex\_lock\_slowpath+0x14/0x24
\[ 2538.459459\]  mutex\_lock+0x30/0xd8
\[ 2538.459462\]  del\_gendisk+0xdc/0x350
\[ 2538.459466\]  sd\_remove+0x30/0x60
\[ 2538.459470\]  device\_release\_driver\_internal+0x1c4/0x2c4
\[ 2538.459474\]  device\_release\_driver+0x18/0x28
\[ 2538.459478\]  bus\_remove\_device+0x15c/0x174
\[ 2538.459483\]  device\_del+0x1d0/0x358
\[ 2538.459488\]  \_\_scsi\_remove\_device+0xa8/0x198
\[ 2538.459493\]  scsi\_forget\_host+0x50/0x70
\[ 2538.459497\]  scsi\_remove\_host+0x80/0x180
\[ 2538.459502\]  usb\_stor\_disconnect+0x68/0xf4
\[ 2538.459506\]  usb\_unbind\_interface+0xd4/0x280
\[ 2538.459510\]  device\_release\_driver\_internal+0x1c4/0x2c4
\[ 2538.459514\]  device\_release\_driver+0x18/0x28
\[ 2538.459518\]  bus\_remove\_device+0x15c/0x174
\[ 2538.459523\]  device\_del+0x1d0/0x358
\[ 2538.459528\]  usb\_disable\_device+0x84/0x194
\[ 2538.459532\]  usb\_disconnect+0xec/0x300
\[ 2538.459537\]  hub\_event+0xb80/0x1870
\[ 2538.459541\]  process\_scheduled\_works+0x248/0x4dc
\[ 2538.459545\]  worker\_thread+0x244/0x334
\[ 2538.459549\]  kthread+0x114/0x1bc

\[ 2538.461001\] INFO: task "fsck.":15415 blocked for more than 188 seconds.
\[ 2538.461014\] Call trace:
\[ 2538.461016\]  \_\_switch\_to+0x174/0x338
\[ 2538.461021\]  \_\_schedule+0x628/0x9c4
\[ 2538.461025\]  schedule+0x7c/0xe8
\[ 2538.461030\]  blk\_queue\_enter+0xc4/0x160
\[ 2538.461034\]  blk\_mq\_alloc\_request+0x120/0x1d4
\[ 2538.461037\]  scsi\_execute\_cmd+0x7c/0x23c
\[ 2538.461040\]  ioctl\_internal\_command+0x5c/0x164
\[ 2538.461046\]  scsi\_set\_medium\_removal+0x5c/0xb0
\[ 2538.461051\]  sd\_release+0x50/0x94
\[ 2538.461054\]  blkdev\_put+0x190/0x28c
\[ 2538.461058\]  blkdev\_release+0x28/0x40
\[ 2538.461063\]  \_\_fput+0xf8/0x2a8
\[ 2538.461066\]  \_\_fput\_sync+0x28/0x5c
\[ 2538.461070\]  \_\_arm64\_sys\_close+0x84/0xe8
\[ 2538.461073\]  invoke\_syscall+0x58/0x114
\[ 2538.461078\]  el0\_svc\_common+0xac/0xe0
\[ 2538.461082\]  do\_el0\_svc+0x1c/0x28
\[ 2538.461087\]  el0\_svc+0x38/0x68
\[ 2538.461090\]  el0t\_64\_sync\_handler+0x68/0xbc
\[ 2538.461093\]  el0t\_64\_sync+0x1a8/0x1ac

  T1:				T2:
  sd\_remove
  del\_gendisk
  \_\_blk\_mark\_disk\_dead
  blk\_freeze\_queue\_start
  ++q-\>mq\_freeze\_depth
  				bdev\_release
 				mutex\_lock(&disk-\>open\_mutex)
  				sd\_release
 				scsi\_execute\_cmd
 				blk\_queue\_enter
 				wait\_event(!q-\>mq\_freeze\_depth)
  mutex\_lock(&disk-\>open\_mutex)

SCSI does not set GD\_OWNS\_QUEUE, so QUEUE\_FLAG\_DYING is not set in
this scenario. This is a classic ABBA deadlock. To fix the deadlock,
make sure we don't try to acquire disk-\>open\_mutex after freezing
the queue.

## Affected and fixed versions

- Linux: \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< 5a5625a83eac91fdff1d5f0202ecfc45a31983c9; \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< f5418f48a93b69ed9e6a2281eee06b412f14a544; \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< 7e04da2dc7013af50ed3a2beb698d5168d1e594b (cvelist)
- Linux: 6.5 (cvelist)

## Mitigation

- Upgrade Linux to 7e04da2dc7013af50ed3a2beb698d5168d1e594b or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-42294. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-42294.md
Affected: Linux >= eec1be4c30df73238b936fa9f3653773a6f8b15c, < 5a5625a83eac91fdff1d5f0202ecfc45a31983c9; >= eec1be4c30df73238b936fa9f3653773a6f8b15c, < f5418f48a93b69ed9e6a2281eee06b412f14a544; >= eec1be4c30df73238b936fa9f3653773a6f8b15c, < 7e04da2dc7013af50ed3a2beb698d5168d1e594b; Linux 6.5
Fixed in: Linux 5a5625a83eac91fdff1d5f0202ecfc45a31983c9, Linux 7e04da2dc7013af50ed3a2beb698d5168d1e594b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-42294 being exploited?

There is no confirmed exploitation: CVE-2024-42294 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-42294?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-42294?

Linux \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< 5a5625a83eac91fdff1d5f0202ecfc45a31983c9; \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< f5418f48a93b69ed9e6a2281eee06b412f14a544; \>= eec1be4c30df73238b936fa9f3653773a6f8b15c, \< 7e04da2dc7013af50ed3a2beb698d5168d1e594b; Linux 6.5.

### Is there a fix for CVE-2024-42294?

Yes. Fixed in Linux 5a5625a83eac91fdff1d5f0202ecfc45a31983c9, Linux 7e04da2dc7013af50ed3a2beb698d5168d1e594b. Upgrade Linux to 7e04da2dc7013af50ed3a2beb698d5168d1e594b or later.

### How do I check if I'm affected by CVE-2024-42294?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/5a5625a83eac91fdff1d5f0202ecfc45a31983c9>
- patch: <https://git.kernel.org/stable/c/f5418f48a93b69ed9e6a2281eee06b412f14a544>
- patch: <https://git.kernel.org/stable/c/7e04da2dc7013af50ed3a2beb698d5168d1e594b>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-42294>

HTML: <https://flawdb.com/CVE-2024-42294> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-42294>
