linux-stable/net/9p
Dominique Martinet 6bf97c01b9 9p/net: put a lower bound on msize
commit 574d356b7a 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.

Link: http://lkml.kernel.org/r/1541407968-31350-1-git-send-email-asmadeus@codewreck.org
Reported-by: syzbot+0c1d61e4db7db94102ca@syzkaller.appspotmail.com
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13 09:51:08 +01:00
..
client.c 9p/net: put a lower bound on msize 2019-01-13 09:51:08 +01:00
error.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
Kconfig IB: Revert "remove redundant INFINIBAND kconfig dependencies" 2018-05-28 10:40:16 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mod.c net:mod: remove unneeded variable 'ret' in init_p9 2018-08-08 09:40:44 -07:00
protocol.c 9p: clear dangling pointers in p9stat_free 2018-11-21 09:19:12 +01:00
protocol.h
trans_common.c net/9p: correct some comment errors in 9p file system code 2018-05-10 08:21:53 -04:00
trans_common.h net/9p: remove (now-)unused helpers 2015-04-11 22:28:29 -04:00
trans_fd.c 9p: fix multiple NULL-pointer-dereferences 2018-08-13 09:34:58 +09:00
trans_rdma.c Pull request for inclusion in 4.19, take two 2018-08-17 17:27:58 -07:00
trans_virtio.c 9p/virtio: fix off-by-one error in sg list bounds check 2018-08-13 09:35:28 +09:00
trans_xen.c 9p: fix multiple NULL-pointer-dereferences 2018-08-13 09:34:58 +09:00
util.c 9p: fix whitespace issues 2018-08-13 09:34:58 +09:00