]> Pileus Git - ~andy/linux/blobdiff - fs/nfs/callback_xdr.c
NFSv4: Replace state_owner->so_owner_id with an ida based allocator
[~andy/linux] / fs / nfs / callback_xdr.c
index 726e59a9e50f6ad20471895793efdb171aed7dd7..d50b2742f23baeb20d54c44d6919ed126faf74c8 100644 (file)
@@ -305,6 +305,10 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
        n = ntohl(*p++);
        if (n <= 0)
                goto out;
+       if (n > ULONG_MAX / sizeof(*args->devs)) {
+               status = htonl(NFS4ERR_BADXDR);
+               goto out;
+       }
 
        args->devs = kmalloc(n * sizeof(*args->devs), GFP_KERNEL);
        if (!args->devs) {