summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2024-11-11 19:07:18 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-05 14:02:55 +0100
commit4ef8b6f7c4f19ee2b84c8ef016874c1b103ade4c (patch)
treedaa5ece1100ec6ec3928441879b0f669ce487513 /block
parent14d85fb8a13ef8fa6e2bc2a697bfffcd3a5648c5 (diff)
downloadlinux-4ef8b6f7c4f19ee2b84c8ef016874c1b103ade4c.tar.gz
linux-4ef8b6f7c4f19ee2b84c8ef016874c1b103ade4c.tar.bz2
linux-4ef8b6f7c4f19ee2b84c8ef016874c1b103ade4c.zip
ublk: fix ublk_ch_mmap() for 64K page size
commit d369735e02ef122d19d4c3d093028da0eb400636 upstream. In ublk_ch_mmap(), queue id is calculated in the following way: (vma->vm_pgoff << PAGE_SHIFT) / `max_cmd_buf_size` 'max_cmd_buf_size' is equal to `UBLK_MAX_QUEUE_DEPTH * sizeof(struct ublksrv_io_desc)` and UBLK_MAX_QUEUE_DEPTH is 4096 and part of UAPI, so 'max_cmd_buf_size' is always page aligned in 4K page size kernel. However, it isn't true in 64K page size kernel. Fixes the issue by always rounding up 'max_cmd_buf_size' with PAGE_SIZE. Cc: stable@vger.kernel.org Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver") Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20241111110718.1394001-1-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions