IB/core: Fix input len in multiple user verbs
Most user verbs pass user data to the kernel with the inclusion of the
ib_uverbs_cmd_hdr structure. This is problematic because the vendor has
no ideas if the verb was called by a legacy verb or an extended verb.
Also, the incosistency between the verbs is confusing.
Fixes: 565197dd8f
("IB/core: Extend ib_uverbs_create_cq")
Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
@@ -751,10 +751,8 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
|
||||
void *cqc;
|
||||
int err;
|
||||
|
||||
ucmdlen =
|
||||
(udata->inlen - sizeof(struct ib_uverbs_cmd_hdr) <
|
||||
sizeof(ucmd)) ? (sizeof(ucmd) -
|
||||
sizeof(ucmd.reserved)) : sizeof(ucmd);
|
||||
ucmdlen = udata->inlen < sizeof(ucmd) ?
|
||||
(sizeof(ucmd) - sizeof(ucmd.reserved)) : sizeof(ucmd);
|
||||
|
||||
if (ib_copy_from_udata(&ucmd, udata, ucmdlen))
|
||||
return -EFAULT;
|
||||
|
مرجع در شماره جدید
Block a user