Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965111AbdCJJfb (ORCPT ); Fri, 10 Mar 2017 04:35:31 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42766 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965077AbdCJJf0 (ORCPT ); Fri, 10 Mar 2017 04:35:26 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shaobo He , Sean Hefty , Steve Wise , Doug Ledford Subject: [PATCH 4.10 130/167] rdma_cm: fail iwarp accepts w/o connection params Date: Fri, 10 Mar 2017 10:09:33 +0100 Message-Id: <20170310084003.732374978@linuxfoundation.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170310083956.767605269@linuxfoundation.org> References: <20170310083956.767605269@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 34 4.10-stable review patch. If anyone has any objections, please let me know. ------------------ 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: Greg Kroah-Hartman --- drivers/infiniband/core/cma.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -3583,6 +3583,9 @@ static int cma_accept_iw(struct rdma_id_ 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;