]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/kbuf: reallocate buf lists on upgrade
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 12 Feb 2025 13:46:46 +0000 (13:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:47 +0000 (14:01 +0100)
commit7d0dc28dae836caf7645fef62a10befc624dd17b
tree9b7eeb5fd40b8ae0a9da289343f918ed4d1183bd
parent13129b1fbfff5f94291f98c8fec7875e099a2ae6
io_uring/kbuf: reallocate buf lists on upgrade

commit 8802766324e1f5d414a81ac43365c20142e85603 upstream.

IORING_REGISTER_PBUF_RING can reuse an old struct io_buffer_list if it
was created for legacy selected buffer and has been emptied. It violates
the requirement that most of the field should stay stable after publish.
Always reallocate it instead.

Cc: stable@vger.kernel.org
Reported-by: Pumpkin Chang <pumpkin@devco.re>
Fixes: 2fcabce2d7d34 ("io_uring: disallow mixed provided buffer group registrations")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/kbuf.c