]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix double poll leak on repolling
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 21 Jun 2022 23:00:37 +0000 (00:00 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jun 2022 23:24:37 +0000 (17:24 -0600)
commitd0facd4a9de41b3e8019df1e8f9b4e241a3d26f4
tree723417ce412a2f0e0835c9e6b587b0707d1c2989
parenta4a07bfef47044f0d4c2aa6100dfa8bfdfb011a3
io_uring: fix double poll leak on repolling

We have re-polling for partial IO, so a request can be polled twice. If
it used two poll entries the first time then on the second
io_arm_poll_handler() it will find the old apoll entry and NULL
kmalloc()'ed second entry, i.e. apoll->double_poll, so leaking it.

Fixes: c262088356e8c ("io_uring: allow re-poll if we made progress")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/fee2452494222ecc7f1f88c8fb659baef971414a.1655852245.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c