]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ublk: don't take ublk_queue in ublk_unregister_io_buf()
authorCaleb Sander Mateos <csander@purestorage.com>
Fri, 20 Jun 2025 15:10:02 +0000 (09:10 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Jul 2025 02:13:42 +0000 (20:13 -0600)
commit2da1e7bb3f7230b71ce22df05494b6a4453b4e79
tree0aded5e227f9ca00f594ff54c3c7111b6bc194c5
parent2b53d4e994b934796b7376150130ab2b3577fa1e
ublk: don't take ublk_queue in ublk_unregister_io_buf()

UBLK_IO_UNREGISTER_IO_BUF currently requires a valid q_id and tag to be
passed in the ublksrv_io_cmd. However, only the addr (registered buffer
index) is actually used to unregister the buffer. There is no check that
the q_id and tag are for the ublk request whose buffer is registered at
the given index. To prepare to allow userspace to omit the q_id and tag,
check the UBLK_F_SUPPORT_ZERO_COPY flag on the ublk_device instead of
the ublk_queue.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250620151008.3976463-9-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c