]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Clamp WRITE offsets
authorChuck Lever <chuck.lever@oracle.com>
Tue, 25 Jan 2022 21:36:22 +0000 (16:36 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Wed, 9 Feb 2022 14:24:01 +0000 (09:24 -0500)
commit5254b4f64fa1effc8418c21091377db19ecf4c97
tree08f0fa649fbfd2676938db6885fd58a3248bbc9a
parenta53d6f4d3892d786f51170eda438c78202646f92
NFSD: Clamp WRITE offsets

Ensure that a client cannot specify a WRITE range that falls in a
byte range outside what the kernel's internal types (such as loff_t,
which is signed) can represent. The kiocb iterators, invoked in
nfsd_vfs_write(), should properly limit write operations to within
the underlying file system's s_maxbytes.

Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs3proc.c
fs/nfsd/nfs4proc.c