Skip to main content

CVE-2022-49879: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49879cvecve-2022-49879
Published: Thu May 01 2025 (05/01/2025, 14:10:27 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

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.

AI-Powered Analysis

AILast updated: 06/30/2025, 02:56:14 UTC

Technical Analysis

CVE-2022-49879 is a vulnerability in the Linux kernel's ext4 filesystem implementation. The issue arises from improper validation of the rec_len field in directory entries. The rec_len field specifies the length of a directory entry and must be a multiple of 4. If a corrupted or maliciously crafted filesystem image contains directory entries with invalid rec_len values, it can trigger a kernel BUG in the ext4_rec_len_to_disk() function, which is called during directory indexing operations in make_indexed_dir(). This BUG manifests as a kernel panic or crash, leading to denial of service. The root cause is that the ext4 filesystem code did not sufficiently validate directory entries before processing them, allowing malformed entries to cause a kernel-level fault. The fix introduced involves adding a call to ext4_check_dir_entry() to validate directory entries and return an error (-EFSCORRUPTED) if invalid entries are detected, preventing the BUG from being triggered. This vulnerability affects Linux kernel versions prior to the patch and can be exploited by mounting or accessing a corrupted ext4 filesystem image. There are no known exploits in the wild as of the published date, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running Linux with ext4 filesystems, which is the default filesystem for many Linux distributions widely used in enterprise, cloud, and server environments. Exploitation can cause kernel crashes leading to denial of service, potentially disrupting critical services, applications, or infrastructure relying on Linux servers. This can affect availability of systems hosting web services, databases, or internal applications. While the vulnerability does not appear to allow privilege escalation or remote code execution directly, the induced system instability can be leveraged in targeted attacks to cause operational disruptions. Organizations using containerized environments or virtual machines with ext4-backed storage may also be impacted if they mount or interact with corrupted ext4 images. The lack of known exploits suggests limited immediate risk, but the vulnerability should be addressed proactively to avoid potential future exploitation, especially in sectors where uptime and data integrity are critical, such as finance, healthcare, and government.

Mitigation Recommendations

European organizations should apply the Linux kernel patches that include the fix for CVE-2022-49879 as soon as they become available from their Linux distribution vendors. Until patches are applied, administrators should avoid mounting or accessing untrusted or suspicious ext4 filesystem images that could be malformed. Implementing strict validation and scanning of filesystem images before deployment can reduce risk. Monitoring kernel logs for BUG() messages related to ext4 can help detect attempted exploitation or filesystem corruption. In environments using container or VM images, ensure images are verified and scanned for integrity before use. Additionally, maintaining robust backup and recovery procedures will mitigate impact in case of crashes. Organizations should also consider deploying kernel crash dump analysis tools to investigate any unexpected kernel panics to identify if this vulnerability is being triggered. Finally, restricting access to systems that handle filesystem images to trusted personnel and processes reduces the attack surface.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-05-01T14:05:17.239Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982cc4522896dcbe4f10

Added to database: 5/21/2025, 9:09:00 AM

Last enriched: 6/30/2025, 2:56:14 AM

Last updated: 8/17/2025, 5:53:24 PM

Views: 9

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats