CVE-2026-139198
published high CVSS 3.1 · 7.0ceph: wait for pending fscache write in write_folio_nounlock()
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux1702e79734104d711a84ff55bd6a93c21947bc01 to < 50144d879dd560f8159bd2693c27117682831cea · 1702e79734104d711a84ff55bd6a93c21947bc01 to < ae64bc161e68feb6b83a331db45af372e02f3470 · 1702e79734104d711a84ff55bd6a93c21947bc01 to < c335168835626e75adb726a35b82d0c50abe16d1 · 1702e79734104d711a84ff55bd6a93c21947bc01 to < 3f7655f0d9186656c6f1cbc012a39c866d4aaabf · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.17 (affected) · 0 to < 5.17 (unaffected · semver) · 6.12.120 through 6.12.* (unaffected · semver) · 6.18.65 through 6.18.* (unaffected · semver) · 7.3.6 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Pending Fix | Not stated | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: ceph: wait for pending fscache write in write_folio_nounlock() write_folio_nounlock() marks the folio with PG_private_2 via ceph_set_page_fscache() and starts an async write to the cache via ceph_fscache_write_to_cache(). PG_private_2 is only cleared once that write completes. If the OSD write fails, the error paths return without waiting for the cache write. On retry, ceph_find_incompatible() would wait for writeback, but not for PG_private_2, before calling write_folio_nounlock() again, which would trip the VM_BUG_ON_FOLIO() in folio_start_private_2(). Wait for any pending cache write before starting writeback on the folio. Do so before bumping the writeback congestion count and allocating the possibly mempool-backed OSD request, so that a thread sleeping on the cache I/O does not hold either while it waits. Add ceph_folio_wait_fscache(), a wrapper for folio_wait_private_2(), and use it.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.0 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The double folio_start_private_2() happens in write_folio_nounlock(), called only from ceph_find_incompatible() during a local write() (netfs_write_begin check_write_begin hook) or an mmap write fault (ceph_page_mkwrite). The retry it needs comes from a local SIGKILL (-ERESTARTSYS in ceph_osdc_wait_request), and no OSD or MDS message supplies the bad state. AC:H - The bug needs a CONFIG_CEPH_FSCACHE kernel with an fsc mount and cachefilesd, plus a folio left dirty under an older snapshot context that is the oldest. The second write_folio_nounlock() must also start before the first cachefiles write, whose latency the attacker does not control, runs fscache_wreq_done(). PR:L - Any local user who can write to a file on an existing cephfs fsc mount can drive ceph_find_incompatible() and SIGKILL their own writer. Mounting ceph needs init-namespace CAP_SYS_ADMIN (ceph_fs_type has no FS_USERNS_MOUNT), so the attacker relies on an existing mount. UI:N - No victim action is needed; the attacker issues the writes, the SIGKILL and the truncate against their own file on an already-mounted filesystem. S:U - The corruption stays in kernel page-cache folio refcounts inside the same kernel security authority; no guest/host or other boundary is crossed. C:H - Without DEBUG_VM the second start takes an extra folio ref and sets an already-set bit. The first completion clears PG_private_2 early, so truncate frees the folio, and __fscache_clear_page_bits() walks i_pages by index and puts whatever folio is now there: a page-cache use-after-free that can expose freed page contents. I:H - The unbalanced folio_end_private_2() put on a newly inserted folio frees a page that is still mapped in the page cache, a page-level use-after-free whose reuse lets the attacker write to memory reallocated for other kernel or user data. A:H - With CONFIG_DEBUG_VM, folio_start_private_2() hits VM_BUG_ON_FOLIO(folio_test_private_2) and the kernel BUGs. Without it, the folio refcount imbalance leads to a page-cache use-after-free and crashes.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 1702e79734104d711a84ff55bd6a93c21947bc01 to < 50144d879dd560f8159bd2693c27117682831cea (affected · git)1702e79734104d711a84ff55bd6a93c21947bc01 to < ae64bc161e68feb6b83a331db45af372e02f3470 (affected · git)1702e79734104d711a84ff55bd6a93c21947bc01 to < c335168835626e75adb726a35b82d0c50abe16d1 (affected · git)1702e79734104d711a84ff55bd6a93c21947bc01 to < 3f7655f0d9186656c6f1cbc012a39c866d4aaabf (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.17 (affected)0 to < 5.17 (unaffected · semver)6.12.120 through 6.12.* (unaffected · semver)6.18.65 through 6.18.* (unaffected · semver)7.3.6 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
ceph: wait for pending fscache write in write_folio_nounlock()
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 7ecc4bb976dbacccaad877ec0b7e3e0f3f79230feee30a6a1c9ff438b055c248
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record