CVE-2022-50021

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-50021
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50021.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50021
Related
Published
2025-06-18T11:15:30Z
Modified
2025-06-18T16:47:33.890229Z
Downstream
Summary
[none]
Details

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

ext4: block range must be validated before use in ext4mbclear_bb()

Block range to free is validated in ext4freeblocks() using ext4inodeblockvalid() and then it's passed to ext4mbclearbb(). However in some situations on bigalloc file system the range might be adjusted after the validation in ext4freeblocks() which can lead to troubles on corrupted file systems such as one found by syzkaller that resulted in the following BUG

kernel BUG at fs/ext4/ext4.h:3319! PREEMPT SMP NOPTI CPU: 28 PID: 4243 Comm: repro Kdump: loaded Not tainted 5.19.0-rc6+ #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1.fc35 04/01/2014 RIP: 0010:ext4freeblocks+0x95e/0xa90 Call Trace: <TASK> ? locktimerbase+0x61/0x80 ? _esremoveextent+0x5a/0x760 ? _modtimer+0x256/0x380 ? ext4indtruncateensurecredits+0x90/0x220 ext4clearblocks+0x107/0x1b0 ext4freedata+0x15b/0x170 ext4indtruncate+0x214/0x2c0 ? _rawspinunlock+0x15/0x30 ? ext4discardpreallocations+0x15a/0x410 ? ext4journalcheckstart+0xe/0x90 ? _ext4journalstartsb+0x2f/0x110 ext4truncate+0x1b5/0x460 ? _ext4journalstartsb+0x2f/0x110 ext4evictinode+0x2b4/0x6f0 evict+0xd0/0x1d0 ext4enablequotas+0x11f/0x1f0 ext4orphancleanup+0x3de/0x430 ? proccreateseqprivate+0x43/0x50 ext4fillsuper+0x295f/0x3ae0 ? snprintf+0x39/0x40 ? sgetfc+0x19c/0x330 ? ext4reconfigure+0x850/0x850 gettreebdev+0x16d/0x260 vfsgettree+0x25/0xb0 pathmount+0x431/0xa70 _x64sysmount+0xe2/0x120 dosyscall64+0x5b/0x80 ? douseraddrfault+0x1e2/0x670 ? excpagefault+0x70/0x170 entrySYSCALL64after_hwframe+0x46/0xb0 RIP: 0033:0x7fdf4e512ace

Fix it by making sure that the block range is properly validated before used every time it changes in ext4freeblocks() or ext4mbclear_bb().

References

Affected packages

Debian:11 / 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
5.10.178-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1
5.10.84-1
5.10.92-1~bpo10+1
5.10.92-1
5.10.92-2
5.10.103-1~bpo10+1
5.10.103-1
5.10.106-1
5.10.113-1
5.10.120-1~bpo10+1
5.10.120-1
5.10.127-1
5.10.127-2~bpo10+1
5.10.127-2
5.10.136-1
5.10.140-1
5.10.148-1
5.10.149-1
5.10.149-2
5.10.158-1
5.10.158-2
5.10.162-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

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
Fixed
6.0.2-1

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.0.2-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}