Skip to main content

CVE-2022-49322: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49322cvecve-2022-49322
Published: Wed Feb 26 2025 (02/26/2025, 02:10:46 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: tracing: Fix sleeping function called from invalid context on RT kernel When setting bootparams="trace_event=initcall:initcall_start tp_printk=1" in the cmdline, the output_printk() was called, and the spin_lock_irqsave() was called in the atomic and irq disable interrupt context suitation. On the PREEMPT_RT kernel, these locks are replaced with sleepable rt-spinlock, so the stack calltrace will be triggered. Fix it by raw_spin_lock_irqsave when PREEMPT_RT and "trace_event=initcall:initcall_start tp_printk=1" enabled. BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0 preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: [<ffffffff8992303e>] try_to_wake_up+0x7e/0xba0 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.1-rt17+ #19 34c5812404187a875f32bee7977f7367f9679ea7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x60/0x8c dump_stack+0x10/0x12 __might_resched.cold+0x11d/0x155 rt_spin_lock+0x40/0x70 trace_event_buffer_commit+0x2fa/0x4c0 ? map_vsyscall+0x93/0x93 trace_event_raw_event_initcall_start+0xbe/0x110 ? perf_trace_initcall_finish+0x210/0x210 ? probe_sched_wakeup+0x34/0x40 ? ttwu_do_wakeup+0xda/0x310 ? trace_hardirqs_on+0x35/0x170 ? map_vsyscall+0x93/0x93 do_one_initcall+0x217/0x3c0 ? trace_event_raw_event_initcall_level+0x170/0x170 ? push_cpu_stop+0x400/0x400 ? cblist_init_generic+0x241/0x290 kernel_init_freeable+0x1ac/0x347 ? _raw_spin_unlock_irq+0x65/0x80 ? rest_init+0xf0/0xf0 kernel_init+0x1e/0x150 ret_from_fork+0x22/0x30 </TASK>

AI-Powered Analysis

AILast updated: 06/30/2025, 05:55:00 UTC

Technical Analysis

CVE-2022-49322 is a vulnerability identified in the Linux kernel, specifically affecting the Real-Time (RT) variant of the kernel. The issue arises when certain boot parameters are set, namely "trace_event=initcall:initcall_start tp_printk=1". Under these conditions, the kernel's tracing subsystem invokes output_printk(), which in turn calls spin_lock_irqsave() within an atomic and interrupt-disabled context. In the PREEMPT_RT kernel, traditional spinlocks are replaced by sleepable RT-spinlocks. This replacement leads to a problematic scenario where a sleeping function is called from an invalid context, triggering a kernel BUG due to improper locking behavior. The bug manifests as a stack trace indicating a sleeping function called from an atomic context, which is not allowed and results in kernel instability or crashes. The root cause is that the RT-spinlock, which can sleep, is used where a raw spinlock (which cannot sleep) should be used. The fix involves using raw_spin_lock_irqsave() instead of the sleepable RT-spinlock when the PREEMPT_RT patch and the specific trace_event boot parameters are enabled. This vulnerability is technical and specific to kernel developers or system integrators using the PREEMPT_RT kernel with these tracing options enabled. It does not appear to be exploitable remotely or by unprivileged users, and no known exploits are reported in the wild. The vulnerability affects certain Linux kernel versions identified by specific commit hashes, and it was published on February 26, 2025.

Potential Impact

For European organizations, the impact of CVE-2022-49322 is primarily related to system stability and reliability rather than direct security compromise. Systems running the PREEMPT_RT Linux kernel variant with the specified tracing boot parameters enabled may experience kernel panics or crashes, leading to denial of service conditions. This can affect critical infrastructure, industrial control systems, telecommunications, and other environments where real-time Linux kernels are deployed to guarantee deterministic behavior. The vulnerability does not appear to allow privilege escalation, data leakage, or remote code execution, limiting its impact to availability concerns. However, in sectors such as manufacturing, energy, or transportation within Europe, where real-time Linux is often used, unexpected kernel crashes could disrupt operations, cause downtime, or impact safety systems. Organizations relying on these kernels for embedded or real-time applications should be aware of this risk. Since no known exploits exist, the immediate threat level is low, but the potential for operational disruption in sensitive environments is notable.

Mitigation Recommendations

To mitigate CVE-2022-49322, European organizations should: 1) Audit their Linux kernel versions and configurations to identify use of the PREEMPT_RT kernel variant, especially with boot parameters including "trace_event=initcall:initcall_start tp_printk=1". 2) Avoid enabling the problematic tracing boot parameters unless necessary for debugging or development purposes. 3) Apply the official patches or kernel updates that fix this vulnerability by replacing sleepable RT-spinlocks with raw spinlocks in the affected code paths. 4) Test kernel updates in staging environments to ensure stability before deployment in production, particularly in real-time or embedded systems. 5) Monitor kernel logs for signs of the described BUG or stack traces indicating sleeping functions called from invalid contexts. 6) Coordinate with Linux distribution vendors or maintainers of real-time kernel builds to receive timely updates. 7) For critical systems, consider fallback or redundancy mechanisms to maintain availability in case of kernel crashes. These steps go beyond generic advice by focusing on configuration auditing, selective tracing parameter use, and proactive patch management tailored to real-time Linux environments.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T02:08:31.537Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982dc4522896dcbe5676

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

Last enriched: 6/30/2025, 5:55:00 AM

Last updated: 7/25/2025, 8:22:36 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