diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-07-25 10:20:18 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-31 07:25:03 +0200 |
commit | 119be19fa6b647a9c70bd5d396c183b3c832f07b (patch) | |
tree | 3954ef7532fd3132ed0c6e76b78663a70fa7aed5 | |
parent | 91b4f2b6bbfd658122a5641f6fbed0a9c68c457d (diff) |
io_uring: ensure ->list is initialized for poll commands
commit 36703247d5f52a679df9da51192b6950fe81689f upstream.
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: Daniel Kozak <kozzi11@gmail.com>
Tested-by: Daniel Kozak <kozzi11@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 1ccb329927cf..294a0a76dfab 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1489,6 +1489,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); |