# CVE-2026-53122: btrfs: fix deadlock between reflink and transaction commit when using flushoncommit

> 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.13% (percentile 1, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2026-06-24T16:30:51.941Z
- **Modified:** 2026-10-30T13:19:11.143Z

## Who should check

- Anyone running Linux \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 5446d3e7676d73737f8dca816a956ede8ac24921; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 1034251715a3474d8615232a032ed0e3451ae6ec; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 73be4a08306bb84f4d5d16f62cb80e1543109ffa; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 9a24f0000876b8755cf21972b41632f4d6f3dafb; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 6f0f9c0a368aa1fe078109091322d3b0632d9380; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< b48c980b6a7e409050bb3067165db31cc6205e3e
- Anyone running Linux 5.7

## Description

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

btrfs: fix deadlock between reflink and transaction commit when using flushoncommit

When using the flushoncommit mount option, we can have a deadlock between
a transaction commit and a reflink operation that copied an inline extent
to an offset beyond the current i\_size of the destination node.

The deadlock happens like this:

1) Task A clones an inline extent from inode X to an offset of inode Y
   that is beyond Y's current i\_size. This means we copied the inline
   extent's data to a folio of inode Y that is beyond its EOF, using a
   call to copy\_inline\_to\_page();

2) Task B starts a transaction commit and calls
   btrfs\_start\_delalloc\_flush() to flush delalloc;

3) The delalloc flushing sees the new dirty folio of inode Y and when it
   attempts to flush it, it ends up at extent\_writepage() and sees that
   the offset of the folio is beyond the i\_size of inode Y, so it attempts
   to invalidate the folio by calling folio\_invalidate(), which ends up at
   btrfs' folio invalidate callback - btrfs\_invalidate\_folio(). There it
   tries to lock the folio's range in inode Y's extent io tree, but it
   blocks since it's currently locked by task A - during a reflink we lock
   the inodes and the source and destination ranges after flushing all
   delalloc and waiting for ordered extent completion - after that we
   don't expect to have dirty folios in the ranges, the exception is if
   we have to copy an inline extent's data (because the destination offset
   is not zero);

4) Task A then attempts to start a transaction to update the inode item,
   and then it's blocked since the current transaction is in the
   TRANS\_STATE\_COMMIT\_START state. Therefore task A has to wait for the
   current transaction to become unblocked (its state \>=
   TRANS\_STATE\_UNBLOCKED).

   So task A is waiting for the transaction commit done by task B, and
   the later waiting on the extent lock of inode Y that is currently
   held by task A.

Syzbot recently reported this with the following stack traces:

  INFO: task kworker/u8:7:1053 blocked for more than 143 seconds.
        Not tainted syzkaller \#0
  "echo 0 \> /proc/sys/kernel/hung\_task\_timeout\_secs" disables this message.
  task:kworker/u8:7    state:D stack:23520 pid:1053  tgid:1053  ppid:2      task\_flags:0x4208060 flags:0x00080000
  Workqueue: writeback wb\_workfn (flush-btrfs-46)
  Call Trace:
   \<TASK\>
   context\_switch kernel/sched/core.c:5298 \[inline\]
   \_\_schedule+0x1553/0x5240 kernel/sched/core.c:6911
   \_\_schedule\_loop kernel/sched/core.c:6993 \[inline\]
   schedule+0x164/0x360 kernel/sched/core.c:7008
   wait\_extent\_bit fs/btrfs/extent-io-tree.c:811 \[inline\]
   btrfs\_lock\_extent\_bits+0x59c/0x700 fs/btrfs/extent-io-tree.c:1914
   btrfs\_lock\_extent fs/btrfs/extent-io-tree.h:152 \[inline\]
   btrfs\_invalidate\_folio+0x43d/0xc40 fs/btrfs/inode.c:7704
   extent\_writepage fs/btrfs/extent\_io.c:1852 \[inline\]
   extent\_write\_cache\_pages fs/btrfs/extent\_io.c:2580 \[inline\]
   btrfs\_writepages+0x12ff/0x2440 fs/btrfs/extent\_io.c:2713
   do\_writepages+0x32e/0x550 mm/page-writeback.c:2554
   \_\_writeback\_single\_inode+0x133/0x11a0 fs/fs-writeback.c:1750
   writeback\_sb\_inodes+0x995/0x19d0 fs/fs-writeback.c:2042
   wb\_writeback+0x456/0xb70 fs/fs-writeback.c:2227
   wb\_do\_writeback fs/fs-writeback.c:2374 \[inline\]
   wb\_workfn+0x41a/0xf60 fs/fs-writeback.c:2414
   process\_one\_work kernel/workqueue.c:3276 \[inline\]
   process\_scheduled\_works+0xb6e/0x18c0 kernel/workqueue.c:3359
   worker\_thread+0xa53/0xfc0 kernel/workqueue.c:3440
   kthread+0x388/0x470 kernel/kthread.c:436
   ret\_from\_fork+0x51e/0xb90 arch/x86/kernel/process.c:158
   ret\_from\_fork\_asm+0x1a/0x30 arch/x86/entry/entry\_64.S:245
   \</TASK\>
  INFO: task syz.4.64:6910 blocked for more than 143 seconds.
        Not tainted syzkaller \#0
  "echo 0 \> /proc/sys/kernel/hung\_task\_timeout\_secs" disables this message.
  task:syz.4.64        state:D stack:22752 pid:6910  tgid:
