https://github.com/torvalds/linux
Revision 71a85387546e50b1a37b0fa45dadcae3bfb35cf6 authored by Jens Axboe on 10 December 2021, 15:29:30 UTC, committed by Jens Axboe on 10 December 2021, 20:56:28 UTC
We check IO_WQ_BIT_EXIT before attempting to create a new worker, and
wq exit cancels pending work if we have any. But it's possible to have
a race between the two, where creation checks exit finding it not set,
but we're in the process of exiting. The exit side will cancel pending
creation task_work, but there's a gap where we add task_work after we've
canceled existing creations at exit time.

Fix this by checking the EXIT bit post adding the creation task_work.
If it's set, run the same cancelation that exit does.

Reported-and-tested-by: syzbot+b60c982cb0efc5e05a47@syzkaller.appspotmail.com
Reviewed-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 78a7806
History
Tip revision: 71a85387546e50b1a37b0fa45dadcae3bfb35cf6 authored by Jens Axboe on 10 December 2021, 15:29:30 UTC
io-wq: check for wq exit after adding new worker task_work
Tip revision: 71a8538
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 16.6 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 71 bytes
.gitattributes -rw-r--r-- 62 bytes
.gitignore -rw-r--r-- 1.9 KB
.mailmap -rw-r--r-- 20.2 KB
COPYING -rw-r--r-- 496 bytes
CREDITS -rw-r--r-- 98.6 KB
Kbuild -rw-r--r-- 1.3 KB
Kconfig -rw-r--r-- 555 bytes
MAINTAINERS -rw-r--r-- 615.6 KB
Makefile -rw-r--r-- 64.1 KB
README -rw-r--r-- 727 bytes

README

back to top