Skip to main content

CVE-2022-48649: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-48649cvecve-2022-48649
Published: Sun Apr 28 2024 (04/28/2024, 13:00:33 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mm/slab_common: fix possible double free of kmem_cache When doing slub_debug test, kfence's 'test_memcache_typesafe_by_rcu' kunit test case cause a use-after-free error: BUG: KASAN: use-after-free in kobject_del+0x14/0x30 Read of size 8 at addr ffff888007679090 by task kunit_try_catch/261 CPU: 1 PID: 261 Comm: kunit_try_catch Tainted: G B N 6.0.0-rc5-next-20220916 #17 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x34/0x48 print_address_description.constprop.0+0x87/0x2a5 print_report+0x103/0x1ed kasan_report+0xb7/0x140 kobject_del+0x14/0x30 kmem_cache_destroy+0x130/0x170 test_exit+0x1a/0x30 kunit_try_run_case+0xad/0xc0 kunit_generic_run_threadfn_adapter+0x26/0x50 kthread+0x17b/0x1b0 </TASK> The cause is inside kmem_cache_destroy(): kmem_cache_destroy acquire lock/mutex shutdown_cache schedule_work(kmem_cache_release) (if RCU flag set) release lock/mutex kmem_cache_release (if RCU flag not set) In some certain timing, the scheduled work could be run before the next RCU flag checking, which can then get a wrong value and lead to double kmem_cache_release(). Fix it by caching the RCU flag inside protected area, just like 'refcnt'

AI-Powered Analysis

AILast updated: 06/30/2025, 18:12:58 UTC

Technical Analysis

CVE-2022-48649 is a vulnerability in the Linux kernel's memory management subsystem, specifically within the slab allocator's common code (mm/slab_common). The flaw involves a potential double free of a kmem_cache object, which is a kernel memory cache used to efficiently allocate and free objects of the same size. The vulnerability manifests during the execution of the slub_debug test, particularly in the kfence's 'test_memcache_typesafe_by_rcu' kunit test case, where a use-after-free error is triggered. The root cause lies in the kmem_cache_destroy() function's handling of the Read-Copy-Update (RCU) flag. The function schedules work to release the kmem_cache either immediately or deferred depending on the RCU flag. Due to a race condition in timing, the scheduled work can execute before the next RCU flag check, causing the kmem_cache_release() function to be called twice on the same object, resulting in a double free. This double free can lead to memory corruption, use-after-free conditions, and potentially kernel crashes or arbitrary code execution within the kernel context. The fix involves caching the RCU flag within a protected critical section to prevent the race condition and ensure kmem_cache_release() is called exactly once. This vulnerability affects Linux kernel versions prior to the fix and is particularly relevant for systems running kernels with the affected slab allocator code. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily to servers, embedded devices, and infrastructure running vulnerable Linux kernel versions. Exploitation could allow attackers with local access or the ability to execute code on the system to cause kernel crashes (denial of service) or potentially escalate privileges by executing arbitrary code in kernel mode. This could compromise the confidentiality, integrity, and availability of critical systems, including web servers, cloud infrastructure, and industrial control systems that rely on Linux. Given Linux's widespread use in European data centers, telecommunications, and government infrastructure, the impact could be broad if exploited. However, exploitation requires specific conditions and local code execution capabilities, limiting remote attack vectors. The absence of known exploits reduces immediate risk but does not eliminate the threat, especially as attackers may develop exploits over time.

Mitigation Recommendations

European organizations should prioritize updating Linux kernels to versions where this vulnerability is patched. Kernel maintainers have fixed the issue by modifying the kmem_cache_destroy() function to cache the RCU flag within a protected critical section, preventing double free conditions. Organizations should: 1) Identify all systems running affected Linux kernel versions, especially those using slub_debug or kfence testing features. 2) Apply official kernel patches or upgrade to the latest stable kernel releases that include the fix. 3) For systems where immediate patching is not feasible, restrict local access and code execution capabilities to trusted users only, minimizing the risk of exploitation. 4) Monitor kernel logs and system behavior for signs of memory corruption or crashes that could indicate exploitation attempts. 5) Employ kernel hardening techniques such as Kernel Address Space Layout Randomization (KASLR) and Kernel Page Table Isolation (KPTI) to reduce exploitation success. 6) Engage with Linux distribution vendors for timely security updates and advisories.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-25T13:44:28.316Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982ec4522896dcbe5dab

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

Last enriched: 6/30/2025, 6:12:58 PM

Last updated: 8/15/2025, 8:55:55 PM

Views: 15

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