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)
committerDoug Ledford <dledford@redhat.com>
Wed, 22 Feb 2017 20:35:03 +0000 (15:35 -0500)
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>
Cc: stable@vger.kernel.org
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma.c

index dab2a96..5ed6ec9 100644 (file)
@@ -3683,6 +3683,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;