diff options
author | Steve Wise <swise@opengridcomputing.com> | 2017-02-21 14:21:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-12 00:41:50 -0500 |
commit | c8cdd9234caced510db1a03491af475938f9855a (patch) | |
tree | 7e1398b97d727bf44239f912cdb48689e7679395 | |
parent | 50fc62d5eeb3392f11161637b5ed4e0d340fed74 (diff) |
rdma_cm: fail iwarp accepts w/o connection params
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/infiniband/core/cma.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index c25768c2dd3b..f2d40c05ef9e 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -3540,6 +3540,9 @@ static int cma_accept_iw(struct rdma_id_private *id_priv, | |||
3540 | struct iw_cm_conn_param iw_param; | 3540 | struct iw_cm_conn_param iw_param; |
3541 | int ret; | 3541 | int ret; |
3542 | 3542 | ||
3543 | if (!conn_param) | ||
3544 | return -EINVAL; | ||
3545 | |||
3543 | ret = cma_modify_qp_rtr(id_priv, conn_param); | 3546 | ret = cma_modify_qp_rtr(id_priv, conn_param); |
3544 | if (ret) | 3547 | if (ret) |
3545 | return ret; | 3548 | return ret; |