Skip to content

Commit 588faa1

Browse files
committed
io_uring: check reserved fields for send/sendmsg
We should check unused fields for non-zero and -EINVAL if they are set, making it consistent with other opcodes. Fixes: 0fa03c6 ("io_uring: add support for sendmsg()") Signed-off-by: Jens Axboe <[email protected]>
1 parent c071354 commit 588faa1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/io_uring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5207,6 +5207,8 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
52075207

52085208
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
52095209
return -EINVAL;
5210+
if (unlikely(sqe->addr2 || sqe->file_index))
5211+
return -EINVAL;
52105212

52115213
sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
52125214
sr->len = READ_ONCE(sqe->len);

0 commit comments

Comments
 (0)