CVE-2022-49879: ext4: fix BUG_ON() when directory entry has invalid rec_len
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix BUG_ON() when directory entry has invalid rec_len
The rec_len field in the directory entry has to be a multiple of 4. A
corrupted filesystem image can be used to hit a BUG() in
ext4_rec_len_to_disk(), called from make_indexed_dir().
------------[ cut here ]------------
kernel BUG at fs/ext4/ext4.h:2413!
...
RIP: 0010:make_indexed_dir+0x53f/0x5f0
...
Call Trace:
<TASK>
? add_dirent_to_buf+0x1b2/0x200
ext4_add_entry+0x36e/0x480
ext4_add_nondir+0x2b/0xc0
ext4_create+0x163/0x200
path_openat+0x635/0xe90
do_filp_open+0xb4/0x160
? __create_object.isra.0+0x1de/0x3b0
? _raw_spin_unlock+0x12/0x30
do_sys_openat2+0x91/0x150
__x64_sys_open+0x6c/0xa0
do_syscall_64+0x3c/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
The fix simply adds a call to ext4_check_dir_entry() to validate the
directory entry, returning -EFSCORRUPTED if the entry is invalid.
Security readout for executives and security teams
Plain-English summary
CVE-2022-49879 is a Linux kernel ext4 flaw where a corrupted directory entry in an ext4 filesystem can trigger a kernel BUG. The likely business impact is denial of service, such as a crash, when a vulnerable system processes a crafted or corrupted filesystem image.
Executive priority
Treat as a patch-management item with higher priority for fleets handling untrusted storage images or removable media. There is no cited evidence of active exploitation, but a kernel crash path can disrupt availability.
Technical view
The ext4 rec_len directory-entry field must be 4-byte aligned. In vulnerable kernels, invalid rec_len data can reach ext4_rec_len_to_disk() through make_indexed_dir(), triggering BUG_ON(). The fix adds ext4_check_dir_entry() validation and returns -EFSCORRUPTED for invalid entries.
Likely exposure
Exposure is most relevant on Linux systems using ext4 that mount or process corrupted or untrusted filesystem images, removable media, VM disks, or storage supplied by users. Standard servers that never handle untrusted ext4 media are less exposed, but still depend on kernel patch status.
Exploitation context
The source bundle does not show active exploitation, and KEV is false. The described trigger requires a corrupted filesystem image and vulnerable ext4 code path. No public source in the bundle supports remote exploitation or privilege escalation claims.
Researcher notes
The key behavior is validation of ext4 directory entries before converting rec_len for indexed directory creation. The provided records do not include CVSS, CWE, exploitability metrics, or detailed affected distro package ranges, so downstream vendor mapping is required.
Mitigation direction
Update to a vendor kernel containing the referenced stable ext4 fixes.
Follow Linux distribution advisories for backported kernel packages.
Avoid mounting untrusted ext4 filesystem images until patched.
Restrict removable media and user-supplied disk image handling on vulnerable systems.
Use filesystem corruption handling policies for suspicious ext4 media.
Validation and detection
Inventory Linux kernel versions on systems using ext4.
Check vendor advisories for CVE-2022-49879 backport status.
Confirm the ext4 fix or equivalent validation is present.
Identify workflows that mount user-supplied ext4 images or media.
Monitor for kernel BUG reports involving make_indexed_dir or ext4_rec_len_to_disk.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2022-49879 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
0ADP providers
6Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
May 1, 2025, 14:10 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.