]> git.ipfire.org Git - thirdparty/linux.git/commit
NFS: Fix size read races in truncate, fallocate and copy offload
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 10 Jan 2026 23:53:34 +0000 (18:53 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 15 Jan 2026 19:38:25 +0000 (14:38 -0500)
commitd5811e6297f3fd9020ac31f51fc317dfdb260cb0
treeb7660f90430787412f2fb9d575d0e68172d0b3b4
parent803e18641fd444a614415711a5af53dcde21104b
NFS: Fix size read races in truncate, fallocate and copy offload

If the pre-operation file size is read before locking the inode and
quiescing O_DIRECT writes, then nfs_truncate_last_folio() might end up
overwriting valid file data.

Fixes: b1817b18ff20 ("NFS: Protect against 'eof page pollution'")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c
fs/nfs/io.c
fs/nfs/nfs42proc.c