9p/net: put a lower bound on msize
commit 574d356b7a02c7e1b01a1d9cba8a26b3c2888f45 upstream.
If the requested msize is too small (either from command line argument
or from the server version reply), we won't get any work done.
If it's *really* too small, nothing will work, and this got caught by
syzbot recently (on a new kmem_cache_create_usercopy() call)
Just set a minimum msize to 4k in both code paths, until someone
complains they have a use-case for a smaller msize.
We need to check in both mount option and server reply individually
because the msize for the first version request would be unchecked
with just a global check on clnt->msize.
Signed-off-by: Dominique Martinet <email@example.com>
Cc: Eric Van Hensbergen <firstname.lastname@example.org>
Cc: Latchesar Ionkov <email@example.com>
Signed-off-by: Ben Hutchings <firstname.lastname@example.org>
1 file changed