Skip to main content

CVE-2022-49276: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49276cvecve-2022-49276
Published: Wed Feb 26 2025 (02/26/2025, 01:56:20 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: jffs2: fix memory leak in jffs2_scan_medium If an error is returned in jffs2_scan_eraseblock() and some memory has been added to the jffs2_summary *s, we can observe the following kmemleak report: -------------------------------------------- unreferenced object 0xffff88812b889c40 (size 64): comm "mount", pid 692, jiffies 4294838325 (age 34.288s) hex dump (first 32 bytes): 40 48 b5 14 81 88 ff ff 01 e0 31 00 00 00 50 00 @H........1...P. 00 00 01 00 00 00 01 00 00 00 02 00 00 00 09 08 ................ backtrace: [<ffffffffae93a3a3>] __kmalloc+0x613/0x910 [<ffffffffaf423b9c>] jffs2_sum_add_dirent_mem+0x5c/0xa0 [<ffffffffb0f3afa8>] jffs2_scan_medium.cold+0x36e5/0x4794 [<ffffffffb0f3dbe1>] jffs2_do_mount_fs.cold+0xa7/0x2267 [<ffffffffaf40acf3>] jffs2_do_fill_super+0x383/0xc30 [<ffffffffaf40c00a>] jffs2_fill_super+0x2ea/0x4c0 [<ffffffffb0315d64>] mtd_get_sb+0x254/0x400 [<ffffffffb0315f5f>] mtd_get_sb_by_nr+0x4f/0xd0 [<ffffffffb0316478>] get_tree_mtd+0x498/0x840 [<ffffffffaf40bd15>] jffs2_get_tree+0x25/0x30 [<ffffffffae9f358d>] vfs_get_tree+0x8d/0x2e0 [<ffffffffaea7a98f>] path_mount+0x50f/0x1e50 [<ffffffffaea7c3d7>] do_mount+0x107/0x130 [<ffffffffaea7c5c5>] __se_sys_mount+0x1c5/0x2f0 [<ffffffffaea7c917>] __x64_sys_mount+0xc7/0x160 [<ffffffffb10142f5>] do_syscall_64+0x45/0x70 unreferenced object 0xffff888114b54840 (size 32): comm "mount", pid 692, jiffies 4294838325 (age 34.288s) hex dump (first 32 bytes): c0 75 b5 14 81 88 ff ff 02 e0 02 00 00 00 02 00 .u.............. 00 00 84 00 00 00 44 00 00 00 6b 6b 6b 6b 6b a5 ......D...kkkkk. backtrace: [<ffffffffae93be24>] kmem_cache_alloc_trace+0x584/0x880 [<ffffffffaf423b04>] jffs2_sum_add_inode_mem+0x54/0x90 [<ffffffffb0f3bd44>] jffs2_scan_medium.cold+0x4481/0x4794 [...] unreferenced object 0xffff888114b57280 (size 32): comm "mount", pid 692, jiffies 4294838393 (age 34.357s) hex dump (first 32 bytes): 10 d5 6c 11 81 88 ff ff 08 e0 05 00 00 00 01 00 ..l............. 00 00 38 02 00 00 28 00 00 00 6b 6b 6b 6b 6b a5 ..8...(...kkkkk. backtrace: [<ffffffffae93be24>] kmem_cache_alloc_trace+0x584/0x880 [<ffffffffaf423c34>] jffs2_sum_add_xattr_mem+0x54/0x90 [<ffffffffb0f3a24f>] jffs2_scan_medium.cold+0x298c/0x4794 [...] unreferenced object 0xffff8881116cd510 (size 16): comm "mount", pid 692, jiffies 4294838395 (age 34.355s) hex dump (first 16 bytes): 00 00 00 00 00 00 00 00 09 e0 60 02 00 00 6b a5 ..........`...k. backtrace: [<ffffffffae93be24>] kmem_cache_alloc_trace+0x584/0x880 [<ffffffffaf423cc4>] jffs2_sum_add_xref_mem+0x54/0x90 [<ffffffffb0f3b2e3>] jffs2_scan_medium.cold+0x3a20/0x4794 [...] -------------------------------------------- Therefore, we should call jffs2_sum_reset_collected(s) on exit to release the memory added in s. In addition, a new tag "out_buf" is added to prevent the NULL pointer reference caused by s being NULL. (thanks to Zhang Yi for this analysis)

AI-Powered Analysis

AILast updated: 06/30/2025, 05:12:23 UTC

Technical Analysis

CVE-2022-49276 is a vulnerability in the Linux kernel's JFFS2 (Journaling Flash File System version 2) subsystem, specifically related to memory management during the scanning of erase blocks. The issue arises in the function jffs2_scan_eraseblock(), where if an error occurs and memory has already been allocated and added to the jffs2_summary structure, this memory is not properly freed, resulting in a memory leak. The vulnerability is triggered during the mount operation of a JFFS2 filesystem, which is commonly used on flash memory devices. The technical details indicate that when errors occur during scanning, the allocated memory objects remain unreferenced and are not released, as evidenced by kernel memory leak reports (kmemleak). The fix involves calling jffs2_sum_reset_collected() on exit to release the allocated memory and adding a new tag "out_buf" to prevent NULL pointer dereferences when the summary pointer is NULL. This vulnerability does not appear to have an associated CVSS score and there are no known exploits in the wild at this time. The affected versions are specific Linux kernel commits identified by the same hash, indicating the issue was present in a particular kernel snapshot or range. The vulnerability is technical and low-level, affecting kernel memory management during filesystem mounting operations on JFFS2 filesystems.

Potential Impact

For European organizations, the impact of this vulnerability depends largely on the use of Linux systems that mount JFFS2 filesystems, which are typically found in embedded devices, IoT equipment, and specialized industrial systems rather than general-purpose servers or desktops. The memory leak could lead to gradual kernel memory exhaustion on affected devices, potentially causing system instability, degraded performance, or crashes over time. This could disrupt critical embedded systems in sectors such as manufacturing, telecommunications, transportation, or utilities that rely on Linux-based embedded devices. While the vulnerability does not directly allow code execution or privilege escalation, the resulting denial of service through resource exhaustion could impact availability of critical infrastructure components. Since the vulnerability is triggered during mount operations, it might be exploited by mounting crafted or corrupted JFFS2 filesystems, which could be introduced via removable media or network updates. The absence of known exploits and the requirement for specific filesystem usage limit the immediate risk, but organizations using embedded Linux devices with JFFS2 should consider this a relevant threat to device reliability and availability.

Mitigation Recommendations

European organizations should implement the following specific mitigation measures: 1) Identify and inventory all embedded Linux devices and systems that utilize JFFS2 filesystems, especially in industrial control, telecommunications, and IoT environments. 2) Apply the Linux kernel patches that fix this vulnerability as soon as they become available from trusted Linux distributions or vendors maintaining embedded device firmware. 3) Where patching is not immediately possible, limit mounting of untrusted or external JFFS2 filesystems to reduce exposure to crafted filesystem images that could trigger the leak. 4) Monitor system logs and kernel memory usage on embedded devices for signs of memory leaks or abnormal resource consumption that could indicate exploitation attempts or impact. 5) Implement strict controls on firmware and filesystem updates to embedded devices to prevent unauthorized or malicious filesystem images from being mounted. 6) Engage with device vendors to ensure timely firmware updates incorporating the fix are provided and deployed. These steps go beyond generic advice by focusing on embedded Linux device management, patching, and operational controls specific to JFFS2 usage.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T01:49:39.298Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982dc4522896dcbe5502

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

Last enriched: 6/30/2025, 5:12:23 AM

Last updated: 8/8/2025, 10:42:00 AM

Views: 11

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