ublk: Limit dev_id/ub_number values
The dev_id/ub_number is used for the ublk dev's char device's minor number so it has to fit into MINORMASK. This patch adds checks to prevent userspace from passing a number that's too large and limits what can be allocated by the ublk_index_idr for the case where userspace has the kernel allocate the dev_id/ub_number. Signed-off-by:Mike Christie <michael.christie@oracle.com> Reviewed-by:
Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20231012150600.6198-2-michael.christie@oracle.comSigned-off-by:
Jens Axboe <axboe@kernel.dk>
Showing
Please register or sign in to comment