CVE & CISA-KEV Catalog

CVE-2024-35949

HIGH
7.8
CVSS v3
NVD

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: make sure that WRITTEN is set on all metadata blocks We previously would call btrfs_check_leaf() if we had the check integrity code enabled, which meant that we could only run the extended leaf checks if we had WRITTEN set on the header flags. This leaves a gap in our checking, because we could end up with corruption on disk where WRITTEN isn't set on the leaf, and then the extended leaf checks don't get run which we rely on to validate all of the item pointers to make sure we don't access memory outside of the extent buffer. However, since 732fab95abe2 ("btrfs: check-integrity: remove CONFIG_BTRFS_FS_CHECK_INTEGRITY option") we no longer call btrfs_check_leaf() from btrfs_mark_buffer_dirty(), which means we only ever call it on blocks that are being written out, and thus have WRITTEN set, or that are being read in, which should have WRITTEN set. Add checks to make sure we have WRITTEN set appropriately, and then make sure __btrfs_check_leaf() always does the item checking. This will protect us from file systems that have been corrupted and no longer have WRITTEN set on some of the blocks. This was hit on a crafted image tweaking the WRITTEN bit and reported by KASAN as out-of-bound access in the eb accessors. The example is a dir item at the end of an eb. [2.042] BTRFS warning (device loop1): bad eb member start: ptr 0x3fff start 30572544 member offset 16410 size 2 [2.040] general protection fault, probably for non-canonical address 0xe0009d1000000003: 0000 [#1] PREEMPT SMP KASAN NOPTI [2.537] KASAN: maybe wild-memory-access in range [0x0005088000000018-0x000508800000001f] [2.729] CPU: 0 PID: 2587 Comm: mount Not tainted 6.8.2 #1 [2.729] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [2.621] RIP: 0010:btrfs_get_16+0x34b/0x6d0 [2.621] RSP: 0018:ffff88810871fab8 EFLAGS: 00000206 [2.621] RAX: 0000a11000000003 RBX: ffff888104ff8720 RCX: ffff88811b2288c0 [2.621] RDX: dffffc0000000000 RSI: ffffffff81dd8aca RDI: ffff88810871f748 [2.621] RBP: 000000000000401a R08: 0000000000000001 R09: ffffed10210e3ee9 [2.621] R10: ffff88810871f74f R11: 205d323430333737 R12: 000000000000001a [2.621] R13: 000508800000001a R14: 1ffff110210e3f5d R15: ffffffff850011e8 [2.621] FS: 00007f56ea275840(0000) GS:ffff88811b200000(0000) knlGS:0000000000000000 [2.621] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [2.621] CR2: 00007febd13b75c0 CR3: 000000010bb50000 CR4: 00000000000006f0 [2.621] Call Trace: [2.621] <TASK> [2.621] ? show_regs+0x74/0x80 [2.621] ? die_addr+0x46/0xc0 [2.621] ? exc_general_protection+0x161/0x2a0 [2.621] ? asm_exc_general_protection+0x26/0x30 [2.621] ? btrfs_get_16+0x33a/0x6d0 [2.621] ? btrfs_get_16+0x34b/0x6d0 [2.621] ? btrfs_get_16+0x33a/0x6d0 [2.621] ? __pfx_btrfs_get_16+0x10/0x10 [2.621] ? __pfx_mutex_unlock+0x10/0x10 [2.621] btrfs_match_dir_item_name+0x101/0x1a0 [2.621] btrfs_lookup_dir_item+0x1f3/0x280 [2.621] ? __pfx_btrfs_lookup_dir_item+0x10/0x10 [2.621] btrfs_get_tree+0xd25/0x1910 [ copy more details from report ]

How to fix

