Skip to main content

CVE-2022-49783: Vulnerability in Linux Linux

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

Description

In the Linux kernel, the following vulnerability has been resolved: x86/fpu: Drop fpregs lock before inheriting FPU permissions Mike Galbraith reported the following against an old fork of preempt-rt but the same issue also applies to the current preempt-rt tree. 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: systemd preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: fpu_clone CPU: 6 PID: 1 Comm: systemd Tainted: G E (unreleased) Call Trace: <TASK> dump_stack_lvl ? fpu_clone __might_resched rt_spin_lock fpu_clone ? copy_thread ? copy_process ? shmem_alloc_inode ? kmem_cache_alloc ? kernel_clone ? __do_sys_clone ? do_syscall_64 ? __x64_sys_rt_sigprocmask ? syscall_exit_to_user_mode ? do_syscall_64 ? syscall_exit_to_user_mode ? do_syscall_64 ? syscall_exit_to_user_mode ? do_syscall_64 ? exc_page_fault ? entry_SYSCALL_64_after_hwframe </TASK> Mike says: The splat comes from fpu_inherit_perms() being called under fpregs_lock(), and us reaching the spin_lock_irq() therein due to fpu_state_size_dynamic() returning true despite static key __fpu_state_size_dynamic having never been enabled. Mike's assessment looks correct. fpregs_lock on a PREEMPT_RT kernel disables preemption so calling spin_lock_irq() in fpu_inherit_perms() is unsafe. This problem exists since commit 9e798e9aa14c ("x86/fpu: Prepare fpu_clone() for dynamically enabled features"). Even though the original bug report should not have enabled the paths at all, the bug still exists. fpregs_lock is necessary when editing the FPU registers or a task's FP state but it is not necessary for fpu_inherit_perms(). The only write of any FP state in fpu_inherit_perms() is for the new child which is not running yet and cannot context switch or be borrowed by a kernel thread yet. Hence, fpregs_lock is not protecting anything in the new child until clone() completes and can be dropped earlier. The siglock still needs to be acquired by fpu_inherit_perms() as the read of the parent's permissions has to be serialised. [ bp: Cleanup splat. ]

AI-Powered Analysis

AILast updated: 06/30/2025, 01:27:53 UTC

Technical Analysis

CVE-2022-49783 is a vulnerability in the Linux kernel affecting the handling of floating point unit (FPU) register permissions during process cloning, specifically in the preempt-rt (real-time) kernel variant. The issue arises from improper locking behavior in the function fpu_inherit_perms(), which is called during the cloning of processes. The vulnerability is triggered because the fpregs_lock, which disables preemption to protect FPU register state modifications, is held longer than necessary. This leads to a scenario where spin_lock_irq() is called while preemption is disabled, violating kernel locking rules and causing a BUG: sleeping function called from invalid context error. This bug manifests as a kernel panic or system crash due to improper synchronization in the FPU state inheritance code path. The root cause is that fpu_inherit_perms() unnecessarily holds the fpregs_lock while inheriting FPU permissions from the parent to the child process. Since the child process is not yet running and cannot be preempted or accessed by other kernel threads, the lock is redundant and should be dropped earlier. The siglock is still acquired to serialize reading the parent's permissions, but the fpregs_lock must be released before calling spin_lock_irq() to avoid deadlocks or invalid context errors. This vulnerability has existed since commit 9e798e9aa14c45fb94e47b30bf6347b369ce9df7, which prepared fpu_clone() for dynamically enabled features. While the original bug report was against an older preempt-rt fork, the same issue applies to the current preempt-rt tree and potentially affects all Linux kernels using this real-time patch. The vulnerability can cause system instability or crashes, particularly in environments relying on real-time kernel features. No known exploits are reported in the wild yet, and the issue is primarily a kernel code quality and synchronization bug rather than a direct security bypass or privilege escalation vector. Impact: The vulnerability can cause kernel panics or system crashes under certain conditions when cloning processes with FPU state inheritance on preempt-rt kernels. This can lead to denial of service (DoS) on affected systems. It does not directly expose confidential data or allow privilege escalation but impacts system availability and reliability. Mitigation involves applying the patch that drops the fpregs_lock before inheriting FPU permissions, ensuring proper locking discipline. Systems running preempt-rt kernels should update to the fixed kernel versions once available. Monitoring kernel logs for BUG messages related to spinlock_rt.c and fpu_clone can help detect attempts to trigger this bug.

Potential Impact

For European organizations, the primary impact of CVE-2022-49783 is the risk of denial of service due to kernel panics or crashes on systems running Linux with the preempt-rt real-time kernel patch. This is particularly relevant for industries relying on real-time processing such as telecommunications, industrial automation, automotive, aerospace, and critical infrastructure sectors. Systems that require high availability and low latency, such as control systems, embedded devices, and real-time data processing platforms, may experience unexpected downtime or instability. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can disrupt business operations, safety-critical processes, and service delivery. Organizations using customized or vendor-provided real-time Linux kernels should prioritize patching to maintain system stability. The lack of known exploits reduces immediate risk, but the potential for accidental crashes or triggered faults remains a concern. Additionally, cloud providers and data centers in Europe that offer real-time Linux environments or support workloads requiring preempt-rt kernels may face service interruptions affecting multiple customers. The vulnerability underscores the importance of rigorous kernel testing and timely patch management in real-time Linux deployments.

Mitigation Recommendations

1. Update to the latest Linux kernel versions that include the fix for CVE-2022-49783. Ensure that preempt-rt kernel trees are patched to drop the fpregs_lock before inheriting FPU permissions. 2. For organizations using vendor-supplied real-time Linux distributions, coordinate with vendors to obtain patched kernel releases or backported fixes. 3. Implement kernel crash monitoring and alerting to detect BUG messages related to spinlock_rt.c and fpu_clone, enabling rapid response to potential crashes. 4. Conduct thorough testing of real-time workloads on patched kernels in staging environments before production deployment to verify stability. 5. Limit the use of preempt-rt kernels to systems that strictly require real-time capabilities; consider fallback to standard kernels where real-time features are not essential. 6. Harden system configurations to minimize the attack surface and ensure that only trusted processes can perform cloning operations that involve FPU state inheritance. 7. Maintain comprehensive backup and recovery plans to mitigate the impact of unexpected system crashes. 8. Engage with Linux kernel maintainers and security mailing lists to stay informed about updates related to preempt-rt vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

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

Threat ID: 682d982cc4522896dcbe4b9e

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

Last enriched: 6/30/2025, 1:27:53 AM

Last updated: 7/26/2025, 3:11:29 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