Check reserved flags for send/recv
Jens Axboe
maintainercover Check reserved flags for send/recv
Hi,
For some reason we don't check reserved fields for send/sendmsg and recv/recvmsg. We don't use them either, but we should check and -EINVAL if they are set.
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerPATCH 1/2 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 0fa03c624d8f ("io_uring: add support for sendmsg()")
Signed-off-by Jens Axboe <[email protected]>
--- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
fs/io_uring.c +2 -0
@@ -5300,6 +5300,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);
Signature · 1 line
2.35.1
Jens Axboe
maintainerPATCH 2/2 io_uring: check reserved fields for recv/recvmsg
In reply to Jens AxboeWe should check unused fields for non-zero and -EINVAL if they are set, making it consistent with other opcodes.
Fixes aa1fa28fc73e ("io_uring: add support for recvmsg()")
Signed-off-by Jens Axboe <[email protected]>
--- fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+)
fs/io_uring.c +2 -0
@@ -5535,6 +5535,8 @@ static int io_recvmsg_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);
Signature · 1 line
2.35.1