]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix use-after-free by io_cleanup_req()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 18 Feb 2020 21:19:09 +0000 (00:19 +0300)
committerJens Axboe <axboe@kernel.dk>
Wed, 19 Feb 2020 00:12:23 +0000 (17:12 -0700)
commitfd45ea8541953aa75adb0aa38edee29a790b295f
tree0d485e68f97162440e341abbafc3aa268b7fcd0b
parent025f124f6346565546242eecf9963cb0379c82eb
io_uring: fix use-after-free by io_cleanup_req()

io_cleanup_req() should be called before req->io is freed, and so
shouldn't be after __io_free_req() -> __io_req_aux_free(). Also,
it will be ignored for in io_free_req_many(), which use
__io_req_aux_free().

Place cleanup_req() into __io_req_aux_free().

Fixes: e27ba219edebfc2 ("io_uring: fix iovec leaks")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c