aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/callback_xdr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 726e59a9e50f..d50b2742f23b 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -305,6 +305,10 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
305 n = ntohl(*p++); 305 n = ntohl(*p++);
306 if (n <= 0) 306 if (n <= 0)
307 goto out; 307 goto out;
308 if (n > ULONG_MAX / sizeof(*args->devs)) {
309 status = htonl(NFS4ERR_BADXDR);
310 goto out;
311 }
308 312
309 args->devs = kmalloc(n * sizeof(*args->devs), GFP_KERNEL); 313 args->devs = kmalloc(n * sizeof(*args->devs), GFP_KERNEL);
310 if (!args->devs) { 314 if (!args->devs) {