diff --git a/fs/9p/acl.c b/fs/9p/acl.c index eed551d8555f..1b9681d58f8d 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c @@ -28,6 +28,8 @@ static struct posix_acl *v9fs_fid_get_acl(struct p9_fid *fid, const char *name) return ERR_PTR(size); if (size == 0) return ERR_PTR(-ENODATA); + if (size > KMALLOC_MAX_SIZE) + return ERR_PTR(-ERANGE); value = kzalloc(size, GFP_NOFS); if (!value)