Skip to main content

CVE-2022-49033: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-49033cvecve-2022-49033
Published: Mon Oct 21 2024 (10/21/2024, 20:06:36 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: qgroup: fix sleep from invalid context bug in btrfs_qgroup_inherit() Syzkaller reported BUG as follows: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 Call Trace: <TASK> dump_stack_lvl+0xcd/0x134 __might_resched.cold+0x222/0x26b kmem_cache_alloc+0x2e7/0x3c0 update_qgroup_limit_item+0xe1/0x390 btrfs_qgroup_inherit+0x147b/0x1ee0 create_subvol+0x4eb/0x1710 btrfs_mksubvol+0xfe5/0x13f0 __btrfs_ioctl_snap_create+0x2b0/0x430 btrfs_ioctl_snap_create_v2+0x25a/0x520 btrfs_ioctl+0x2a1c/0x5ce0 __x64_sys_ioctl+0x193/0x200 do_syscall_64+0x35/0x80 Fix this by calling qgroup_dirty() on @dstqgroup, and update limit item in btrfs_run_qgroups() later outside of the spinlock context.

AI-Powered Analysis

AILast updated: 07/01/2025, 01:40:38 UTC

Technical Analysis

CVE-2022-49033 is a vulnerability identified in the Linux kernel's Btrfs filesystem implementation, specifically within the quota group (qgroup) management code. The issue arises in the function btrfs_qgroup_inherit(), where a sleeping function is called from an invalid context, violating kernel concurrency and scheduling rules. The bug was reported by the Syzkaller fuzzing tool, which detected a BUG triggered by calling a sleeping function while holding a spinlock or in an atomic context, which is not allowed. The stack trace indicates that the problem occurs during the allocation of memory caches (kmem_cache_alloc) while updating quota group limits, which is part of the process of creating subvolumes or snapshots in Btrfs (btrfs_mksubvol and btrfs_ioctl_snap_create). The root cause is that qgroup_dirty() was called on the destination quota group (@dstqgroup) while still holding a spinlock, leading to a sleep in an invalid context. The fix involves deferring the update of the limit item until after the spinlock is released, specifically by moving the update to btrfs_run_qgroups() outside the spinlock context. This vulnerability affects Linux kernel versions identified by the commit hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and likely related versions before the patch was applied. No known exploits are reported in the wild as of now, and no CVSS score has been assigned. The vulnerability could cause kernel crashes or instability when Btrfs quota groups are manipulated, potentially leading to denial of service (DoS) conditions. Exploitation requires local access and the ability to perform Btrfs subvolume or snapshot creation operations, which typically requires elevated privileges.

Potential Impact

For European organizations, the impact of CVE-2022-49033 primarily revolves around system stability and availability. Organizations using Linux servers with Btrfs filesystems and quota groups enabled could experience kernel panics or crashes if the vulnerability is triggered, leading to denial of service. This could disrupt critical services, especially in environments relying on Btrfs for storage management, such as cloud providers, hosting services, and enterprises using Linux-based infrastructure. While the vulnerability does not directly expose confidentiality or integrity risks, the resulting service outages could affect business continuity and operational reliability. Additionally, if exploited by a malicious insider or attacker with local access, it could be used as a vector to escalate disruption or cover tracks by causing system instability. Given the prevalence of Linux in European data centers, telecom, and government infrastructure, the risk of operational impact is significant if unpatched systems are present. However, the requirement for local privilege and specific filesystem usage limits the scope of impact compared to remote code execution vulnerabilities.

Mitigation Recommendations

European organizations should prioritize patching Linux kernels to versions that include the fix for CVE-2022-49033. Specifically, updating to kernel versions that incorporate the commit correcting the qgroup_dirty() call outside the spinlock context is essential. Organizations should audit their Linux systems to identify those using Btrfs with quota groups enabled and assess whether subvolume or snapshot creation operations are performed regularly. Where possible, restrict local access to trusted administrators and enforce strict privilege separation to reduce the risk of exploitation. Monitoring kernel logs for BUG messages related to sleeping in invalid contexts can help detect attempts to trigger this vulnerability. For environments where immediate patching is not feasible, consider disabling Btrfs quota groups temporarily if this does not impact operations critically. Additionally, implement robust backup and recovery procedures to mitigate the impact of potential system crashes. Finally, maintain up-to-date intrusion detection and endpoint protection systems to monitor for suspicious local activity that might attempt to exploit kernel vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-08-22T01:27:53.653Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982fc4522896dcbe69af

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

Last enriched: 7/1/2025, 1:40:38 AM

Last updated: 8/5/2025, 6:25:16 AM

Views: 14

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