]> git.baikalelectronics.ru Git - kernel.git/commit
IB/{core, mlx5}: Fix input len in vendor part of create_qp/srq
authorMajd Dibbiny <majd@mellanox.com>
Sun, 14 Feb 2016 16:35:52 +0000 (18:35 +0200)
committerDoug Ledford <dledford@redhat.com>
Thu, 3 Mar 2016 15:00:18 +0000 (10:00 -0500)
commit2786c9c860b2b660e10323c2b6b5a47db72ce180
tree1e8382403949388ffede81a275dc5c81bb3a6072
parent41335695fe31dfc5140cd9ea9b8707eecad77f92
IB/{core, mlx5}: Fix input len in vendor part of create_qp/srq

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: e60b3a989872 ('IB/mlx5: Add CQE version 1 support to user QPs and SRQs')
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Reviewed-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/hw/mlx5/srq.c