Skip to content

Commit

Permalink
NFSv4: Fix open coded xdr_stream_remaining()
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Dec 2, 2020
1 parent eee1f54 commit 1706846
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5337,11 +5337,11 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req,
res->acl_len = attrlen;

/* Check for receive buffer overflow */
if (res->acl_len > (xdr->nwords << 2) ||
if (res->acl_len > xdr_stream_remaining(xdr) ||
res->acl_len + res->acl_data_offset > xdr->buf->page_len) {
res->acl_flags |= NFS4_ACL_TRUNC;
dprintk("NFS: acl reply: attrlen %u > page_len %u\n",
attrlen, xdr->nwords << 2);
dprintk("NFS: acl reply: attrlen %u > page_len %zu\n",
attrlen, xdr_stream_remaining(xdr));
}
} else
status = -EOPNOTSUPP;
Expand Down

0 comments on commit 1706846

Please sign in to comment.