# CVE-2024-49868: btrfs: fix a NULL pointer dereference when failed to start a new trasacntion

> 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.36% (percentile 22, 2026-11-28)
- **CWE:** CWE-476
- **Published:** 2024-10-21T18:01:10.722Z
- **Modified:** 2026-06-17T08:00:37.190Z

## Who should check

- Anyone running Linux \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 1282f001cbf56e5dd6e90a18e205a566793f4be0; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< d73d48acf36f57362df7e4f9d76568168bf5e944; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 37fee9c220b92c3b7bf22b51c51dde5364e7590b; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< d13249c0df7aab885acb149695f82c54c0822a70; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 7ad0c5868f2f0418619089513d95230c66cb7eb4; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< dc02c1440705e3451abd1c2c8114a5c1bb188e9f; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 39356ec0e319ed07627b3a0f402d0608546509e6; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< c3b47f49e83197e8dffd023ec568403bcdbb774b
- Anyone running Linux 2.6.35

## Description

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

btrfs: fix a NULL pointer dereference when failed to start a new trasacntion

\[BUG\]
Syzbot reported a NULL pointer dereference with the following crash:

  FAULT\_INJECTION: forcing a failure.
   start\_transaction+0x830/0x1670 fs/btrfs/transaction.c:676
   prepare\_to\_relocate+0x31f/0x4c0 fs/btrfs/relocation.c:3642
   relocate\_block\_group+0x169/0xd20 fs/btrfs/relocation.c:3678
  ...
  BTRFS info (device loop0): balance: ended with status: -12
  Oops: general protection fault, probably for non-canonical address 0xdffffc00000000cc: 0000 \[\#1\] PREEMPT SMP KASAN NOPTI
  KASAN: null-ptr-deref in range \[0x0000000000000660-0x0000000000000667\]
  RIP: 0010:btrfs\_update\_reloc\_root+0x362/0xa80 fs/btrfs/relocation.c:926
  Call Trace:
   \<TASK\>
   commit\_fs\_roots+0x2ee/0x720 fs/btrfs/transaction.c:1496
   btrfs\_commit\_transaction+0xfaf/0x3740 fs/btrfs/transaction.c:2430
   del\_balance\_item fs/btrfs/volumes.c:3678 \[inline\]
   reset\_balance\_state+0x25e/0x3c0 fs/btrfs/volumes.c:3742
   btrfs\_balance+0xead/0x10c0 fs/btrfs/volumes.c:4574
   btrfs\_ioctl\_balance+0x493/0x7c0 fs/btrfs/ioctl.c:3673
   vfs\_ioctl fs/ioctl.c:51 \[inline\]
   \_\_do\_sys\_ioctl fs/ioctl.c:907 \[inline\]
   \_\_se\_sys\_ioctl+0xf9/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

\[CAUSE\]
The allocation failure happens at the start\_transaction() inside
prepare\_to\_relocate(), and during the error handling we call
unset\_reloc\_control(), which makes fs\_info-\>balance\_ctl to be NULL.

Then we continue the error path cleanup in btrfs\_balance() by calling
reset\_balance\_state() which will call del\_balance\_item() to fully delete
the balance item in the root tree.

However during the small window between set\_reloc\_contrl() and
unset\_reloc\_control(), we can have a subvolume tree update and created a
reloc\_root for that subvolume.

Then we go into the final btrfs\_commit\_transaction() of
del\_balance\_item(), and into btrfs\_update\_reloc\_root() inside
commit\_fs\_roots().

That function checks if fs\_info-\>reloc\_ctl is in the merge\_reloc\_tree
stage, but since fs\_info-\>reloc\_ctl is NULL, it results a NULL pointer
dereference.

\[FIX\]
Just add extra check on fs\_info-\>reloc\_ctl inside
btrfs\_update\_reloc\_root(), before checking
fs\_info-\>reloc\_ctl-\>merge\_reloc\_tree.

That DEAD\_RELOC\_TREE handling is to prevent further modification to the
reloc tree during merge stage, but since there is no reloc\_ctl at all,
we do not need to bother that.

## Affected and fixed versions

- Linux: \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 1282f001cbf56e5dd6e90a18e205a566793f4be0; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< d73d48acf36f57362df7e4f9d76568168bf5e944; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 37fee9c220b92c3b7bf22b51c51dde5364e7590b; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< d13249c0df7aab885acb149695f82c54c0822a70; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 7ad0c5868f2f0418619089513d95230c66cb7eb4; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< dc02c1440705e3451abd1c2c8114a5c1bb188e9f; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 39356ec0e319ed07627b3a0f402d0608546509e6; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< c3b47f49e83197e8dffd023ec568403bcdbb774b (cvelist)
- Linux: 2.6.35 (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-49868. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-49868.md
Affected: Linux >= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, < 1282f001cbf56e5dd6e90a18e205a566793f4be0; >= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, < d73d48acf36f57362df7e4f9d76568168bf5e944; >= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, < 37fee9c220b92c3b7bf22b51c51dde5364e7590b; >= 3fd0a5585eb98e074fb9934…
Fixed in: Linux 1282f001cbf56e5dd6e90a18e205a566793f4be0, Linux 37fee9c220b92c3b7bf22b51c51dde5364e7590b, Linux 7ad0c5868f2f0418619089513d95230c66cb7eb4, Linux 39356ec0e319ed07627b3a0f402d0608546509e6

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-49868 being exploited?

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

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

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

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

Linux \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 1282f001cbf56e5dd6e90a18e205a566793f4be0; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< d73d48acf36f57362df7e4f9d76568168bf5e944; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 37fee9c220b92c3b7bf22b51c51dde5364e7590b; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< d13249c0df7aab885acb149695f82c54c0822a70; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 7ad0c5868f2f0418619089513d95230c66cb7eb4; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< dc02c1440705e3451abd1c2c8114a5c1bb188e9f; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< 39356ec0e319ed07627b3a0f402d0608546509e6; \>= 3fd0a5585eb98e074fb9934549c8d85c49756c0d, \< c3b47f49e83197e8dffd023ec568403bcdbb774b; Linux 2.6.35.

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

Yes. Fixed in Linux 1282f001cbf56e5dd6e90a18e205a566793f4be0, Linux 37fee9c220b92c3b7bf22b51c51dde5364e7590b, Linux 7ad0c5868f2f0418619089513d95230c66cb7eb4, Linux 39356ec0e319ed07627b3a0f402d0608546509e6. No fix listed yet: follow the vendor advisory.

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

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/d73d48acf36f57362df7e4f9d76568168bf5e944>
- patch: <https://git.kernel.org/stable/c/37fee9c220b92c3b7bf22b51c51dde5364e7590b>
- patch: <https://git.kernel.org/stable/c/d13249c0df7aab885acb149695f82c54c0822a70>
- patch: <https://git.kernel.org/stable/c/7ad0c5868f2f0418619089513d95230c66cb7eb4>
- patch: <https://git.kernel.org/stable/c/dc02c1440705e3451abd1c2c8114a5c1bb188e9f>
- patch: <https://git.kernel.org/stable/c/39356ec0e319ed07627b3a0f402d0608546509e6>
- patch: <https://git.kernel.org/stable/c/c3b47f49e83197e8dffd023ec568403bcdbb774b>
- other: <https://git.kernel.org/stable/c/1282f001cbf56e5dd6e90a18e205a566793f4be0>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## 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-49868>

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