]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
nfsd4: reject "negative" acl lengths
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 26 Mar 2013 18:11:13 +0000 (14:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 17:04:35 +0000 (10:04 -0700)
commit 64a817cfbded8674f345d1117b117f942a351a69 upstream.

Since we only enforce an upper bound, not a lower bound, a "negative"
length can get through here.

The symptom seen was a warning when we attempt to a kmalloc with an
excessive size.

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4xdr.c

index 967d68eef28216fc4f6dd52aa519fe2fee2f9e06..ace674593e065dd17d2eccf87a54f67b4c56b11b 100644 (file)
@@ -263,7 +263,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
                iattr->ia_valid |= ATTR_SIZE;
        }
        if (bmval[0] & FATTR4_WORD0_ACL) {
-               int nace;
+               u32 nace;
                struct nfs4_ace *ace;
 
                READ_BUF(4); len += 4;