linux-stable/net/9p
Christoph Hellwig e48afaff38 net/9p: validate fds in p9_fd_open
[ Upstream commit a39c46067c ]

p9_fd_open just fgets file descriptors passed in from userspace, but
doesn't verify that they are valid for read or writing.  This gets
cought down in the VFS when actually attempting a read or write, but
a new warning added in linux-next upsets syzcaller.

Fix this by just verifying the fds early on.

Link: http://lkml.kernel.org/r/20200710085722.435850-1-hch@lst.de
Reported-by: syzbot+e6f77e16ff68b2434a2c@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
[Dominique: amend goto as per Doug Nazar's review]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-21 09:47:59 +02:00
..
client.c 9p/net: fix memory leak in p9_client_create 2019-03-23 14:35:09 +01:00
error.c
Kconfig xen/9pfs: select CONFIG_XEN_XENBUS_FRONTEND 2017-05-02 11:14:36 +02: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
protocol.c 9p: p9dirent_read: check network-provided name length 2019-07-03 13:15:58 +02:00
protocol.h
trans_common.c net/9p: include trans_common.h to fix missing prototype warning. 2019-07-03 13:15:59 +02:00
trans_common.h net/9p: remove (now-)unused helpers 2015-04-11 22:28:29 -04:00
trans_fd.c net/9p: validate fds in p9_fd_open 2020-08-21 09:47:59 +02:00
trans_rdma.c 9p/rdma: remove useless check in cm_event_handler 2019-07-03 13:15:58 +02:00
trans_virtio.c 9p/virtio: Add cleanup path in p9_virtio_init 2019-07-31 07:28:39 +02:00
trans_xen.c 9p/xen: Add cleanup path in p9_trans_xen_init 2019-07-31 07:28:39 +02:00
util.c