diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:26:27 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 11:26:27 -0400 |
| commit | ddfb43f3881edb47aa0083651ad31983cdc42c33 (patch) | |
| tree | 7128cb13b599d2903a4deb05bbae37508b1c261e /fs/nfs/nfs4xdr.c | |
| parent | 2d6d649a2e0fa0268c0d03d5b1d330ca7907d33c (diff) | |
| parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) | |
| download | olio-linux-3.10-ddfb43f3881edb47aa0083651ad31983cdc42c33.tar.xz olio-linux-3.10-ddfb43f3881edb47aa0083651ad31983cdc42c33.zip | |
Merge tag 'v3.6-rc6' into for-3.7
Linux 3.6-rc6 has all our bug fixes.
Conflicts (trivial overlap):
sound/soc/omap/am3517evm.c
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 1bfbd67c556..8dba6bd4855 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -5072,18 +5072,14 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, * are stored with the acl data to handle the problem of * variable length bitmaps.*/ 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 > (xdr->nwords << 2)) { - if (res->acl_flags & NFS4_ACL_LEN_REQUEST) { - /* getxattr interface called with a NULL buf */ - goto out; - } + + /* Check for receive buffer overflow */ + if (res->acl_len > (xdr->nwords << 2) || + 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); - return -EINVAL; } } else status = -EOPNOTSUPP; @@ -6229,7 +6225,8 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr, status = decode_open(xdr, res); if (status) goto out; - if (decode_getfh(xdr, &res->fh) != 0) + status = decode_getfh(xdr, &res->fh); + if (status) goto out; decode_getfattr(xdr, res->f_attr, res->server); out: |