diff options
author | J. Bruce Fields <bfields@redhat.com> | 2021-03-18 20:03:22 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2021-03-22 10:19:04 -0400 |
commit | e7a833e9cc6c3b58fe94f049d2b40943cba07086 (patch) | |
tree | 405d81b441122ed85459846765355cee5024c489 /fs | |
parent | 792a5112aa90e59c048b601c6382fe3498d75db7 (diff) |
nfsd: don't ignore high bits of copy count
Note size_t is 32-bit on a 32-bit architecture, but cp_count is defined
by the protocol to be 64 bit, so we could be turning a large copy into a
0-length copy here.
Reported-by: <radchenkoy@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d7b100a1e306..edcb380fbf12 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1383,7 +1383,7 @@ static void nfsd4_init_copy_res(struct nfsd4_copy *copy, bool sync) static ssize_t _nfsd_copy_file_range(struct nfsd4_copy *copy) { ssize_t bytes_copied = 0; - size_t bytes_total = copy->cp_count; + u64 bytes_total = copy->cp_count; u64 src_pos = copy->cp_src_pos; u64 dst_pos = copy->cp_dst_pos; |