projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ee6310
)
NFSv4.2: decode_read_plus_data() must skip padding after data segment
author
Trond Myklebust
<trond.myklebust@hammerspace.com>
Tue, 8 Dec 2020 12:40:04 +0000
(07:40 -0500)
committer
Trond Myklebust
<trond.myklebust@hammerspace.com>
Mon, 14 Dec 2020 11:51:07 +0000
(06:51 -0500)
All XDR opaque object sizes are 32-bit aligned, and a data segment is no
exception.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs42xdr.c
patch
|
blob
|
history
diff --git
a/fs/nfs/nfs42xdr.c
b/fs/nfs/nfs42xdr.c
index 1c21db640f4d933210bc30e58df47c89823b9862..4c6bce3dbaebaeacc537d5f8e2d7cf6d67ea1f34 100644
(file)
--- a/
fs/nfs/nfs42xdr.c
+++ b/
fs/nfs/nfs42xdr.c
@@
-1038,7
+1038,9
@@
static int decode_read_plus_data(struct xdr_stream *xdr, struct nfs_pgio_res *re
p = xdr_decode_hyper(p, &offset);
count = be32_to_cpup(p);
- recvd = xdr_align_data(xdr, res->count, count);
+ recvd = xdr_align_data(xdr, res->count, xdr_align_size(count));
+ if (recvd > count)
+ recvd = count;
res->count += recvd;
if (count > recvd) {