# CVE-2024-41054: scsi: ufs: core: Fix ufshcd\_clear\_cmd racing issue

> 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.30% (percentile 16, 2026-11-30)
- **CWE:** CWE-476
- **Published:** 2024-07-29T14:32:09.829Z
- **Modified:** 2026-06-17T07:47:10.727Z

## Who should check

- Anyone running Linux \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< bed0896008334eeee4b4bfd7150491ca098cbf72; \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< 11d81233f4ebe6907b12c79ad7d8787aa4db0633; \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< 9307a998cb9846a2557fdca286997430bee36a2a
- Anyone running Linux 6.5

## Description

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

scsi: ufs: core: Fix ufshcd\_clear\_cmd racing issue

When ufshcd\_clear\_cmd is racing with the completion ISR, the completed tag
of the request's mq\_hctx pointer will be set to NULL by the ISR.  And
ufshcd\_clear\_cmd's call to ufshcd\_mcq\_req\_to\_hwq will get NULL pointer KE.
Return success when the request is completed by ISR because sq does not
need cleanup.

The racing flow is:

Thread A
ufshcd\_err\_handler					step 1
	ufshcd\_try\_to\_abort\_task
		ufshcd\_cmd\_inflight(true)		step 3
		ufshcd\_clear\_cmd
			...
			ufshcd\_mcq\_req\_to\_hwq
			blk\_mq\_unique\_tag
				rq-\>mq\_hctx-\>queue\_num	step 5

Thread B
ufs\_mtk\_mcq\_intr(cq complete ISR)			step 2
	scsi\_done
		...
		\_\_blk\_mq\_free\_request
			rq-\>mq\_hctx = NULL;		step 4

Below is KE back trace:

  ufshcd\_try\_to\_abort\_task: cmd pending in the device. tag = 6
  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000194
   pc : \[0xffffffd589679bf8\] blk\_mq\_unique\_tag+0x8/0x14
   lr : \[0xffffffd5862f95b4\] ufshcd\_mcq\_sq\_cleanup+0x6c/0x1cc \[ufs\_mediatek\_mod\_ise\]
   Workqueue: ufs\_eh\_wq\_0 ufshcd\_err\_handler \[ufs\_mediatek\_mod\_ise\]
   Call trace:
    dump\_backtrace+0xf8/0x148
    show\_stack+0x18/0x24
    dump\_stack\_lvl+0x60/0x7c
    dump\_stack+0x18/0x3c
    mrdump\_common\_die+0x24c/0x398 \[mrdump\]
    ipanic\_die+0x20/0x34 \[mrdump\]
    notify\_die+0x80/0xd8
    die+0x94/0x2b8
    \_\_do\_kernel\_fault+0x264/0x298
    do\_page\_fault+0xa4/0x4b8
    do\_translation\_fault+0x38/0x54
    do\_mem\_abort+0x58/0x118
    el1\_abort+0x3c/0x5c
    el1h\_64\_sync\_handler+0x54/0x90
    el1h\_64\_sync+0x68/0x6c
    blk\_mq\_unique\_tag+0x8/0x14
    ufshcd\_clear\_cmd+0x34/0x118 \[ufs\_mediatek\_mod\_ise\]
    ufshcd\_try\_to\_abort\_task+0x2c8/0x5b4 \[ufs\_mediatek\_mod\_ise\]
    ufshcd\_err\_handler+0xa7c/0xfa8 \[ufs\_mediatek\_mod\_ise\]
    process\_one\_work+0x208/0x4fc
    worker\_thread+0x228/0x438
    kthread+0x104/0x1d4
    ret\_from\_fork+0x10/0x20

## Affected and fixed versions

- Linux: \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< bed0896008334eeee4b4bfd7150491ca098cbf72; \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< 11d81233f4ebe6907b12c79ad7d8787aa4db0633; \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< 9307a998cb9846a2557fdca286997430bee36a2a (cvelist)
- Linux: 6.5 (cvelist)

## Mitigation

- Upgrade Linux to 9307a998cb9846a2557fdca286997430bee36a2a 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-41054. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-41054.md
Affected: Linux >= 8d7290348992f27242dd6a696fa2eede709f0b14, < bed0896008334eeee4b4bfd7150491ca098cbf72; >= 8d7290348992f27242dd6a696fa2eede709f0b14, < 11d81233f4ebe6907b12c79ad7d8787aa4db0633; >= 8d7290348992f27242dd6a696fa2eede709f0b14, < 9307a998cb9846a2557fdca286997430bee36a2a; Linux 6.5
Fixed in: Linux 11d81233f4ebe6907b12c79ad7d8787aa4db0633, Linux 9307a998cb9846a2557fdca286997430bee36a2a

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-41054 being exploited?

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

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

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

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

Linux \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< bed0896008334eeee4b4bfd7150491ca098cbf72; \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< 11d81233f4ebe6907b12c79ad7d8787aa4db0633; \>= 8d7290348992f27242dd6a696fa2eede709f0b14, \< 9307a998cb9846a2557fdca286997430bee36a2a; Linux 6.5.

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

Yes. Fixed in Linux 11d81233f4ebe6907b12c79ad7d8787aa4db0633, Linux 9307a998cb9846a2557fdca286997430bee36a2a. Upgrade Linux to 9307a998cb9846a2557fdca286997430bee36a2a or later.

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

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/bed0896008334eeee4b4bfd7150491ca098cbf72>
- patch: <https://git.kernel.org/stable/c/11d81233f4ebe6907b12c79ad7d8787aa4db0633>
- patch: <https://git.kernel.org/stable/c/9307a998cb9846a2557fdca286997430bee36a2a>

## 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-41054>

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