Re: [PATCH] net/9p: validate fds in p9_fd_open

From: Dominique Martinet
Date: Fri Jul 10 2020 - 07:12:51 EST


Christoph Hellwig wrote on Fri, Jul 10, 2020:
> 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 attemping a read or write, but a
> new warning added in linux-next upsets syzcaller.
>
> Fix this by just verifying the fds early on.
>
> Reported-by: syzbot+e6f77e16ff68b2434a2c@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Looks good to me, I'll pick it up shortly.

--
Dominique