]> git.hungrycats.org Git - linux/commit
io_uring/net: ensure async prep handlers always initialize ->done_io
authorJens Axboe <axboe@kernel.dk>
Fri, 15 Mar 2024 22:36:23 +0000 (16:36 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:49:52 +0000 (09:49 +0200)
commit29aa8e4dff9b3e68af891c17f436ed56dab39a4d
tree444dc24a23c441f68cb8110cbd63318147a191c3
parenta460592e430cab2cffc9b0fbcaeed2b136133585
io_uring/net: ensure async prep handlers always initialize ->done_io

[ Upstream commit f3a640cca951ef9715597e68f5363afc0f452a88 ]

If we get a request with IOSQE_ASYNC set, then we first run the prep
async handlers. But if we then fail setting it up and want to post
a CQE with -EINVAL, we use ->done_io. This was previously guarded with
REQ_F_PARTIAL_IO, and the normal setup handlers do set it up before any
potential errors, but we need to cover the async setup too.

Fixes: 9817ad85899f ("io_uring/net: remove dependency on REQ_F_PARTIAL_IO for sr->done_io")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/net.c