diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 55ba26186351..cc65330ee684 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -302,6 +302,10 @@ int v9fs_parse_param(struct fs_context *fc, struct fs_parameter *param) p9_debug(P9_DEBUG_ERROR, "msize should be at least 4k\n"); return -EINVAL; } + if (result.uint_32 > INT_MAX) { + p9_debug(P9_DEBUG_ERROR, "msize too big\n"); + return -EINVAL; + } clnt->msize = result.uint_32; break; case Opt_trans: