# CVE-2024-40962: btrfs: zoned: allocate dummy checksums for zoned NODATASUM writes

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 16, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-07-12T12:32:03.316Z
- **Modified:** 2026-06-17T07:46:58.227Z

## Who should check

- Anyone running Linux \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< 082b3d4e788953a3ff42ecdb70c4210149076285; \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< 25cfe59f4470a051d1b80f51fa0ca3a5048e4a19; \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< cebae292e0c32a228e8f2219c270a7237be24a6a
- Anyone running Linux 6.5

## Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: zoned: allocate dummy checksums for zoned NODATASUM writes

Shin'ichiro reported that when he's running fstests' test-case
btrfs/167 on emulated zoned devices, he's seeing the following NULL
pointer dereference in 'btrfs\_zone\_finish\_endio()':

  Oops: general protection fault, probably for non-canonical address 0xdffffc0000000011: 0000 \[\#1\] PREEMPT SMP KASAN NOPTI
  KASAN: null-ptr-deref in range \[0x0000000000000088-0x000000000000008f\]
  CPU: 4 PID: 2332440 Comm: kworker/u80:15 Tainted: G        W          6.10.0-rc2-kts+ \#4
  Hardware name: Supermicro Super Server/X11SPi-TF, BIOS 3.3 02/21/2020
  Workqueue: btrfs-endio-write btrfs\_work\_helper \[btrfs\]
  RIP: 0010:btrfs\_zone\_finish\_endio.part.0+0x34/0x160 \[btrfs\]

  RSP: 0018:ffff88867f107a90 EFLAGS: 00010206
  RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff893e5534
  RDX: 0000000000000011 RSI: 0000000000000004 RDI: 0000000000000088
  RBP: 0000000000000002 R08: 0000000000000001 R09: ffffed1081696028
  R10: ffff88840b4b0143 R11: ffff88834dfff600 R12: ffff88840b4b0000
  R13: 0000000000020000 R14: 0000000000000000 R15: ffff888530ad5210
  FS:  0000000000000000(0000) GS:ffff888e3f800000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007f87223fff38 CR3: 00000007a7c6a002 CR4: 00000000007706f0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  PKRU: 55555554
  Call Trace:
   \<TASK\>
   ? \_\_die\_body.cold+0x19/0x27
   ? die\_addr+0x46/0x70
   ? exc\_general\_protection+0x14f/0x250
   ? asm\_exc\_general\_protection+0x26/0x30
   ? do\_raw\_read\_unlock+0x44/0x70
   ? btrfs\_zone\_finish\_endio.part.0+0x34/0x160 \[btrfs\]
   btrfs\_finish\_one\_ordered+0x5d9/0x19a0 \[btrfs\]
   ? \_\_pfx\_lock\_release+0x10/0x10
   ? do\_raw\_write\_lock+0x90/0x260
   ? \_\_pfx\_do\_raw\_write\_lock+0x10/0x10
   ? \_\_pfx\_btrfs\_finish\_one\_ordered+0x10/0x10 \[btrfs\]
   ? \_raw\_write\_unlock+0x23/0x40
   ? btrfs\_finish\_ordered\_zoned+0x5a9/0x850 \[btrfs\]
   ? lock\_acquire+0x435/0x500
   btrfs\_work\_helper+0x1b1/0xa70 \[btrfs\]
   ? \_\_schedule+0x10a8/0x60b0
   ? \_\_pfx\_\_\_might\_resched+0x10/0x10
   process\_one\_work+0x862/0x1410
   ? \_\_pfx\_lock\_acquire+0x10/0x10
   ? \_\_pfx\_process\_one\_work+0x10/0x10
   ? assign\_work+0x16c/0x240
   worker\_thread+0x5e6/0x1010
   ? \_\_pfx\_worker\_thread+0x10/0x10
   kthread+0x2c3/0x3a0
   ? trace\_irq\_enable.constprop.0+0xce/0x110
   ? \_\_pfx\_kthread+0x10/0x10
   ret\_from\_fork+0x31/0x70
   ? \_\_pfx\_kthread+0x10/0x10
   ret\_from\_fork\_asm+0x1a/0x30
   \</TASK\>

Enabling CONFIG\_BTRFS\_ASSERT revealed the following assertion to
trigger:

  assertion failed: !list\_empty(&ordered-\>list), in fs/btrfs/zoned.c:1815

This indicates, that we're missing the checksums list on the
ordered\_extent. As btrfs/167 is doing a NOCOW write this is to be
expected.

Further analysis with drgn confirmed the assumption:

  \>\>\> inode = prog.crashed\_thread().stack\_trace()\[11\]\['ordered'\].inode
  \>\>\> btrfs\_inode = drgn.container\_of(inode, "struct btrfs\_inode", \\
         				"vfs\_inode")
  \>\>\> print(btrfs\_inode.flags)
  (u32)1

As zoned emulation mode simulates conventional zones on regular devices,
we cannot use zone-append for writing. But we're only attaching dummy
checksums if we're doing a zone-append write.

So for NOCOW zoned data writes on conventional zones, also attach a
dummy checksum.

## Affected and fixed versions

- Linux: \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< 082b3d4e788953a3ff42ecdb70c4210149076285; \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< 25cfe59f4470a051d1b80f51fa0ca3a5048e4a19; \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< cebae292e0c32a228e8f2219c270a7237be24a6a (cvelist)
- Linux: 6.5 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-40962.md
Affected: Linux >= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, < 082b3d4e788953a3ff42ecdb70c4210149076285; >= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, < 25cfe59f4470a051d1b80f51fa0ca3a5048e4a19; >= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, < cebae292e0c32a228e8f2219c270a7237be24a6a; Linux 6.5
Fixed in: Linux 082b3d4e788953a3ff42ecdb70c4210149076285, Linux 25cfe59f4470a051d1b80f51fa0ca3a5048e4a19

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.
```

## FAQ

### Is CVE-2024-40962 being exploited?

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

### How serious is CVE-2024-40962?

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

### Which versions are affected by CVE-2024-40962?

Linux \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< 082b3d4e788953a3ff42ecdb70c4210149076285; \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< 25cfe59f4470a051d1b80f51fa0ca3a5048e4a19; \>= cbfce4c7fbde23cc8bcba44822a58c728caf6ec9, \< cebae292e0c32a228e8f2219c270a7237be24a6a; Linux 6.5.

### Is there a fix for CVE-2024-40962?

Yes. Fixed in Linux 082b3d4e788953a3ff42ecdb70c4210149076285, Linux 25cfe59f4470a051d1b80f51fa0ca3a5048e4a19. No fix listed yet: follow the vendor advisory.

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

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.

## References

- patch: <https://git.kernel.org/stable/c/082b3d4e788953a3ff42ecdb70c4210149076285>
- patch: <https://git.kernel.org/stable/c/25cfe59f4470a051d1b80f51fa0ca3a5048e4a19>
- patch: <https://git.kernel.org/stable/c/cebae292e0c32a228e8f2219c270a7237be24a6a>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-40962>

HTML: <https://flawdb.com/CVE-2024-40962> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-40962>
