CVE-2026-139198: ceph: wait for pending fscache write in write_folio_nounlock()
In the Linux kernel, the following vulnerability has been resolved:
ceph: wait for pending fscache write in writefolionounlock()
writefolionounlock() marks the folio with PGprivate2 via cephsetpagefscache() and starts an async write to the cache via cephfscachewritetocache(). PGprivate2 is only cleared once that write completes.
If the OSD write fails, the error paths return without waiting for the cache write. On retry, cephfindincompatible() would wait for writeback, but not for PGprivate2, before calling writefolionounlock() again, which would trip the VMBUGONFOLIO() in foliostartprivate2().
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 cephfoliowaitfscache(), a wrapper for foliowaitprivate2(), and use it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.6-1 - Compensating control
In the Ceph kernel client, add ceph_folio_wait_fscache() as a wrapper for folio_wait_private_2() and use it to wait for pending cache writes before starting writeback and before bumping the writeback congestion count.
Event History
Frequently Asked Questions
Under what conditions can this issue be triggered?
The failure path requires a Ceph OSD write to fail while an asynchronous FS-Cache write for the same folio is still pending. A subsequent retry of writeback on that folio can then reach the VM_BUG_ON_FOLIO() check.
What configurations are exposed?
Systems using the Linux kernel Ceph client with FS-Cache activity are implicated, because the fault involves an asynchronous cache write tracked with PG_private_2. The provided information does not identify whether FS-Cache is enabled by default.
What does the fix change?
The fix waits for any pending FS-Cache write on the folio before starting writeback again. It performs that wait before increasing writeback congestion accounting or allocating a potentially mempool-backed OSD request.