• Majd Dibbiny's avatar
    IB/{core, mlx5}: Fix input len in vendor part of create_qp/srq · 3d943c9d
    Majd Dibbiny authored
    Currently, the inlen field of the vendor's part of the command
    doesn't match the command buffer. This happens because the inlen
    accommodates ib_uverbs_cmd_hdr which is deducted from the in buffer.
    This is problematic since the vendor function could be called either
    from the legacy verb (where the input length mismatches the actual
    length) or by the extended verb (where the length matches). The vendor
    has no idea which function calls it and therefore has no way to know
    how the length variable should be treated.
    
    Fixing this by aligning the inlen to the correct length.
    
    All vendor drivers either assumed that inlen >= sizeof(vendor_uhw_cmd)
    or just failed wrongly (mlx5) and fixed in this patch.
    
    Fixes: cfb5e088 ('IB/mlx5: Add CQE version 1 support to user QPs and SRQs')
    Signed-off-by: default avatarMajd Dibbiny <majd@mellanox.com>
    Reviewed-by: default avatarMatan Barak <matanb@mellanox.com>
    Reviewed-by: default avatarHaggai Eran <haggaie@mellanox.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    3d943c9d
uverbs_cmd.c 87.2 KB