CVE-2022-49068: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: btrfs: release correct delalloc amount in direct IO write path Running generic/406 causes the following WARNING in btrfs_destroy_inode() which tells there are outstanding extents left. In btrfs_get_blocks_direct_write(), we reserve a temporary outstanding extents with btrfs_delalloc_reserve_metadata() (or indirectly from btrfs_delalloc_reserve_space(()). We then release the outstanding extents with btrfs_delalloc_release_extents(). However, the "len" can be modified in the COW case, which releases fewer outstanding extents than expected. Fix it by calling btrfs_delalloc_release_extents() for the original length. To reproduce the warning, the filesystem should be 1 GiB. It's triggering a short-write, due to not being able to allocate a large extent and instead allocating a smaller one. WARNING: CPU: 0 PID: 757 at fs/btrfs/inode.c:8848 btrfs_destroy_inode+0x1e6/0x210 [btrfs] Modules linked in: btrfs blake2b_generic xor lzo_compress lzo_decompress raid6_pq zstd zstd_decompress zstd_compress xxhash zram zsmalloc CPU: 0 PID: 757 Comm: umount Not tainted 5.17.0-rc8+ #101 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014 RIP: 0010:btrfs_destroy_inode+0x1e6/0x210 [btrfs] RSP: 0018:ffffc9000327bda8 EFLAGS: 00010206 RAX: 0000000000000000 RBX: ffff888100548b78 RCX: 0000000000000000 RDX: 0000000000026900 RSI: 0000000000000000 RDI: ffff888100548b78 RBP: ffff888100548940 R08: 0000000000000000 R09: ffff88810b48aba8 R10: 0000000000000001 R11: ffff8881004eb240 R12: ffff88810b48a800 R13: ffff88810b48ec08 R14: ffff88810b48ed00 R15: ffff888100490c68 FS: 00007f8549ea0b80(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f854a09e733 CR3: 000000010a2e9003 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> destroy_inode+0x33/0x70 dispose_list+0x43/0x60 evict_inodes+0x161/0x1b0 generic_shutdown_super+0x2d/0x110 kill_anon_super+0xf/0x20 btrfs_kill_super+0xd/0x20 [btrfs] deactivate_locked_super+0x27/0x90 cleanup_mnt+0x12c/0x180 task_work_run+0x54/0x80 exit_to_user_mode_prepare+0x152/0x160 syscall_exit_to_user_mode+0x12/0x30 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f854a000fb7
AI Analysis
Technical Summary
CVE-2022-49068 is a vulnerability identified in the Linux kernel's Btrfs filesystem implementation. The issue arises in the handling of delayed allocation (delalloc) extents during direct IO write operations. Specifically, the vulnerability occurs in the btrfs_get_blocks_direct_write() function, where the system reserves temporary outstanding extents using btrfs_delalloc_reserve_metadata() or indirectly via btrfs_delalloc_reserve_space(). However, in the case of copy-on-write (COW) operations, the length parameter ('len') can be modified, leading to an incorrect release of outstanding extents. This results in fewer extents being released than expected, causing warnings such as "WARNING: CPU: 0 PID: 757 at fs/btrfs/inode.c:8848 btrfs_destroy_inode" and indicating that there are outstanding extents left when destroying inodes. The root cause is that btrfs_delalloc_release_extents() is called with the modified length instead of the original length, which fails to properly release all reserved extents. This can be reproduced on a filesystem of approximately 1 GiB size, particularly when a short-write is triggered due to the inability to allocate a large extent, resulting in allocation of a smaller extent instead. While the vulnerability primarily causes warnings and potential inode destruction issues, it may lead to filesystem inconsistencies or data integrity problems under certain conditions. The patch involves ensuring that btrfs_delalloc_release_extents() is called with the original length to correctly release all outstanding extents. The vulnerability affects specific Linux kernel versions identified by their commit hashes and was published on February 26, 2025. There are no known exploits in the wild, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, the impact of CVE-2022-49068 centers on potential filesystem instability and data integrity risks when using the Btrfs filesystem on affected Linux kernel versions. Organizations relying on Btrfs for critical storage, especially in server environments, virtualization hosts, or cloud infrastructure, may experience unexpected warnings, inode destruction errors, or in worst cases, data corruption or loss. This could disrupt services, lead to downtime, or require recovery efforts. Since Btrfs is often used in enterprise Linux distributions and cloud platforms, the vulnerability could affect data centers, hosting providers, and enterprises with Linux-based storage solutions. The lack of known exploits reduces immediate risk, but the subtle nature of the bug means it could be triggered unintentionally during normal operations, especially under heavy IO workloads or specific allocation scenarios. European organizations with compliance requirements around data integrity and availability should consider this vulnerability significant, as filesystem corruption can have regulatory and operational consequences.
Mitigation Recommendations
European organizations should take the following specific mitigation steps: 1) Identify and inventory Linux systems using Btrfs filesystems, focusing on kernel versions matching the affected commits. 2) Prioritize patching and upgrading the Linux kernel to versions where the fix for CVE-2022-49068 is applied, ensuring btrfs_delalloc_release_extents() is correctly called with the original length. 3) For systems where immediate patching is not feasible, implement monitoring for Btrfs warnings related to inode destruction or outstanding extents to detect potential issues early. 4) Regularly back up critical data stored on Btrfs filesystems to enable recovery in case of corruption. 5) Test filesystem integrity using Btrfs scrub and check tools after heavy IO operations or maintenance windows. 6) Consider temporary workload adjustments to reduce direct IO write pressure on Btrfs volumes until patched. 7) Engage with Linux distribution vendors for backported patches and security advisories to ensure timely updates. These steps go beyond generic advice by emphasizing targeted detection, backup, and workload management specific to Btrfs and this vulnerability.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Poland, Italy, Spain
CVE-2022-49068: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: release correct delalloc amount in direct IO write path Running generic/406 causes the following WARNING in btrfs_destroy_inode() which tells there are outstanding extents left. In btrfs_get_blocks_direct_write(), we reserve a temporary outstanding extents with btrfs_delalloc_reserve_metadata() (or indirectly from btrfs_delalloc_reserve_space(()). We then release the outstanding extents with btrfs_delalloc_release_extents(). However, the "len" can be modified in the COW case, which releases fewer outstanding extents than expected. Fix it by calling btrfs_delalloc_release_extents() for the original length. To reproduce the warning, the filesystem should be 1 GiB. It's triggering a short-write, due to not being able to allocate a large extent and instead allocating a smaller one. WARNING: CPU: 0 PID: 757 at fs/btrfs/inode.c:8848 btrfs_destroy_inode+0x1e6/0x210 [btrfs] Modules linked in: btrfs blake2b_generic xor lzo_compress lzo_decompress raid6_pq zstd zstd_decompress zstd_compress xxhash zram zsmalloc CPU: 0 PID: 757 Comm: umount Not tainted 5.17.0-rc8+ #101 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014 RIP: 0010:btrfs_destroy_inode+0x1e6/0x210 [btrfs] RSP: 0018:ffffc9000327bda8 EFLAGS: 00010206 RAX: 0000000000000000 RBX: ffff888100548b78 RCX: 0000000000000000 RDX: 0000000000026900 RSI: 0000000000000000 RDI: ffff888100548b78 RBP: ffff888100548940 R08: 0000000000000000 R09: ffff88810b48aba8 R10: 0000000000000001 R11: ffff8881004eb240 R12: ffff88810b48a800 R13: ffff88810b48ec08 R14: ffff88810b48ed00 R15: ffff888100490c68 FS: 00007f8549ea0b80(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f854a09e733 CR3: 000000010a2e9003 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> destroy_inode+0x33/0x70 dispose_list+0x43/0x60 evict_inodes+0x161/0x1b0 generic_shutdown_super+0x2d/0x110 kill_anon_super+0xf/0x20 btrfs_kill_super+0xd/0x20 [btrfs] deactivate_locked_super+0x27/0x90 cleanup_mnt+0x12c/0x180 task_work_run+0x54/0x80 exit_to_user_mode_prepare+0x152/0x160 syscall_exit_to_user_mode+0x12/0x30 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f854a000fb7
AI-Powered Analysis
Technical Analysis
CVE-2022-49068 is a vulnerability identified in the Linux kernel's Btrfs filesystem implementation. The issue arises in the handling of delayed allocation (delalloc) extents during direct IO write operations. Specifically, the vulnerability occurs in the btrfs_get_blocks_direct_write() function, where the system reserves temporary outstanding extents using btrfs_delalloc_reserve_metadata() or indirectly via btrfs_delalloc_reserve_space(). However, in the case of copy-on-write (COW) operations, the length parameter ('len') can be modified, leading to an incorrect release of outstanding extents. This results in fewer extents being released than expected, causing warnings such as "WARNING: CPU: 0 PID: 757 at fs/btrfs/inode.c:8848 btrfs_destroy_inode" and indicating that there are outstanding extents left when destroying inodes. The root cause is that btrfs_delalloc_release_extents() is called with the modified length instead of the original length, which fails to properly release all reserved extents. This can be reproduced on a filesystem of approximately 1 GiB size, particularly when a short-write is triggered due to the inability to allocate a large extent, resulting in allocation of a smaller extent instead. While the vulnerability primarily causes warnings and potential inode destruction issues, it may lead to filesystem inconsistencies or data integrity problems under certain conditions. The patch involves ensuring that btrfs_delalloc_release_extents() is called with the original length to correctly release all outstanding extents. The vulnerability affects specific Linux kernel versions identified by their commit hashes and was published on February 26, 2025. There are no known exploits in the wild, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, the impact of CVE-2022-49068 centers on potential filesystem instability and data integrity risks when using the Btrfs filesystem on affected Linux kernel versions. Organizations relying on Btrfs for critical storage, especially in server environments, virtualization hosts, or cloud infrastructure, may experience unexpected warnings, inode destruction errors, or in worst cases, data corruption or loss. This could disrupt services, lead to downtime, or require recovery efforts. Since Btrfs is often used in enterprise Linux distributions and cloud platforms, the vulnerability could affect data centers, hosting providers, and enterprises with Linux-based storage solutions. The lack of known exploits reduces immediate risk, but the subtle nature of the bug means it could be triggered unintentionally during normal operations, especially under heavy IO workloads or specific allocation scenarios. European organizations with compliance requirements around data integrity and availability should consider this vulnerability significant, as filesystem corruption can have regulatory and operational consequences.
Mitigation Recommendations
European organizations should take the following specific mitigation steps: 1) Identify and inventory Linux systems using Btrfs filesystems, focusing on kernel versions matching the affected commits. 2) Prioritize patching and upgrading the Linux kernel to versions where the fix for CVE-2022-49068 is applied, ensuring btrfs_delalloc_release_extents() is correctly called with the original length. 3) For systems where immediate patching is not feasible, implement monitoring for Btrfs warnings related to inode destruction or outstanding extents to detect potential issues early. 4) Regularly back up critical data stored on Btrfs filesystems to enable recovery in case of corruption. 5) Test filesystem integrity using Btrfs scrub and check tools after heavy IO operations or maintenance windows. 6) Consider temporary workload adjustments to reduce direct IO write pressure on Btrfs volumes until patched. 7) Engage with Linux distribution vendors for backported patches and security advisories to ensure timely updates. These steps go beyond generic advice by emphasizing targeted detection, backup, and workload management specific to Btrfs and this vulnerability.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2025-02-26T01:49:39.244Z
- Cisa Enriched
- false
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9820c4522896dcbdd5cf
Added to database: 5/21/2025, 9:08:48 AM
Last enriched: 6/28/2025, 12:25:38 AM
Last updated: 8/17/2025, 8:38:25 AM
Views: 16
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.