Commit 36703247 authored by Jens Axboe's avatar Jens Axboe

io_uring: ensure ->list is initialized for poll commands

Daniel reports that when testing an http server that uses io_uring
to poll for incoming connections, sometimes it hard crashes. This is
due to an uninitialized list member for the io_uring request. Normally
this doesn't trigger and none of the test cases caught it.
Reported-by: default avatarDaniel Kozak <kozzi11@gmail.com>
Tested-by: default avatarDaniel Kozak <kozzi11@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 77ce56e2
......@@ -1666,6 +1666,8 @@ static int io_poll_add(struct io_kiocb *req, const struct io_uring_sqe *sqe)
INIT_LIST_HEAD(&poll->wait.entry);
init_waitqueue_func_entry(&poll->wait, io_poll_wake);
INIT_LIST_HEAD(&req->list);
mask = vfs_poll(poll->file, &ipt.pt) & poll->events;
spin_lock_irq(&ctx->completion_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment