CVE-2024-53166

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-53166
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-53166.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-53166
Related
Published
2024-12-27T14:15:23Z
Modified
2025-01-16T17:49:52.080568Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

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

block, bfq: fix bfqq uaf in bfqlimitdepth()

Set new allocated bfqq to bic or remove freed bfqq from bic are both protected by bfqd->lock, however bfqlimitdepth() 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> dumpstacklvl+0x47/0x80 printaddressdescription.constprop.0+0x66/0x300 printreport+0x3e/0x70 kasanreport+0xb4/0xf0 bfqqgroup+0x15/0x50 bfqqrequestoverlimit+0x130/0x9a0 bfqlimitdepth+0x1b5/0x480 _blkmqallocrequests+0x2b5/0xa00 blkmqgetnewrequests+0x11d/0x1d0 blkmqsubmitbio+0x286/0xb00 submitbionoacctnocheck+0x331/0x400 _blockwritefullfolio+0x3d0/0x640 writepagecb+0x3b/0xc0 writecachepages+0x254/0x6c0 writecachepages+0x254/0x6c0 dowritepages+0x192/0x310 filemapfdatawritewbc+0x95/0xc0 _filemapfdatawriterange+0x99/0xd0 filemapwriteandwaitrange.part.0+0x4d/0xa0 blkdevreaditer+0xef/0x1e0 ioread+0x1b6/0x8a0 ioissuesqe+0x87/0x300 iowqsubmitwork+0xeb/0x390 ioworkerhandlework+0x24d/0x550 iowqworker+0x27f/0x6c0 retfromfork_asm+0x1b/0x30 </TASK>

Allocated by task 808602: kasansavestack+0x1e/0x40 kasansettrack+0x21/0x30 _kasanslaballoc+0x83/0x90 kmemcacheallocnode+0x1b1/0x6d0 bfqgetqueue+0x138/0xfa0 bfqgetbfqqhandlesplit+0xe3/0x2c0 bfqinitrq+0x196/0xbb0 bfqinsertrequest.isra.0+0xb5/0x480 bfqinsertrequests+0x156/0x180 blkmqinsertrequest+0x15d/0x440 blkmqsubmitbio+0x8a4/0xb00 submitbionoacctnocheck+0x331/0x400 _blkdevdirectIOasync+0x2dd/0x330 blkdevwriteiter+0x39a/0x450 iowrite+0x22a/0x840 ioissuesqe+0x87/0x300 iowqsubmitwork+0xeb/0x390 ioworkerhandlework+0x24d/0x550 iowqworker+0x27f/0x6c0 retfromfork+0x2d/0x50 retfromfork_asm+0x1b/0x30

Freed by task 808589: kasansavestack+0x1e/0x40 kasansettrack+0x21/0x30 kasansavefreeinfo+0x27/0x40 _kasanslabfree+0x126/0x1b0 kmemcachefree+0x10c/0x750 bfqputqueue+0x2dd/0x770 _bfqinsertrequest.isra.0+0x155/0x7a0 bfqinsertrequest.isra.0+0x122/0x480 bfqinsertrequests+0x156/0x180 blkmqdispatchpluglist+0x528/0x7e0 blkmqflushpluglist.part.0+0xe5/0x590 _blkflushplug+0x3b/0x90 blkfinishplug+0x40/0x60 dowritepages+0x19d/0x310 filemapfdatawritewbc+0x95/0xc0 _filemapfdatawriterange+0x99/0xd0 filemapwriteandwaitrange.part.0+0x4d/0xa0 blkdevreaditer+0xef/0x1e0 ioread+0x1b6/0x8a0 ioissuesqe+0x87/0x300 iowqsubmitwork+0xeb/0x390 ioworkerhandlework+0x24d/0x550 iowqworker+0x27f/0x6c0 retfromfork+0x2d/0x50 retfromforkasm+0x1b/0x30

Fix the problem by protecting bictobfqq() with bfqd->lock.

References

Affected packages

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

6.*

