]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/msg_ring: kill alloc_cache for io_kiocb allocations
authorJens Axboe <axboe@kernel.dk>
Thu, 18 Sep 2025 20:16:53 +0000 (14:16 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:13:48 +0000 (11:13 +0200)
commit93e9d0293d3b4c247873c19ffe9426154bb82b9e
treef9b6c1db6045dcc5d79a309f4b1920d10236e610
parente6b2b4a0ffd856b5f0291b14ccd2f83319c15ef8
io_uring/msg_ring: kill alloc_cache for io_kiocb allocations

Commit df8922afc37aa2111ca79a216653a629146763ad upstream.

A recent commit:

fc582cd26e88 ("io_uring/msg_ring: ensure io_kiocb freeing is deferred for RCU")

fixed an issue with not deferring freeing of io_kiocb structs that
msg_ring allocates to after the current RCU grace period. But this only
covers requests that don't end up in the allocation cache. If a request
goes into the alloc cache, it can get reused before it is sane to do so.
A recent syzbot report would seem to indicate that there's something
there, however it may very well just be because of the KASAN poisoning
that the alloc_cache handles manually.

Rather than attempt to make the alloc_cache sane for that use case, just
drop the usage of the alloc_cache for msg_ring request payload data.

Fixes: 50cf5f3842af ("io_uring/msg_ring: add an alloc cache for io_kiocb entries")
Link: https://lore.kernel.org/io-uring/68cc2687.050a0220.139b6.0005.GAE@google.com/
Reported-by: syzbot+baa2e0f4e02df602583e@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/io_uring_types.h
io_uring/io_uring.c
io_uring/msg_ring.c