path: root/drivers/infiniband/core
diff options
authorYann Droneaud <>2013-12-11 23:01:48 +0100
committerRoland Dreier <>2013-12-20 10:54:31 -0800
commit2782c2d302557403e314a43856f681a5385e62c6 (patch)
tree1be71f11db4143c039255bd7e07c6cad8c7a3673 /drivers/infiniband/core
parent7efb1b19b3414d7dec792f39e1c1a7db57a23961 (diff)
IB/uverbs: Check comp_mask in destroy_flow
Just like the check added to create_flow in 22878dbc9173 ("IB/core: Better checking of userspace values for receive flow steering"), comp_mask must be checked in destroy_flow too. Since only empty comp_mask is currently supported, any other value must be rejected. This check was silently added in a previous patch[1] to move comp_mask in extended command header, part of previous patchset[2] against create/destroy_flow uverbs. The idea of moving comp_mask to the header was discarded for the final patchset[3]. Unfortunately the check added in destroy_flow uverb was not integrated in the final patchset. [1] [2] [3] Cc: Matan Barak <> Link:> Signed-off-by: Yann Droneaud <> Signed-off-by: Roland Dreier <>
Diffstat (limited to 'drivers/infiniband/core')
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 65f6e7dc380c..f0ee6b92132a 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -2795,6 +2795,9 @@ int ib_uverbs_ex_destroy_flow(struct ib_uverbs_file *file,
if (ret)
return ret;
+ if (cmd.comp_mask)
+ return -EINVAL;
uobj = idr_write_uobj(&ib_uverbs_rule_idr, cmd.flow_handle,
if (!uobj)