]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring/io-wq: only free worker if it was allocated for creation
authorJens Axboe <axboe@kernel.dk>
Sun, 8 Jan 2023 17:39:17 +0000 (10:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:33 +0000 (11:58 +0100)
commit33357f0f4b63fb62d933c967552b4e96a9cacd11
tree238f16d533d2946bc115273dcb32c69b3b1ba0e9
parent2c8c66409d8089cf749f3d1db26b7c447f45d66e
io_uring/io-wq: only free worker if it was allocated for creation

commit d0bcb674a4e4a672701c53ef464098abdd03e6d5 upstream.

We have two types of task_work based creation, one is using an existing
worker to setup a new one (eg when going to sleep and we have no free
workers), and the other is allocating a new worker. Only the latter
should be freed when we cancel task_work creation for a new worker.

Fixes: 6b05c7c8dcc7 ("io_uring/io-wq: free worker if task_work creation is canceled")
Reported-by: syzbot+d56ec896af3637bdb7e4@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io-wq.c