diff --git a/fs/io_uring.c b/fs/io_uring.c index 1bf1ea2cd8b0..48c9a550e48c 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4786,6 +4786,8 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) return -EINVAL; + if (unlikely(sqe->addr2 || sqe->file_index)) + return -EINVAL; sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); sr->len = READ_ONCE(sqe->len);