Skip to main content

CVE-2022-49349: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-49349cvecve-2022-49349
Published: Wed Feb 26 2025 (02/26/2025, 02:11:02 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ext4: fix use-after-free in ext4_rename_dir_prepare We got issue as follows: EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478 ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000 ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae ================================================================== BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220 Read of size 4 at addr ffff88810beee6ae by task rep/1895 CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ #241 Call Trace: dump_stack+0xbe/0xf9 print_address_description.constprop.0+0x1e/0x220 kasan_report.cold+0x37/0x7f ext4_rename_dir_prepare+0x152/0x220 ext4_rename+0xf44/0x1ad0 ext4_rename2+0x11c/0x170 vfs_rename+0xa84/0x1440 do_renameat2+0x683/0x8f0 __x64_sys_renameat+0x53/0x60 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f45a6fc41c9 RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9 RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005 RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080 R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0 R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee flags: 0x200000000000000() raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== Disabling lock debugging due to kernel taint ext4_rename_dir_prepare: [2] parent_de->inode=3537895424 ext4_rename_dir_prepare: [3] dir=0xffff888124170140 ext4_rename_dir_prepare: [4] ino=2 ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872 Reason is first directory entry which 'rec_len' is 34478, then will get illegal parent entry. Now, we do not check directory entry after read directory block in 'ext4_get_first_dir_block'. To solve this issue, check directory entry in 'ext4_get_first_dir_block'. [ Trigger an ext4_error() instead of just warning if the directory is missing a '.' or '..' entry. Also make sure we return an error code if the file system is corrupted. -TYT ]

AI-Powered Analysis

AILast updated: 07/03/2025, 02:55:47 UTC

Technical Analysis

CVE-2022-49349 is a high-severity use-after-free vulnerability in the Linux kernel's ext4 filesystem implementation, specifically within the ext4_rename_dir_prepare function. The ext4 filesystem is widely used in Linux environments, including servers, desktops, and embedded systems. The vulnerability arises due to improper handling of directory entries during a rename operation on directories. The root cause is that ext4_get_first_dir_block does not sufficiently validate directory entries after reading a directory block, allowing a malformed directory entry with an excessively large record length (rec_len) to cause an illegal parent directory entry reference. This leads to a use-after-free condition when ext4_rename_dir_prepare attempts to access freed memory, as detected by Kernel Address Sanitizer (KASAN). The vulnerability can result in kernel memory corruption, causing system instability, crashes (denial of service), or potentially arbitrary code execution with kernel privileges if exploited. The CVSS 3.1 score is 7.8 (high), reflecting the vulnerability's impact on confidentiality, integrity, and availability, with low attack complexity and requiring low privileges but no user interaction. The vulnerability affects multiple versions of the Linux kernel prior to the patch and is triggered by filesystem operations involving renaming directories on ext4 filesystems. The fix involves adding checks in ext4_get_first_dir_block to validate directory entries and triggering ext4_error() if directory entries are missing or corrupted, preventing the use-after-free scenario.

Potential Impact

For European organizations, this vulnerability poses a significant risk due to the widespread use of Linux servers and infrastructure running ext4 filesystems. Exploitation could lead to system crashes or kernel-level compromise, impacting critical services such as web hosting, cloud infrastructure, and enterprise applications. Confidentiality breaches are possible if attackers gain kernel-level code execution, potentially accessing sensitive data or escalating privileges. Integrity and availability are also at risk, as attackers could disrupt operations or deploy persistent malware. Given the prevalence of Linux in government, finance, telecommunications, and industrial control systems across Europe, the impact could be severe, especially in sectors requiring high availability and data protection. The vulnerability does not require user interaction but does require local privileges, so insider threats or compromised accounts could leverage this flaw. The absence of known exploits in the wild currently reduces immediate risk but does not eliminate the threat, as weaponization is feasible.

Mitigation Recommendations

European organizations should promptly apply Linux kernel updates that include the patch for CVE-2022-49349. Since the vulnerability requires local privileges, strict access controls and user privilege management are critical to reduce the attack surface. Implement mandatory access controls (e.g., SELinux, AppArmor) to limit filesystem operation capabilities. Regularly audit and monitor filesystem integrity and kernel logs for suspicious rename operations or ext4 errors. Employ kernel hardening techniques such as Kernel Address Sanitizer (KASAN) in testing environments to detect similar issues early. For critical systems where immediate patching is challenging, consider isolating vulnerable systems or restricting access to trusted users only. Backup important data regularly to mitigate potential data loss from crashes or exploitation. Finally, maintain up-to-date intrusion detection systems tuned to detect abnormal filesystem activity patterns.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T02:08:31.544Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d982dc4522896dcbe573a

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

Last enriched: 7/3/2025, 2:55:47 AM

Last updated: 7/31/2025, 7:05:49 PM

Views: 10

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