nfsd4: fix discarded security labels on setattr
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 1 Nov 2013 14:42:15 +0000 (10:42 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 1 Nov 2013 17:40:46 +0000 (13:40 -0400)
Security labels in setattr calls are currently ignored because we forget
to set label->len.

Cc: stable@vger.kernel.org
Reported-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 83db5a742aa9caf471c984fa616fc4645761d104..d9d7fa94967f89beef97614c28f967f21ff7b88a 100644 (file)
@@ -411,6 +411,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
                label->data = kzalloc(dummy32 + 1, GFP_KERNEL);
                if (!label->data)
                        return nfserr_jukebox;
+               label->len = dummy32;
                defer_free(argp, kfree, label->data);
                memcpy(label->data, buf, dummy32);
        }