CVE-2026-142883: io_uring/sqpoll: don't set IO_SQ_THREAD_SHOULD_STOP on thread exit
In the Linux kernel, the following vulnerability has been resolved:
iouring/sqpoll: don't set IOSQTHREADSHOULDSTOP on thread exit
iosqthreadstop() carries a WARNONONCE() asserting that IOSQTHREADSHOULDSTOP isn't set yet, i.e. that stopping the SQPOLL thread is never attempted twice. Since commit 22d9db9fd64a ("iouring/sqpoll: don't attach to a thread that is canceling"), the SQPOLL thread itself sets that bit on its way out, so that iosqoffloadcreate() won't attach a new ring to a thread that is canceling.
When the thread exits on a fatal signal, the bit is thus set before the ring teardown gets to iosqthreadstop(), which now triggers the warning on every such exit:
WARNING: iouring/sqpoll.c:88 at iosqthreadstop Workqueue: iouexit ioringexitwork Call Trace: ioputsqdata iosqthreadfinish ioringctxfree ioringexitwork
Introduce a separate IOSQTHREADEXITING bit for the thread marking itself as on its way out, and check it in iosqoffloadcreate() along with IOSQTHREADSHOULDSTOP. IOSQTHREADSHOULDSTOP regains its original meaning, "a stop has been requested", and the WARNONONCE() holds again.
Reproduced with an SQPOLL ring and an immediate fatal signal: the warning fires on v7.3.0+ (22d9db9fd64a present) and is gone with this change.
[axboe: trim excessive comment]