]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix fs cleanup on cqe overflow
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 9 Apr 2020 05:17:59 +0000 (08:17 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 9 Apr 2020 15:38:18 +0000 (09:38 -0600)
commit0f208c6e5e68025eab0b17afe623bb85131f7ce4
tree9f9abd0e95912c35d5851e88edf07967c78b4d72
parent00d47e6b0c17c5937f7da9a22e320c0c711e62d3
io_uring: fix fs cleanup on cqe overflow

If completion queue overflow occurs, __io_cqring_fill_event() will
update req->cflags, which is in a union with req->work and happens to
be aliased to req->work.fs. Following io_free_req() ->
io_req_work_drop_env() may get a bunch of different problems (miscount
fs->users, segfault, etc) on cleaning @fs.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c