Do I miss something, or open/close/etc need an explicit check for IORING_SETUP_SQPOLL? E.g., now an open() request somehow returns -EFAULT, and that doesn't seem good. diff --git a/fs/io_uring.c b/fs/io_uring.c index 732ec73ec3c0..e841fd03d976 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3023,6 +3023,8 @@ static int io_openat2_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) size_t len; int ret; + if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL|IORING_SETUP_SQPOLL))) + return -EINVAL; if (sqe->ioprio || sqe->buf_index) return -EINVAL; if (req->flags & REQ_F_FIXED_FILE) @@ -3417,6 +3419,8 @@ static int io_close_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) */ req->work.flags |= IO_WQ_WORK_NO_CANCEL; + if (unlikely(req->ctx->flags & (IORING_SETUP_IOPOLL|IORING_SETUP_SQPOLL))) + return -EINVAL; if (sqe->ioprio || sqe->off || sqe->addr || sqe->len || sqe->rw_flags || sqe->buf_index) return -EINVAL; -- Pavel Begunkov