aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/mad.c
diff options
context:
space:
mode:
authorLinus Walleij <[email protected]>2015-12-21 08:36:21 +0000
committerLinus Walleij <[email protected]>2015-12-21 08:36:21 +0000
commit0529357f102b96f68bc199f858d1c3b07f4b674c (patch)
treeeaa047952a768099e00a5245afa0d84799df6990 /drivers/infiniband/core/mad.c
parentgpio: pch: fix non-DT build (diff)
parentLinux 4.4-rc6 (diff)
downloadkernel-0529357f102b96f68bc199f858d1c3b07f4b674c.tar.gz
kernel-0529357f102b96f68bc199f858d1c3b07f4b674c.zip
Merge tag 'v4.4-rc6' into devel
Linux 4.4-rc6
Diffstat (limited to 'drivers/infiniband/core/mad.c')
-rw-r--r--drivers/infiniband/core/mad.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 8d8af7a41a30..2281de122038 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -1811,6 +1811,11 @@ static int validate_mad(const struct ib_mad_hdr *mad_hdr,
if (qp_num == 0)
valid = 1;
} else {
+ /* CM attributes other than ClassPortInfo only use Send method */
+ if ((mad_hdr->mgmt_class == IB_MGMT_CLASS_CM) &&
+ (mad_hdr->attr_id != IB_MGMT_CLASSPORTINFO_ATTR_ID) &&
+ (mad_hdr->method != IB_MGMT_METHOD_SEND))
+ goto out;
/* Filter GSI packets sent to QP0 */
if (qp_num != 0)
valid = 1;