Skip to content

Commit 5a1e99b

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

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
@@ -5420,6 +5420,8 @@ static int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
54205420

54215421
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
54225422
return -EINVAL;
5423+
if (unlikely(sqe->addr2 || sqe->file_index))
5424+
return -EINVAL;
54235425

54245426
sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
54255427
sr->len = READ_ONCE(sqe->len);

0 commit comments

Comments
 (0)