Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2024-35784

MEDIUM 5.5EPSS 9%

btrfs: fix deadlock with fiemap and extent locking

Mitigation

  • No fix listed yet: follow the vendor advisory.

Who should check

  • Anyone running Linux >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 06d3879bb51be205a04b3da752cfd121a3367fb1; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < ded566b4637f1b6b4c9ba74e7d0b8493e93f19cf; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 89bca7fe6382d61e88c67a0b0e7bce315986fb8b; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < b0ad381fa7690244802aed119b478b4bdafc31dd
  • Anyone running Linux 2.6.29

Vulnerability facts

Affected
Linux >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 06d3879bb51be205a04b3da752cfd121a3367fb1; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < ded566b4637f1b6b4c9ba74e7d0b8493e93f19cf; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 89bca7fe6382d61e88c67a0b0e7bce315986fb8b; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < b0ad381fa7690244802aed119b478b4bdafc31dd; Linux 2.6.29
Fixed in
Linux 06d3879bb51be205a04b3da752cfd121a3367fb1, Linux 89bca7fe6382d61e88c67a0b0e7bce315986fb8b
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
5.5 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: High
EPSS
0.23% chance of exploitation in 30 days (percentile 9, 2026-11-26)
CWE
CWE-667
Published
Modified

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix deadlock with fiemap and extent locking While working on the patchset to remove extent locking I got a lockdep splat with fiemap and pagefaulting with my new extent lock replacement lock. This deadlock exists with our normal code, we just don't have lockdep annotations with the extent locking so we've never noticed it. Since we're copying the fiemap extent to user space on every iteration we have the chance of pagefaulting. Because we hold the extent lock for the entire range we could mkwrite into a range in the file that we have mmap'ed. This would deadlock with the following stack trace [<0>] lock_extent+0x28d/0x2f0 [<0>] btrfs_page_mkwrite+0x273/0x8a0 [<0>] do_page_mkwrite+0x50/0xb0 [<0>] do_fault+0xc1/0x7b0 [<0>] __handle_mm_fault+0x2fa/0x460 [<0>] handle_mm_fault+0xa4/0x330 [<0>] do_user_addr_fault+0x1f4/0x800 [<0>] exc_page_fault+0x7c/0x1e0 [<0>] asm_exc_page_fault+0x26/0x30 [<0>] rep_movs_alternative+0x33/0x70 [<0>] _copy_to_user+0x49/0x70 [<0>] fiemap_fill_next_extent+0xc8/0x120 [<0>] emit_fiemap_extent+0x4d/0xa0 [<0>] extent_fiemap+0x7f8/0xad0 [<0>] btrfs_fiemap+0x49/0x80 [<0>] __x64_sys_ioctl+0x3e1/0xb50 [<0>] do_syscall_64+0x94/0x1a0 [<0>] entry_SYSCALL_64_after_hwframe+0x6e/0x76 I wrote an fstest to reproduce this deadlock without my replacement lock and verified that the deadlock exists with our existing locking. To fix this simply don't take the extent lock for the entire duration of the fiemap. This is safe in general because we keep track of where we are when we're searching the tree, so if an ordered extent updates in the middle of our fiemap call we'll still emit the correct extents because we know what offset we were on before. The only place we maintain the lock is searching delalloc. Since the delalloc stuff can change during writeback we want to lock the extent range so we have a consistent view of delalloc at the time we're checking to see if we need to set the delalloc flag. With this patch applied we no longer deadlock with my testcase.

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 06d3879bb51be205a04b3da752cfd121a3367fb1; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < ded566b4637f1b6b4c9ba74e7d0b8493e93f19cf; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 89bca7fe6382d61e88c67a0b0e7bce315986fb8b; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < b0ad381fa7690244802aed119b478b4bdafc31dd—cvelist
Linux2.6.29—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2024-35784. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-35784.md
Affected: Linux >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 06d3879bb51be205a04b3da752cfd121a3367fb1; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < ded566b4637f1b6b4c9ba74e7d0b8493e93f19cf; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 89bca7fe6382d61e88c67a0b0e7bce315986fb8b; >= 1506fcc8189cdd4b95e06df…
Fixed in: Linux 06d3879bb51be205a04b3da752cfd121a3367fb1, Linux 89bca7fe6382d61e88c67a0b0e7bce315986fb8b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2024-35784 being exploited?

There is no confirmed exploitation: CVE-2024-35784 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2024-35784?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by CVE-2024-35784?

Linux >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 06d3879bb51be205a04b3da752cfd121a3367fb1; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < ded566b4637f1b6b4c9ba74e7d0b8493e93f19cf; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < 89bca7fe6382d61e88c67a0b0e7bce315986fb8b; >= 1506fcc8189cdd4b95e06df7845a09f18b4526a6, < b0ad381fa7690244802aed119b478b4bdafc31dd; Linux 2.6.29.

Is there a fix for CVE-2024-35784?

Yes. Fixed in Linux 06d3879bb51be205a04b3da752cfd121a3367fb1, Linux 89bca7fe6382d61e88c67a0b0e7bce315986fb8b. No fix listed yet: follow the vendor advisory.

How do I check if I'm affected by CVE-2024-35784?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors