rdma_cm: fail iwarp accepts w/o connection params
authorSteve Wise <swise@opengridcomputing.com>
Tue, 21 Feb 2017 19:21:57 +0000 (11:21 -0800)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:24 +0000 (14:04 +0200)
commit f2625f7db4dd0bbd16a9c7d2950e7621f9aa57ad upstream.

cma_accept_iw() needs to return an error if conn_params is NULL.
Since this is coming from user space, we can crash.

Reported-by: Shaobo He <shaobo@cs.utah.edu>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/infiniband/core/cma.c

index 71c2c71168028dbe6c8cfe6b3de314cc344d84cd..818cac9bbd8ae547c1ce897f5d3baec480404b33 100644 (file)
@@ -2772,6 +2772,9 @@ static int cma_accept_iw(struct rdma_id_private *id_priv,
        struct iw_cm_conn_param iw_param;
        int ret;
 
+       if (!conn_param)
+               return -EINVAL;
+
        ret = cma_modify_qp_rtr(id_priv, conn_param);
        if (ret)
                return ret;