Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322109
b: refs/heads/master
c: cff298c
h: refs/heads/master
i:
  322107: 703fb23
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 16, 2012
1 parent 93a00d7 commit affd165
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b291f1b1c86aa0c7bc3df2994e6a1a4e53f1fde0
refs/heads/master: cff298c721099c9ac4cea7196a37097ba2847946
11 changes: 6 additions & 5 deletions trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5045,18 +5045,19 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req,
struct nfs_getaclres *res)
{
unsigned int savep;
__be32 *bm_p;
uint32_t attrlen,
bitmap[3] = {0};
int status;
unsigned int pg_offset;

res->acl_len = 0;
if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0)
goto out;

xdr_enter_page(xdr, xdr->buf->page_len);

bm_p = xdr->p;
/* Calculate the offset of the page data */
pg_offset = xdr->buf->head[0].iov_len;

if ((status = decode_attr_bitmap(xdr, bitmap)) != 0)
goto out;
Expand All @@ -5070,18 +5071,18 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req,
/* The bitmap (xdr len + bitmaps) and the attr xdr len words
* are stored with the acl data to handle the problem of
* variable length bitmaps.*/
res->acl_data_offset = (xdr->p - bm_p) << 2;
res->acl_data_offset = xdr_stream_pos(xdr) - pg_offset;

/* We ignore &savep and don't do consistency checks on
* the attr length. Let userspace figure it out.... */
res->acl_len = attrlen;
if (attrlen + res->acl_data_offset > xdr->buf->page_len) {
if (attrlen > (xdr->nwords << 2)) {
if (res->acl_flags & NFS4_ACL_LEN_REQUEST) {
/* getxattr interface called with a NULL buf */
goto out;
}
dprintk("NFS: acl reply: attrlen %u > page_len %u\n",
attrlen, xdr->buf->page_len);
attrlen, xdr->nwords << 2);
return -EINVAL;
}
} else
Expand Down

0 comments on commit affd165

Please sign in to comment.