Remediation Available
linuxDebian
Fixed in:6.8.11-1CVE-2024-35949
Fixed in:6.8.11-1CVE-2024-35949
linuxUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-awsUbuntu
Fixed in:6.8.0-1013.14USN-6949-1
linux-gcpUbuntu
Fixed in:6.8.0-1012.13USN-6949-1
linux-gkeUbuntu
Fixed in:6.8.0-1008.11USN-6949-1
linux-ibmUbuntu
Fixed in:6.8.0-1010.10USN-6949-1
linux-image-6.8.0-1008-gkeUbuntu
Fixed in:6.8.0-1008.11USN-6949-1
linux-image-6.8.0-1009-raspiUbuntu
Fixed in:6.8.0-1009.10USN-6949-2
linux-image-6.8.0-1010-ibmUbuntu
Fixed in:6.8.0-1010.10USN-6949-1
linux-image-6.8.0-1010-oemUbuntu
Fixed in:6.8.0-1010.10USN-6955-1
linux-image-6.8.0-1010-oracleUbuntu
Fixed in:6.8.0-1010.10USN-6952-1
linux-image-6.8.0-1010-oracle-64kUbuntu
Fixed in:6.8.0-1010.10USN-6952-1
linux-image-6.8.0-1011-nvidiaUbuntu
Fixed in:6.8.0-1011.11~22.04.1USN-6949-1
Fixed in:6.8.0-1011.11USN-6949-1
linux-image-6.8.0-1011-nvidia-64kUbuntu
Fixed in:6.8.0-1011.11~22.04.1USN-6949-1
Fixed in:6.8.0-1011.11USN-6949-1
linux-image-6.8.0-1011-nvidia-lowlatencyUbuntu
Fixed in:6.8.0-1011.11.1USN-6952-1
linux-image-6.8.0-1011-nvidia-lowlatency-64kUbuntu
Fixed in:6.8.0-1011.11.1USN-6952-1
linux-image-6.8.0-1012-gcpUbuntu
Fixed in:6.8.0-1012.13USN-6949-1
linux-image-6.8.0-1013-awsUbuntu
Fixed in:6.8.0-1013.14USN-6949-1
linux-image-6.8.0-40-genericUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-6.8.0-40-generic-64kUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-6.8.0-40-lowlatencyUbuntu
Fixed in:6.8.0-40.40.1USN-6949-2
linux-image-6.8.0-40-lowlatency-64kUbuntu
Fixed in:6.8.0-40.40.1USN-6949-2
linux-image-awsUbuntu
Fixed in:6.8.0-1013.14USN-6949-1
linux-image-gcpUbuntu
Fixed in:6.8.0-1012.13USN-6949-1
linux-image-genericUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-generic-64kUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-generic-64k-hwe-24.04Ubuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-generic-hwe-24.04Ubuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-generic-lpaeUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-gkeUbuntu
Fixed in:6.8.0-1008.11USN-6949-1
linux-image-ibmUbuntu
Fixed in:6.8.0-1010.10USN-6949-1
linux-image-ibm-classicUbuntu
Fixed in:6.8.0-1010.10USN-6949-1
linux-image-ibm-lts-24.04Ubuntu
Fixed in:6.8.0-1010.10USN-6949-1
linux-image-kvmUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-lowlatencyUbuntu
Fixed in:6.8.0-40.40.1USN-6949-2
linux-image-lowlatency-64kUbuntu
Fixed in:6.8.0-40.40.1USN-6949-2
linux-image-nvidiaUbuntu
Fixed in:6.8.0-1011.11USN-6949-1
linux-image-nvidia-6.8Ubuntu
Fixed in:6.8.0-1011.11~22.04.1USN-6949-1
linux-image-nvidia-64kUbuntu
Fixed in:6.8.0-1011.11USN-6949-1
linux-image-nvidia-64k-6.8Ubuntu
Fixed in:6.8.0-1011.11~22.04.1USN-6949-1
linux-image-nvidia-lowlatencyUbuntu
Fixed in:6.8.0-1011.11.1USN-6952-1
linux-image-nvidia-lowlatency-64kUbuntu
Fixed in:6.8.0-1011.11.1USN-6952-1
linux-image-oem-24.04Ubuntu
Fixed in:6.8.0-1010.10USN-6955-1
linux-image-oem-24.04aUbuntu
Fixed in:6.8.0-1010.10USN-6955-1
linux-image-oracleUbuntu
Fixed in:6.8.0-1010.10USN-6952-1
linux-image-oracle-64kUbuntu
Fixed in:6.8.0-1010.10USN-6952-1
linux-image-raspiUbuntu
Fixed in:6.8.0-1009.10USN-6949-2
linux-image-virtualUbuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-image-virtual-hwe-24.04Ubuntu
Fixed in:6.8.0-40.40USN-6949-1
linux-lowlatencyUbuntu
Fixed in:6.8.0-40.40.1USN-6949-2
linux-nvidiaUbuntu
Fixed in:6.8.0-1011.11USN-6949-1
linux-nvidia-6.8Ubuntu
Fixed in:6.8.0-1011.11~22.04.1USN-6949-1
linux-nvidia-lowlatencyUbuntu
Fixed in:6.8.0-1011.11.1USN-6952-1
linux-oem-6.8Ubuntu
Fixed in:6.8.0-1010.10USN-6955-1
linux-oracleUbuntu
Fixed in:6.8.0-1010.10USN-6952-1
linux-raspiUbuntu
Fixed in:6.8.0-1009.10USN-6949-2

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3 Vector

Exploitability

Attack VectorLocal
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeUnchanged

Impact

ConfidentialityHigh
IntegrityHigh
AvailabilityHigh

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Exploit Intelligence

0.24%probability of exploitation in 30 days
15thpercentile

Low risk: more likely to be exploited than 15% of all known CVEs.

References

Related Vulnerabilities

Other CWE-787 (Out-of-bounds Write) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2025-22457Critical9.0100%KEV + RansomFix
CVE-2025-0282Critical9.0100%KEV + Ransom-
CVE-2015-3113Critical9.8100%KEVFix
CVE-2021-20038Critical9.8100%KEV + Ransom-
CVE-2023-4863High8.8100%KEVFix
CVE-2020-16040Medium6.5100%-Fix
Embed a live status badge for CVE-2024-35949
CVE-2024-35949 severity badge

Markdown

[![CVE-2024-35949](https://tridentstack.com/cve/badge/CVE-2024-35949.svg)](https://tridentstack.com/cve/CVE-2024-35949)

HTML

<a href="https://tridentstack.com/cve/CVE-2024-35949"><img src="https://tridentstack.com/cve/badge/CVE-2024-35949.svg" alt="CVE-2024-35949"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2025-12-23.