# CVE-2024-53166: block, bfq: fix bfqq uaf in bfq\_limit\_depth()

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.31% (percentile 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-12-27T13:49:12.233Z
- **Modified:** 2026-10-15T01:19:15.150Z

## Who should check

- Anyone running Linux \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< ada4ca5fd5a9d5212f28164d49a4885951c979c9; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< 906cdbdd3b018ff69cc830173bce277a847d4fdc; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< dcaa738afde55085ac6056252e319479cf23cde2; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< 01a853faaeaf3379ccf358ade582b1d28752126e; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< e8b8344de3980709080d86c157d24e7de07d70ad
- Anyone running Linux 5.17

## Description

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

block, bfq: fix bfqq uaf in bfq\_limit\_depth()

Set new allocated bfqq to bic or remove freed bfqq from bic are both
protected by bfqd-\>lock, however bfq\_limit\_depth() is deferencing bfqq
from bic without the lock, this can lead to UAF if the io\_context is
shared by multiple tasks.

For example, test bfq with io\_uring can trigger following UAF in v6.6:

==================================================================
BUG: KASAN: slab-use-after-free in bfqq\_group+0x15/0x50

Call Trace:
 \<TASK\>
 dump\_stack\_lvl+0x47/0x80
 print\_address\_description.constprop.0+0x66/0x300
 print\_report+0x3e/0x70
 kasan\_report+0xb4/0xf0
 bfqq\_group+0x15/0x50
 bfqq\_request\_over\_limit+0x130/0x9a0
 bfq\_limit\_depth+0x1b5/0x480
 \_\_blk\_mq\_alloc\_requests+0x2b5/0xa00
 blk\_mq\_get\_new\_requests+0x11d/0x1d0
 blk\_mq\_submit\_bio+0x286/0xb00
 submit\_bio\_noacct\_nocheck+0x331/0x400
 \_\_block\_write\_full\_folio+0x3d0/0x640
 writepage\_cb+0x3b/0xc0
 write\_cache\_pages+0x254/0x6c0
 write\_cache\_pages+0x254/0x6c0
 do\_writepages+0x192/0x310
 filemap\_fdatawrite\_wbc+0x95/0xc0
 \_\_filemap\_fdatawrite\_range+0x99/0xd0
 filemap\_write\_and\_wait\_range.part.0+0x4d/0xa0
 blkdev\_read\_iter+0xef/0x1e0
 io\_read+0x1b6/0x8a0
 io\_issue\_sqe+0x87/0x300
 io\_wq\_submit\_work+0xeb/0x390
 io\_worker\_handle\_work+0x24d/0x550
 io\_wq\_worker+0x27f/0x6c0
 ret\_from\_fork\_asm+0x1b/0x30
 \</TASK\>

Allocated by task 808602:
 kasan\_save\_stack+0x1e/0x40
 kasan\_set\_track+0x21/0x30
 \_\_kasan\_slab\_alloc+0x83/0x90
 kmem\_cache\_alloc\_node+0x1b1/0x6d0
 bfq\_get\_queue+0x138/0xfa0
 bfq\_get\_bfqq\_handle\_split+0xe3/0x2c0
 bfq\_init\_rq+0x196/0xbb0
 bfq\_insert\_request.isra.0+0xb5/0x480
 bfq\_insert\_requests+0x156/0x180
 blk\_mq\_insert\_request+0x15d/0x440
 blk\_mq\_submit\_bio+0x8a4/0xb00
 submit\_bio\_noacct\_nocheck+0x331/0x400
 \_\_blkdev\_direct\_IO\_async+0x2dd/0x330
 blkdev\_write\_iter+0x39a/0x450
 io\_write+0x22a/0x840
 io\_issue\_sqe+0x87/0x300
 io\_wq\_submit\_work+0xeb/0x390
 io\_worker\_handle\_work+0x24d/0x550
 io\_wq\_worker+0x27f/0x6c0
 ret\_from\_fork+0x2d/0x50
 ret\_from\_fork\_asm+0x1b/0x30

Freed by task 808589:
 kasan\_save\_stack+0x1e/0x40
 kasan\_set\_track+0x21/0x30
 kasan\_save\_free\_info+0x27/0x40
 \_\_kasan\_slab\_free+0x126/0x1b0
 kmem\_cache\_free+0x10c/0x750
 bfq\_put\_queue+0x2dd/0x770
 \_\_bfq\_insert\_request.isra.0+0x155/0x7a0
 bfq\_insert\_request.isra.0+0x122/0x480
 bfq\_insert\_requests+0x156/0x180
 blk\_mq\_dispatch\_plug\_list+0x528/0x7e0
 blk\_mq\_flush\_plug\_list.part.0+0xe5/0x590
 \_\_blk\_flush\_plug+0x3b/0x90
 blk\_finish\_plug+0x40/0x60
 do\_writepages+0x19d/0x310
 filemap\_fdatawrite\_wbc+0x95/0xc0
 \_\_filemap\_fdatawrite\_range+0x99/0xd0
 filemap\_write\_and\_wait\_range.part.0+0x4d/0xa0
 blkdev\_read\_iter+0xef/0x1e0
 io\_read+0x1b6/0x8a0
 io\_issue\_sqe+0x87/0x300
 io\_wq\_submit\_work+0xeb/0x390
 io\_worker\_handle\_work+0x24d/0x550
 io\_wq\_worker+0x27f/0x6c0
 ret\_from\_fork+0x2d/0x50
 ret\_from\_fork\_asm+0x1b/0x30

Fix the problem by protecting bic\_to\_bfqq() with bfqd-\>lock.

## Affected and fixed versions

- Linux: \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< ada4ca5fd5a9d5212f28164d49a4885951c979c9; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< 906cdbdd3b018ff69cc830173bce277a847d4fdc; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< dcaa738afde55085ac6056252e319479cf23cde2; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< 01a853faaeaf3379ccf358ade582b1d28752126e; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< e8b8344de3980709080d86c157d24e7de07d70ad (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-53166.md
Affected: Linux >= 76f1df88bbc2f984eb0418cc90de0a8384e63604, < ada4ca5fd5a9d5212f28164d49a4885951c979c9; >= 76f1df88bbc2f984eb0418cc90de0a8384e63604, < 906cdbdd3b018ff69cc830173bce277a847d4fdc; >= 76f1df88bbc2f984eb0418cc90de0a8384e63604, < dcaa738afde55085ac6056252e319479cf23cde2; >= 76f1df88bbc2f984eb0418c…
Fixed in: Linux 906cdbdd3b018ff69cc830173bce277a847d4fdc, Linux 01a853faaeaf3379ccf358ade582b1d28752126e

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

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< ada4ca5fd5a9d5212f28164d49a4885951c979c9; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< 906cdbdd3b018ff69cc830173bce277a847d4fdc; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< dcaa738afde55085ac6056252e319479cf23cde2; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< 01a853faaeaf3379ccf358ade582b1d28752126e; \>= 76f1df88bbc2f984eb0418cc90de0a8384e63604, \< e8b8344de3980709080d86c157d24e7de07d70ad; Linux 5.17.

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

Yes. Fixed in Linux 906cdbdd3b018ff69cc830173bce277a847d4fdc, Linux 01a853faaeaf3379ccf358ade582b1d28752126e. No fix listed yet: follow the vendor advisory.

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

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/906cdbdd3b018ff69cc830173bce277a847d4fdc>
- patch: <https://git.kernel.org/stable/c/dcaa738afde55085ac6056252e319479cf23cde2>
- patch: <https://git.kernel.org/stable/c/01a853faaeaf3379ccf358ade582b1d28752126e>
- patch: <https://git.kernel.org/stable/c/e8b8344de3980709080d86c157d24e7de07d70ad>
- other: <https://git.kernel.org/stable/c/ada4ca5fd5a9d5212f28164d49a4885951c979c9>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-082556.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-784472.html>

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

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