6.1.27-1
6.1.37-1
6.1.38-1
6.1.38-2~bpo11+1
6.1.38-2
6.1.38-3
6.1.38-4~bpo11+1
6.1.38-4
6.1.52-1
6.1.55-1~bpo11+1
6.1.55-1
6.1.64-1
6.1.66-1
6.1.67-1
6.1.69-1~bpo11+1
6.1.69-1
6.1.76-1~bpo11+1
6.1.76-1
6.1.82-1
6.1.85-1
6.1.90-1~bpo11+1
6.1.90-1
6.1.94-1~bpo11+1
6.1.94-1
6.1.98-1
6.1.99-1
6.1.106-1
6.1.106-2
6.1.106-3
6.1.112-1
6.1.115-1
6.1.119-1
6.1.123-1
6.1.124-1
6.3.1-1~exp1
6.3.2-1~exp1
6.3.4-1~exp1
6.3.5-1~exp1
6.3.7-1~bpo12+1
6.3.7-1
6.3.11-1
6.4~rc6-1~exp1
6.4~rc7-1~exp1
6.4.1-1~exp1
6.4.4-1~bpo12+1
6.4.4-1
6.4.4-2
6.4.4-3~bpo12+1
6.4.4-3
6.4.11-1
6.4.13-1
6.5~rc4-1~exp1
6.5~rc6-1~exp1
6.5~rc7-1~exp1
6.5.1-1~exp1
6.5.3-1~bpo12+1
6.5.3-1
6.5.6-1
6.5.8-1
6.5.10-1~bpo12+1
6.5.10-1
6.5.13-1
6.6.3-1~exp1
6.6.4-1~exp1
6.6.7-1~exp1
6.6.8-1
6.6.9-1
6.6.11-1
6.6.13-1~bpo12+1
6.6.13-1
6.6.15-1
6.6.15-2
6.7-1~exp1
6.7.1-1~exp1
6.7.4-1~exp1
6.7.7-1
6.7.9-1
6.7.9-2
6.7.12-1~bpo12+1
6.7.12-1
6.8.9-1
6.8.11-1
6.8.12-1~bpo12+1
6.8.12-1
6.9.2-1~exp1
6.9.7-1~bpo12+1
6.9.7-1
6.9.8-1
6.9.9-1
6.9.10-1~bpo12+1
6.9.10-1
6.9.11-1
6.9.12-1
6.10-1~exp1
6.10.1-1~exp1
6.10.3-1
6.10.4-1
6.10.6-1~bpo12+1
6.10.6-1
6.10.7-1
6.10.9-1
6.10.11-1~bpo12+1
6.10.11-1
6.10.12-1
6.11~rc4-1~exp1
6.11~rc5-1~exp1
6.11-1~exp1
6.11.2-1
6.11.4-1
6.11.5-1~bpo12+1
6.11.5-1
6.11.6-1
6.11.7-1
6.11.9-1
6.11.10-1~bpo12+1
6.11.10-1
6.12~rc6-1~exp1
6.12.3-1
6.12.5-1
6.12.6-1
6.12.8-1
6.12.9-1
6.13~rc6-1~exp1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.12.3-1

Affected versions

6.*

6.1.27-1
6.1.37-1
6.1.38-1
6.1.38-2~bpo11+1
6.1.38-2
6.1.38-3
6.1.38-4~bpo11+1
6.1.38-4
6.1.52-1
6.1.55-1~bpo11+1
6.1.55-1
6.1.64-1
6.1.66-1
6.1.67-1
6.1.69-1~bpo11+1
6.1.69-1
6.1.76-1~bpo11+1
6.1.76-1
6.1.82-1
6.1.85-1
6.1.90-1~bpo11+1
6.1.90-1
6.1.94-1~bpo11+1
6.1.94-1
6.1.98-1
6.1.99-1
6.1.106-1
6.1.106-2
6.1.106-3
6.1.112-1
6.1.115-1
6.1.119-1
6.1.123-1
6.1.124-1
6.3.1-1~exp1
6.3.2-1~exp1
6.3.4-1~exp1
6.3.5-1~exp1
6.3.7-1~bpo12+1
6.3.7-1
6.3.11-1
6.4~rc6-1~exp1
6.4~rc7-1~exp1
6.4.1-1~exp1
6.4.4-1~bpo12+1
6.4.4-1
6.4.4-2
6.4.4-3~bpo12+1
6.4.4-3
6.4.11-1
6.4.13-1
6.5~rc4-1~exp1
6.5~rc6-1~exp1
6.5~rc7-1~exp1
6.5.1-1~exp1
6.5.3-1~bpo12+1
6.5.3-1
6.5.6-1
6.5.8-1
6.5.10-1~bpo12+1
6.5.10-1
6.5.13-1
6.6.3-1~exp1
6.6.4-1~exp1
6.6.7-1~exp1
6.6.8-1
6.6.9-1
6.6.11-1
6.6.13-1~bpo12+1
6.6.13-1
6.6.15-1
6.6.15-2
6.7-1~exp1
6.7.1-1~exp1
6.7.4-1~exp1
6.7.7-1
6.7.9-1
6.7.9-2
6.7.12-1~bpo12+1
6.7.12-1
6.8.9-1
6.8.11-1
6.8.12-1~bpo12+1
6.8.12-1
6.9.2-1~exp1
6.9.7-1~bpo12+1
6.9.7-1
6.9.8-1
6.9.9-1
6.9.10-1~bpo12+1
6.9.10-1
6.9.11-1
6.9.12-1
6.10-1~exp1
6.10.1-1~exp1
6.10.3-1
6.10.4-1
6.10.6-1~bpo12+1
6.10.6-1
6.10.7-1
6.10.9-1
6.10.11-1~bpo12+1
6.10.11-1
6.10.12-1
6.11~rc4-1~exp1
6.11~rc5-1~exp1
6.11-1~exp1
6.11.2-1
6.11.4-1
6.11.5-1~bpo12+1
6.11.5-1
6.11.6-1
6.11.7-1
6.11.9-1
6.11.10-1~bpo12+1
6.11.10-1
6.12~rc6-1~exp1

Ecosystem specific

{
    "urgency": "not yet assigned"
}