CVE-2024-42111: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: btrfs: always do the basic checks for btrfs_qgroup_inherit structure [BUG] Syzbot reports the following regression detected by KASAN: BUG: KASAN: slab-out-of-bounds in btrfs_qgroup_inherit+0x42e/0x2e20 fs/btrfs/qgroup.c:3277 Read of size 8 at addr ffff88814628ca50 by task syz-executor318/5171 CPU: 0 PID: 5171 Comm: syz-executor318 Not tainted 6.10.0-rc2-syzkaller-00010-g2ab795141095 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 btrfs_qgroup_inherit+0x42e/0x2e20 fs/btrfs/qgroup.c:3277 create_pending_snapshot+0x1359/0x29b0 fs/btrfs/transaction.c:1854 create_pending_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1922 btrfs_commit_transaction+0xf20/0x3740 fs/btrfs/transaction.c:2382 create_snapshot+0x6a1/0x9e0 fs/btrfs/ioctl.c:875 btrfs_mksubvol+0x58f/0x710 fs/btrfs/ioctl.c:1029 btrfs_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1075 __btrfs_ioctl_snap_create+0x387/0x4b0 fs/btrfs/ioctl.c:1340 btrfs_ioctl_snap_create_v2+0x1f2/0x3a0 fs/btrfs/ioctl.c:1422 btrfs_ioctl+0x99e/0xc60 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcbf1992509 RSP: 002b:00007fcbf1928218 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fcbf1a1f618 RCX: 00007fcbf1992509 RDX: 0000000020000280 RSI: 0000000050009417 RDI: 0000000000000003 RBP: 00007fcbf1a1f610 R08: 00007ffea1298e97 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcbf19eb660 R13: 00000000200002b8 R14: 00007fcbf19e60c0 R15: 0030656c69662f2e </TASK> And it also pinned it down to commit b5357cb268c4 ("btrfs: qgroup: do not check qgroup inherit if qgroup is disabled"). [CAUSE] That offending commit skips the whole qgroup inherit check if qgroup is not enabled. But that also skips the very basic checks like num_ref_copies/num_excl_copies and the structure size checks. Meaning if a qgroup enable/disable race is happening at the background, and we pass a btrfs_qgroup_inherit structure when the qgroup is disabled, the check would be completely skipped. Then at the time of transaction commitment, qgroup is re-enabled and btrfs_qgroup_inherit() is going to use the incorrect structure and causing the above KASAN error. [FIX] Make btrfs_qgroup_check_inherit() only skip the source qgroup checks. So that even if invalid btrfs_qgroup_inherit structure is passed in, we can still reject invalid ones no matter if qgroup is enabled or not. Furthermore we do already have an extra safety inside btrfs_qgroup_inherit(), which would just ignore invalid qgroup sources, so even if we only skip the qgroup source check we're still safe.
AI Analysis
Technical Summary
CVE-2024-42111 is a vulnerability identified in the Linux kernel's Btrfs filesystem implementation, specifically within the btrfs_qgroup_inherit function. The issue arises due to improper validation checks on the btrfs_qgroup_inherit structure when quota groups (qgroups) are enabled or disabled concurrently. A recent commit (b5357cb268c4) intended to optimize qgroup inheritance checks by skipping them entirely if qgroups were disabled inadvertently bypassed essential basic validation checks such as num_ref_copies, num_excl_copies, and structure size verification. This creates a race condition where if a btrfs_qgroup_inherit structure is passed while qgroups are disabled, the checks are skipped. Later, when the transaction commits and qgroups are re-enabled, the kernel uses this unchecked, potentially malformed structure, leading to a slab-out-of-bounds read detected by Kernel Address Sanitizer (KASAN). This can cause kernel crashes or memory corruption. The fix involves modifying the btrfs_qgroup_check_inherit function to only skip source qgroup checks while still performing fundamental validations regardless of qgroup state, ensuring invalid structures are rejected and maintaining kernel stability and security. This vulnerability is rooted in concurrency and validation logic flaws within the Btrfs quota group subsystem and affects Linux kernel versions containing the specified commits.
Potential Impact
For European organizations relying on Linux systems with Btrfs filesystems, this vulnerability poses a risk of local privilege escalation or denial of service through kernel crashes or memory corruption. Since Btrfs is commonly used in enterprise Linux distributions and cloud environments, exploitation could disrupt critical services, cause data loss, or enable attackers with local access to destabilize systems. The race condition nature means exploitation requires precise timing or specific workloads, limiting remote exploitation but increasing risk in multi-tenant or shared environments such as cloud providers or data centers prevalent in Europe. Disruption of storage subsystems could impact availability of services, especially for organizations using Btrfs snapshots and quota groups for data management. While no known exploits are reported in the wild, the vulnerability's presence in the Linux kernel—a core component in European infrastructure—means that timely patching is essential to prevent potential attacks that could compromise confidentiality, integrity, or availability of systems.
Mitigation Recommendations
European organizations should prioritize updating Linux kernels to versions that include the fix for CVE-2024-42111. Specifically, ensure that kernel versions incorporate the patch that modifies btrfs_qgroup_check_inherit to enforce basic validation regardless of qgroup state. For environments where immediate patching is not feasible, consider disabling Btrfs quota groups if not in use, to reduce attack surface. Implement strict access controls to limit local user permissions, as exploitation requires local code execution. Employ kernel hardening techniques such as KASAN or other memory safety tools in development and testing environments to detect similar issues early. Monitor system logs for kernel warnings or crashes related to Btrfs qgroup operations. In cloud or multi-tenant setups, isolate workloads and restrict untrusted users from performing Btrfs snapshot or quota operations. Finally, maintain a robust patch management process to rapidly deploy kernel updates across all Linux systems.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland, Poland, Italy, Spain
CVE-2024-42111: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: btrfs: always do the basic checks for btrfs_qgroup_inherit structure [BUG] Syzbot reports the following regression detected by KASAN: BUG: KASAN: slab-out-of-bounds in btrfs_qgroup_inherit+0x42e/0x2e20 fs/btrfs/qgroup.c:3277 Read of size 8 at addr ffff88814628ca50 by task syz-executor318/5171 CPU: 0 PID: 5171 Comm: syz-executor318 Not tainted 6.10.0-rc2-syzkaller-00010-g2ab795141095 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 btrfs_qgroup_inherit+0x42e/0x2e20 fs/btrfs/qgroup.c:3277 create_pending_snapshot+0x1359/0x29b0 fs/btrfs/transaction.c:1854 create_pending_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1922 btrfs_commit_transaction+0xf20/0x3740 fs/btrfs/transaction.c:2382 create_snapshot+0x6a1/0x9e0 fs/btrfs/ioctl.c:875 btrfs_mksubvol+0x58f/0x710 fs/btrfs/ioctl.c:1029 btrfs_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1075 __btrfs_ioctl_snap_create+0x387/0x4b0 fs/btrfs/ioctl.c:1340 btrfs_ioctl_snap_create_v2+0x1f2/0x3a0 fs/btrfs/ioctl.c:1422 btrfs_ioctl+0x99e/0xc60 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcbf1992509 RSP: 002b:00007fcbf1928218 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fcbf1a1f618 RCX: 00007fcbf1992509 RDX: 0000000020000280 RSI: 0000000050009417 RDI: 0000000000000003 RBP: 00007fcbf1a1f610 R08: 00007ffea1298e97 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcbf19eb660 R13: 00000000200002b8 R14: 00007fcbf19e60c0 R15: 0030656c69662f2e </TASK> And it also pinned it down to commit b5357cb268c4 ("btrfs: qgroup: do not check qgroup inherit if qgroup is disabled"). [CAUSE] That offending commit skips the whole qgroup inherit check if qgroup is not enabled. But that also skips the very basic checks like num_ref_copies/num_excl_copies and the structure size checks. Meaning if a qgroup enable/disable race is happening at the background, and we pass a btrfs_qgroup_inherit structure when the qgroup is disabled, the check would be completely skipped. Then at the time of transaction commitment, qgroup is re-enabled and btrfs_qgroup_inherit() is going to use the incorrect structure and causing the above KASAN error. [FIX] Make btrfs_qgroup_check_inherit() only skip the source qgroup checks. So that even if invalid btrfs_qgroup_inherit structure is passed in, we can still reject invalid ones no matter if qgroup is enabled or not. Furthermore we do already have an extra safety inside btrfs_qgroup_inherit(), which would just ignore invalid qgroup sources, so even if we only skip the qgroup source check we're still safe.
AI-Powered Analysis
Technical Analysis
CVE-2024-42111 is a vulnerability identified in the Linux kernel's Btrfs filesystem implementation, specifically within the btrfs_qgroup_inherit function. The issue arises due to improper validation checks on the btrfs_qgroup_inherit structure when quota groups (qgroups) are enabled or disabled concurrently. A recent commit (b5357cb268c4) intended to optimize qgroup inheritance checks by skipping them entirely if qgroups were disabled inadvertently bypassed essential basic validation checks such as num_ref_copies, num_excl_copies, and structure size verification. This creates a race condition where if a btrfs_qgroup_inherit structure is passed while qgroups are disabled, the checks are skipped. Later, when the transaction commits and qgroups are re-enabled, the kernel uses this unchecked, potentially malformed structure, leading to a slab-out-of-bounds read detected by Kernel Address Sanitizer (KASAN). This can cause kernel crashes or memory corruption. The fix involves modifying the btrfs_qgroup_check_inherit function to only skip source qgroup checks while still performing fundamental validations regardless of qgroup state, ensuring invalid structures are rejected and maintaining kernel stability and security. This vulnerability is rooted in concurrency and validation logic flaws within the Btrfs quota group subsystem and affects Linux kernel versions containing the specified commits.
Potential Impact
For European organizations relying on Linux systems with Btrfs filesystems, this vulnerability poses a risk of local privilege escalation or denial of service through kernel crashes or memory corruption. Since Btrfs is commonly used in enterprise Linux distributions and cloud environments, exploitation could disrupt critical services, cause data loss, or enable attackers with local access to destabilize systems. The race condition nature means exploitation requires precise timing or specific workloads, limiting remote exploitation but increasing risk in multi-tenant or shared environments such as cloud providers or data centers prevalent in Europe. Disruption of storage subsystems could impact availability of services, especially for organizations using Btrfs snapshots and quota groups for data management. While no known exploits are reported in the wild, the vulnerability's presence in the Linux kernel—a core component in European infrastructure—means that timely patching is essential to prevent potential attacks that could compromise confidentiality, integrity, or availability of systems.
Mitigation Recommendations
European organizations should prioritize updating Linux kernels to versions that include the fix for CVE-2024-42111. Specifically, ensure that kernel versions incorporate the patch that modifies btrfs_qgroup_check_inherit to enforce basic validation regardless of qgroup state. For environments where immediate patching is not feasible, consider disabling Btrfs quota groups if not in use, to reduce attack surface. Implement strict access controls to limit local user permissions, as exploitation requires local code execution. Employ kernel hardening techniques such as KASAN or other memory safety tools in development and testing environments to detect similar issues early. Monitor system logs for kernel warnings or crashes related to Btrfs qgroup operations. In cloud or multi-tenant setups, isolate workloads and restrict untrusted users from performing Btrfs snapshot or quota operations. Finally, maintain a robust patch management process to rapidly deploy kernel updates across all Linux systems.
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
- 2024-07-29T15:50:41.176Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9821c4522896dcbddf92
Added to database: 5/21/2025, 9:08:49 AM
Last enriched: 6/28/2025, 4:39:49 AM
Last updated: 8/18/2025, 11:32:43 PM
Views: 16
Related Threats
CVE-2025-52287: n/a
UnknownCVE-2025-55581: n/a
HighCVE-2025-52085: n/a
HighCVE-2025-43760: CWE-79: Cross-site Scripting in Liferay Portal
MediumCVE-2025-55613: n/a
HighActions
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.