diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-08-26 11:44:43 -0700 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-06 11:11:53 -0400 |
commit | 1f1ea6c2d9d8c0be9ec56454b05315273b5de8ce (patch) | |
tree | 4718cdc2e494f18ab13c2c8f09930953b77c31ff /include | |
parent | 21f498c2f73bd6150d82931f09965826dca0b5f2 (diff) | |
download | linux-stable-1f1ea6c2d9d8c0be9ec56454b05315273b5de8ce.tar.gz linux-stable-1f1ea6c2d9d8c0be9ec56454b05315273b5de8ce.tar.bz2 linux-stable-1f1ea6c2d9d8c0be9ec56454b05315273b5de8ce.zip |
NFSv4: Fix buffer overflow checking in __nfs4_get_acl_uncached
Pass the checks made by decode_getacl back to __nfs4_get_acl_uncached
so that it knows if the acl has been truncated.
The current overflow checking is broken, resulting in Oopses on
user-triggered nfs4_getfacl calls, and is opaque to the point
where several attempts at fixing it have failed.
This patch tries to clean up the code in addition to fixing the
Oopses by ensuring that the overflow checks are performed in
a single place (decode_getacl). If the overflow check failed,
we will still be able to report the acl length, but at least
we will no longer attempt to cache the acl or copy the
truncated contents to user space.
Reported-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Tested-by: Sachin Prabhu <sprabhu@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfs_xdr.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index ac7c8ae254f2..be9cf3c7e79e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -652,7 +652,7 @@ struct nfs_getaclargs { }; /* getxattr ACL interface flags */ -#define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */ +#define NFS4_ACL_TRUNC 0x0001 /* ACL was truncated */ struct nfs_getaclres { size_t acl_len; size_t acl_data_offset; |