Skip to content
Commit a39c4606 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dominique Martinet
Browse files

net/9p: validate fds in p9_fd_open

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: default avatar <syzbot+e6f77e16ff68b2434a2c@syzkaller.appspotmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
[Dominique: amend goto as per Doug Nazar's review]
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent 11ba4688
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment