]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring/kbuf: check if target buffer list is still legacy on recycle
authorJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2026 14:59:25 +0000 (08:59 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2026 14:59:25 +0000 (08:59 -0600)
commitc2c185be5c85d37215397c8e8781abf0a69bec1f
tree904d5a38e0ecaf3e5a5805cea2e28e5cad19bda3
parent6f02c6b196036dbb6defb4647d8707d29b7fe95b
io_uring/kbuf: check if target buffer list is still legacy on recycle

There's a gap between when the buffer was grabbed and when it
potentially gets recycled, where if the list is empty, someone could've
upgraded it to a ring provided type. This can happen if the request
is forced via io-wq. The legacy recycling is missing checking if the
buffer_list still exists, and if it's of the correct type. Add those
checks.

Cc: stable@vger.kernel.org
Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers")
Reported-by: Keenan Dong <keenanat2000@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c