btrfs: fix deadlock between reflink and transaction commit when using flushoncommit
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
CVE-2026-53122
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-53122
Linux
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Linux
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "05a5a7621ce66c142e081ffc24dd6ade6e912061",
"lessThan": "1034251715a3474d8615232a032ed0e3451ae6ec",
"versionType": "git"
},
{
"status": "affected",
"version": "05a5a7621ce66c142e081ffc24dd6ade6e912061",
"lessThan": "73be4a08306bb84f4d5d16f62cb80e1543109ffa",
"versionType": "git"
},
{
"status": "affected",
"version": "05a5a7621ce66c142e081ffc24dd6ade6e912061",
"lessThan": "9a24f0000876b8755cf21972b41632f4d6f3dafb",
"versionType": "git"
},
{
"status": "affected",
"version": "05a5a7621ce66c142e081ffc24dd6ade6e912061",
"lessThan": "6f0f9c0a368aa1fe078109091322d3b0632d9380",
"versionType": "git"
},
{
"status": "affected",
"version": "05a5a7621ce66c142e081ffc24dd6ade6e912061",
"lessThan": "b48c980b6a7e409050bb3067165db31cc6205e3e",
"versionType": "git"
}
],
"programFiles": [
"fs/btrfs/reflink.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "5.7"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "5.7",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "6.6.160",
"versionType": "semver",
"lessThanOrEqual": "6.6.*"
},
{
"status": "unaffected",
"version": "6.12.91",
"versionType": "semver",
"lessThanOrEqual": "6.12.*"
},
{
"status": "unaffected",
"version": "6.18.33",
"versionType": "semver",
"lessThanOrEqual": "6.18.*"
},
{
"status": "unaffected",
"version": "7.0.10",
"versionType": "semver",
"lessThanOrEqual": "7.0.*"
},
{
"status": "unaffected",
"version": "7.1",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"fs/btrfs/reflink.c"
],
"defaultStatus": "affected"
}
]- Related CVEs
- CVE-2026-53122
Source reference:
/cveMetadata/cveId
Publisher severity
No explicit severity was provided.
- Event
- #46371 · Revision 1
- Added to Heist Feed
- Publisher date