]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring: remove superfluous check for sqe->off in io_accept()
authorHrvoje Zeba <zeba.hrvoje@gmail.com>
Mon, 25 Nov 2019 19:40:22 +0000 (14:40 -0500)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:11 +0000 (19:56 -0700)
This field contains a pointer to addrlen and checking to see if it's set
returns -EINVAL if the caller sets addr & addrlen pointers.

Fixes: 17f2fe35d080 ("io_uring: add support for IORING_OP_ACCEPT")
Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index b6c6fdc12de7d8901d63d233a96b6203f0cb7d7f..7412fdefa35a034dd3008fb0c9dd2b909758c0df 100644 (file)
@@ -1965,7 +1965,7 @@ static int io_accept(struct io_kiocb *req, const struct io_uring_sqe *sqe,
 
        if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL|IORING_SETUP_SQPOLL)))
                return -EINVAL;
-       if (sqe->ioprio || sqe->off || sqe->len || sqe->buf_index)
+       if (sqe->ioprio || sqe->len || sqe->buf_index)
                return -EINVAL;
 
        addr = (struct sockaddr __user *) (unsigned long) READ_ONCE(sqe->addr);