Skip to content

Commit 44100ed

Browse files
isilencegregkh
authored andcommitted
io_uring/timeout: check unused sqe fields
commit 484ae63 upstream. Zero check unused SQE fields addr3 and pad2 for timeout and timeout update requests. They're not needed now, but could be used sometime in the future. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2f4809a commit 44100ed

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

io_uring/timeout.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ int io_timeout_remove_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
428428

429429
if (unlikely(req->flags & (REQ_F_FIXED_FILE | REQ_F_BUFFER_SELECT)))
430430
return -EINVAL;
431+
if (sqe->addr3 || sqe->__pad2[0])
432+
return -EINVAL;
431433
if (sqe->buf_index || sqe->len || sqe->splice_fd_in)
432434
return -EINVAL;
433435

@@ -500,6 +502,8 @@ static int __io_timeout_prep(struct io_kiocb *req,
500502
unsigned flags;
501503
u32 off = READ_ONCE(sqe->off);
502504

505+
if (sqe->addr3 || sqe->__pad2[0])
506+
return -EINVAL;
503507
if (sqe->buf_index || sqe->len != 1 || sqe->splice_fd_in)
504508
return -EINVAL;
505509
if (off && is_timeout_link)

0 commit comments

Comments
 (0)