Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753639AbdFSTGU (ORCPT + 2 others); Mon, 19 Jun 2017 15:06:20 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:52467 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbdFSShN (ORCPT ); Mon, 19 Jun 2017 14:37:13 -0400 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Steve Wise , Doug Ledford , Willy Tarreau Subject: [PATCH 3.10 160/268] rdma_cm: fail iwarp accepts w/o connection params Date: Mon, 19 Jun 2017 20:30:59 +0200 Message-Id: <1497897167-14556-161-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1497897167-14556-1-git-send-email-w@1wt.eu> References: <1497897167-14556-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Steve Wise 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 Acked-by: Sean Hefty Signed-off-by: Steve Wise Signed-off-by: Doug Ledford Signed-off-by: Willy Tarreau --- drivers/infiniband/core/cma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 71c2c711..818cac9 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -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; -- 2.8.0.rc2.1.gbe9624a