CVE-2026-138976: fuse: don't drop destination page cache on a zero byte copy reply
In the Linux kernel, the following vulnerability has been resolved:
fuse: don't drop destination page cache on a zero byte copy reply
fusecopyfilerange() clears the destination page cache after the server replies:
truncateinodepagesrange(inodeout->imapping, ALIGNDOWN(posout, PAGESIZE), ALIGN(posout + bytescopied, PAGESIZE) - 1);
A server may legitimately reply that it copied nothing, eg if the source file turns out to be shorter than the size the kernel has cached for it.
If posout is 0 as well, the end of the range is ALIGN(0, PAGESIZE) - 1, which is -1. lend is a uofft and truncateinodepagesrange() takes -1 as its end of file sentinel, so rather than clearing nothing it drops every folio in the destination mapping.
That is not only a cache drop. truncatecleanupfolio() calls foliocanceldirty(), and fusewritebackrange() only wrote back [posout, posout + len - 1], so dirty data elsewhere in the destination file is discarded without ever reaching the server.
Skip the call when the server copied nothing, since there is nothing stale to clear in that case.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel FUSE copy-file-range path, skip the destination page-cache clearing call when the server reports that zero bytes were copied.