]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't leak creds on SQO attach error
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 18 Mar 2021 11:54:35 +0000 (11:54 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Mar 2021 15:44:35 +0000 (09:44 -0600)
commit84e871a9c3a0dec97121a5770cbd319beeccde9f
tree825ae49269672936357ee4e265b31db25d6ecf64
parentcd3f3767405b7aad857a105f935dadb83ee67106
io_uring: don't leak creds on SQO attach error

Attaching to already dead/dying SQPOLL task is disallowed in
io_sq_offload_create(), but cleanup is hand coded by calling
io_put_sq_data()/etc., that miss to put ctx->sq_creds.

Defer everything to error-path io_sq_thread_finish(), adding
ctx->sqd_list in the error case as well as finish will handle it.

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