# CVE-2022-49068: btrfs: release correct delalloc amount in direct IO write path

> 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.28% (percentile 13, 2026-11-26)
- **Published:** 2025-02-26T01:54:35.340Z
- **Modified:** 2026-06-17T05:16:59.537Z

## Who should check

- Anyone running Linux \>= 5afd80c393f4e87451f14eefb7f2f24daf434e06, \< 07cacfd9d9dc134557ac8866c73d570a59b3d1f3; \>= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, \< a04d37ddfe4be431b9e52e8504490376ab0a39a4; \>= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, \< 6d82ad13c4110e73c7b0392f00534a1502a1b520; 96f1be29492d9e2fb97bb27f824478ab8cd3ab86; \>= 5.15.27, \< 5.15.35; \>= 5.16.13, \< 5.17
- Anyone running Linux 5.17

## Description

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

btrfs: release correct delalloc amount in direct IO write path

Running generic/406 causes the following WARNING in btrfs\_destroy\_inode()
which tells there are outstanding extents left.

In btrfs\_get\_blocks\_direct\_write(), we reserve a temporary outstanding
extents with btrfs\_delalloc\_reserve\_metadata() (or indirectly from
btrfs\_delalloc\_reserve\_space(()). We then release the outstanding extents
with btrfs\_delalloc\_release\_extents(). However, the "len" can be modified
in the COW case, which releases fewer outstanding extents than expected.

Fix it by calling btrfs\_delalloc\_release\_extents() for the original length.

To reproduce the warning, the filesystem should be 1 GiB.  It's
triggering a short-write, due to not being able to allocate a large
extent and instead allocating a smaller one.

  WARNING: CPU: 0 PID: 757 at fs/btrfs/inode.c:8848 btrfs\_destroy\_inode+0x1e6/0x210 \[btrfs\]
  Modules linked in: btrfs blake2b\_generic xor lzo\_compress
  lzo\_decompress raid6\_pq zstd zstd\_decompress zstd\_compress xxhash zram
  zsmalloc
  CPU: 0 PID: 757 Comm: umount Not tainted 5.17.0-rc8+ \#101
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014
  RIP: 0010:btrfs\_destroy\_inode+0x1e6/0x210 \[btrfs\]
  RSP: 0018:ffffc9000327bda8 EFLAGS: 00010206
  RAX: 0000000000000000 RBX: ffff888100548b78 RCX: 0000000000000000
  RDX: 0000000000026900 RSI: 0000000000000000 RDI: ffff888100548b78
  RBP: ffff888100548940 R08: 0000000000000000 R09: ffff88810b48aba8
  R10: 0000000000000001 R11: ffff8881004eb240 R12: ffff88810b48a800
  R13: ffff88810b48ec08 R14: ffff88810b48ed00 R15: ffff888100490c68
  FS:  00007f8549ea0b80(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007f854a09e733 CR3: 000000010a2e9003 CR4: 0000000000370eb0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   \<TASK\>
   destroy\_inode+0x33/0x70
   dispose\_list+0x43/0x60
   evict\_inodes+0x161/0x1b0
   generic\_shutdown\_super+0x2d/0x110
   kill\_anon\_super+0xf/0x20
   btrfs\_kill\_super+0xd/0x20 \[btrfs\]
   deactivate\_locked\_super+0x27/0x90
   cleanup\_mnt+0x12c/0x180
   task\_work\_run+0x54/0x80
   exit\_to\_user\_mode\_prepare+0x152/0x160
   syscall\_exit\_to\_user\_mode+0x12/0x30
   do\_syscall\_64+0x42/0x80
   entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
   RIP: 0033:0x7f854a000fb7

## Affected and fixed versions

- Linux: \>= 5afd80c393f4e87451f14eefb7f2f24daf434e06, \< 07cacfd9d9dc134557ac8866c73d570a59b3d1f3; \>= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, \< a04d37ddfe4be431b9e52e8504490376ab0a39a4; \>= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, \< 6d82ad13c4110e73c7b0392f00534a1502a1b520; 96f1be29492d9e2fb97bb27f824478ab8cd3ab86; \>= 5.15.27, \< 5.15.35; \>= 5.16.13, \< 5.17 (cvelist)
- Linux: 5.17 (cvelist)

## Mitigation

- Upgrade Linux to 5.17 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49068.md
Affected: Linux >= 5afd80c393f4e87451f14eefb7f2f24daf434e06, < 07cacfd9d9dc134557ac8866c73d570a59b3d1f3; >= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, < a04d37ddfe4be431b9e52e8504490376ab0a39a4; >= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, < 6d82ad13c4110e73c7b0392f00534a1502a1b520; 96f1be29492d9e2fb97bb27f82…
Fixed in: Linux 07cacfd9d9dc134557ac8866c73d570a59b3d1f3, Linux 6d82ad13c4110e73c7b0392f00534a1502a1b520, Linux 5.15.35, Linux 5.17

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-2022-49068 being exploited?

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

### How serious is CVE-2022-49068?

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

### Which versions are affected by CVE-2022-49068?

Linux \>= 5afd80c393f4e87451f14eefb7f2f24daf434e06, \< 07cacfd9d9dc134557ac8866c73d570a59b3d1f3; \>= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, \< a04d37ddfe4be431b9e52e8504490376ab0a39a4; \>= f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f, \< 6d82ad13c4110e73c7b0392f00534a1502a1b520; 96f1be29492d9e2fb97bb27f824478ab8cd3ab86; \>= 5.15.27, \< 5.15.35; \>= 5.16.13, \< 5.17; Linux 5.17.

### Is there a fix for CVE-2022-49068?

Yes. Fixed in Linux 07cacfd9d9dc134557ac8866c73d570a59b3d1f3, Linux 6d82ad13c4110e73c7b0392f00534a1502a1b520, Linux 5.15.35, Linux 5.17. Upgrade Linux to 5.17 or later.

### How do I check if I'm affected by CVE-2022-49068?

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/07cacfd9d9dc134557ac8866c73d570a59b3d1f3>
- patch: <https://git.kernel.org/stable/c/a04d37ddfe4be431b9e52e8504490376ab0a39a4>
- patch: <https://git.kernel.org/stable/c/6d82ad13c4110e73c7b0392f00534a1502a1b520>

## 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-2022-49068>

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