]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/cmd: let cmds to know about dying task
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 4 Nov 2024 16:12:04 +0000 (16:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:13:47 +0000 (11:13 +0200)
commit9b71bfefc405100f91c08618a248a4dd64e41b2d
tree41908dba291fe4a29416bc71fa869d8861b6f57f
parent9ffc5f132a35bd7d7a9258913d4cfe36277e2db1
io_uring/cmd: let cmds to know about dying task

Commit df3b8ca604f224eb4cd51669416ad4d607682273 upstream.

When the taks that submitted a request is dying, a task work for that
request might get run by a kernel thread or even worse by a half
dismantled task. We can't just cancel the task work without running the
callback as the cmd might need to do some clean up, so pass a flag
instead. If set, it's not safe to access any task resources and the
callback is expected to cancel the cmd ASAP.

Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/io_uring_types.h
io_uring/uring_cmd.c