From: Steve Wise Date: Tue, 21 Feb 2017 19:21:57 +0000 (-0800) Subject: rdma_cm: fail iwarp accepts w/o connection params X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f2625f7db4dd0bbd16a9c7d2950e7621f9aa57ad;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git rdma_cm: fail iwarp accepts w/o connection params 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 Acked-by: Sean Hefty Signed-off-by: Steve Wise Cc: stable@vger.kernel.org Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index dab2a96ea032..5ed6ec9d6a93 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -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;