---truncated---

## Affected and fixed versions

- Linux: \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 5446d3e7676d73737f8dca816a956ede8ac24921; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 1034251715a3474d8615232a032ed0e3451ae6ec; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 73be4a08306bb84f4d5d16f62cb80e1543109ffa; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 9a24f0000876b8755cf21972b41632f4d6f3dafb; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 6f0f9c0a368aa1fe078109091322d3b0632d9380; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< b48c980b6a7e409050bb3067165db31cc6205e3e (cvelist)
- Linux: 5.7 (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-2026-53122. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-53122.md
Affected: Linux >= 05a5a7621ce66c142e081ffc24dd6ade6e912061, < 5446d3e7676d73737f8dca816a956ede8ac24921; >= 05a5a7621ce66c142e081ffc24dd6ade6e912061, < 1034251715a3474d8615232a032ed0e3451ae6ec; >= 05a5a7621ce66c142e081ffc24dd6ade6e912061, < 73be4a08306bb84f4d5d16f62cb80e1543109ffa; >= 05a5a7621ce66c142e081ff…
Fixed in: Linux 5446d3e7676d73737f8dca816a956ede8ac24921, Linux 1034251715a3474d8615232a032ed0e3451ae6ec, Linux 73be4a08306bb84f4d5d16f62cb80e1543109ffa, Linux 9a24f0000876b8755cf21972b41632f4d6f3dafb, Linux 6f0f9c0a368aa1fe078109091322d3b0632d9380

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-2026-53122 being exploited?

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

### How serious is CVE-2026-53122?

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

### Which versions are affected by CVE-2026-53122?

Linux \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 5446d3e7676d73737f8dca816a956ede8ac24921; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 1034251715a3474d8615232a032ed0e3451ae6ec; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 73be4a08306bb84f4d5d16f62cb80e1543109ffa; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 9a24f0000876b8755cf21972b41632f4d6f3dafb; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< 6f0f9c0a368aa1fe078109091322d3b0632d9380; \>= 05a5a7621ce66c142e081ffc24dd6ade6e912061, \< b48c980b6a7e409050bb3067165db31cc6205e3e; Linux 5.7.

### Is there a fix for CVE-2026-53122?

Yes. Fixed in Linux 5446d3e7676d73737f8dca816a956ede8ac24921, Linux 1034251715a3474d8615232a032ed0e3451ae6ec, Linux 73be4a08306bb84f4d5d16f62cb80e1543109ffa, Linux 9a24f0000876b8755cf21972b41632f4d6f3dafb, Linux 6f0f9c0a368aa1fe078109091322d3b0632d9380. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-53122?

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/73be4a08306bb84f4d5d16f62cb80e1543109ffa>
- patch: <https://git.kernel.org/stable/c/9a24f0000876b8755cf21972b41632f4d6f3dafb>
- patch: <https://git.kernel.org/stable/c/6f0f9c0a368aa1fe078109091322d3b0632d9380>
- patch: <https://git.kernel.org/stable/c/b48c980b6a7e409050bb3067165db31cc6205e3e>
- other: <https://git.kernel.org/stable/c/5446d3e7676d73737f8dca816a956ede8ac24921>
- other: <https://git.kernel.org/stable/c/1034251715a3474d8615232a032ed0e3451ae6ec>

## 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-2026-53122>

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