summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust2012-08-14 23:30:10 +0200
committerTrond Myklebust2012-08-16 22:15:50 +0200
commit519d3959e30a98f8e135e7a16647c10af5ad63d5 (patch)
tree95d4ba3b32892b4145f6054684102c83aca65025 /fs/nfs/nfs4proc.c
parentNFS: Alias the nfs module to nfs4 (diff)
downloadkernel-qcow2-linux-519d3959e30a98f8e135e7a16647c10af5ad63d5.tar.gz
kernel-qcow2-linux-519d3959e30a98f8e135e7a16647c10af5ad63d5.tar.xz
kernel-qcow2-linux-519d3959e30a98f8e135e7a16647c10af5ad63d5.zip
NFSv4: Fix pointer arithmetic in decode_getacl
Resetting the cursor xdr->p to a previous value is not a safe practice: if the xdr_stream has crossed out of the initial iovec, then a bunch of other fields would need to be reset too. Fix this issue by using xdr_enter_page() so that the buffer gets page aligned at the bitmap _before_ we decode it. Also fix the confusion of the ACL length with the page buffer length by not adding the base offset to the ACL length... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c77d296bdaa6..286ab7078413 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3819,7 +3819,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
if (ret)
goto out_free;
- acl_len = res.acl_len - res.acl_data_offset;
+ acl_len = res.acl_len;
if (acl_len > args.acl_len)
nfs4_write_cached_acl(inode, NULL, 0, acl_len);
else