From patchwork Tue Feb 21 19:21:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 9585473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 77896600CA for ; Tue, 21 Feb 2017 19:48:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66F2C28617 for ; Tue, 21 Feb 2017 19:48:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B0352861F; Tue, 21 Feb 2017 19:48:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD41828617 for ; Tue, 21 Feb 2017 19:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754249AbdBUTsG (ORCPT ); Tue, 21 Feb 2017 14:48:06 -0500 Received: from smtp.opengridcomputing.com ([72.48.136.20]:40550 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241AbdBUTsF (ORCPT ); Tue, 21 Feb 2017 14:48:05 -0500 Received: from smtp.ogc.us (build2.ogc.int [10.10.0.32]) by smtp.opengridcomputing.com (Postfix) with ESMTP id 12D7829E88; Tue, 21 Feb 2017 13:48:05 -0600 (CST) Received: by smtp.ogc.us (Postfix, from userid 503) id 03181E0BEF; Tue, 21 Feb 2017 13:48:04 -0600 (CST) From: Steve Wise Date: Tue, 21 Feb 2017 11:21:57 -0800 Subject: [RESEND PATCH 1/1] rdma_cm: fail iwarp accepts w/o connection params To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, shaobo@cs.utah.edu, sean.hefty@intel.com, leon@kernel.org, hal.rosenstock@gmail.com Message-Id: <20170221194805.03181E0BEF@smtp.ogc.us> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- (resent because I screwed up linux-rdma mailing address) --- 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 3e70a9c..c377afc 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -3583,6 +3583,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;