CVE-2026-99111: smb: client: fix data corruption with concurrent writes and O_TRUNC
In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix data corruption with concurrent writes and OTRUNC
cifsdotruncate() flushes dirty pages with filemapwriteandwait() and truncates the file on the server, but in the old code both operations ran without holding irwsem or invalidatelock. A concurrent buffered write via netfsperformwrite() -- which only needs irwsem shared -- could dirty new pages after the flush but before the local truncation, and those pages would be silently discarded by cifssetsize() -> truncatepagecache().
Fix by acquiring inodelock (exclusive irwsem) and filemapinvalidatelock at the top of cifsdotruncate(), so the entire flush-truncate-resize sequence is atomic with respect to:
- buffered writes (blocked by exclusive irwsem, since netfsstartiowrite takes irwsem shared), - read page faults (blocked by exclusive invalidatelock, since filemapfault takes it shared), - writeback collection (blocked by netfswbbegin/netfswbend around the server truncate and local resize, since netfswritepages also acquires the wb lock).