Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2474858imm; Mon, 28 May 2018 08:47:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqkAOxa2vjTml9tH9pUEkJUUtlJdH/eYzLWpd1cMvfwno1z10N27+W5GYD4uFffuZhR/vp1 X-Received: by 2002:a17:902:82cc:: with SMTP id u12-v6mr13963356plz.83.1527522434093; Mon, 28 May 2018 08:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527522433; cv=none; d=google.com; s=arc-20160816; b=qedqbBG3962MhrHzJBH68LlOhdDprAteU69ZidI3RrR3RA1fZspc3EGLDKbiVybDFX 0cD5PEl2anu189U4us0+BGPHmlSyJ3YtdZMQxXCoKKkVs+lNEgMcR4daGxtOfXQA7kuQ A23CdHiRKr87NJTigFZIj6ruoVpS1zuheYnY/Lej3kMu4arTDWch97MF2i2IghNtn/+P U8ov6w5DkvtXpaNI4gQHtEh3xiOgeg2RLUyya1fGbdWVR5GiDjxR5xim/8Kf54fAN+tW /vzHQGAItC9ABzi4YXcIljttokdHY5D2nkJ8XezIba6UHH7XAsda4QpTjs/a0aWNNq8l D+0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=JbUs/jQZIg4b2vL46ya9OXBt7PlUfM290z+H2mtX1ks=; b=V3xmhji21TJKTw4RrOSjb82GwB2Fb305J9zsnPCeH+NJRtFmtdnEHW1Vz+hizVegXF bZ9Ns++wNul+VMWTT7v0ZfzaZJlRt1NijZhz1+oJ+J6nNxclJenyOhr+aH0yYJco+FY1 KyRgNqGVsOc4ZK3X2t5j04p3qJsXYci0TNuKoGtW4F7a72TAc7rpImQ4/YFKipVt7FEI p7D2jYNlqK7MhSjDH9JuSPKHbIHwnTpB3PfqQvzbHZh0hNFwNLfwSOoLIGbHcpdHyREX 5Zell8i3Eo11Y6bv145G0saR0HsxnYpbhmQpCuI+g9fu2JWfFhcf/6TvV0PnRuxCmkbI 3POA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QdHPJ3VP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r126-v6si31207661pfc.202.2018.05.28.08.46.59; Mon, 28 May 2018 08:47:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QdHPJ3VP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034746AbeE1Pq3 (ORCPT + 99 others); Mon, 28 May 2018 11:46:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:36878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968554AbeE1KQo (ORCPT ); Mon, 28 May 2018 06:16:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F11C2086D; Mon, 28 May 2018 10:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502603; bh=F3zf8IU2Q1ktwP/siBA+n0rzPmFKcm1d0Xf47xFCLTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdHPJ3VPXuItelW8zh3Aw+Ye7M4w5bwZ2vy2FLgfWtn2g8T2BQuaZ70JEPWEbXm29 vRyBYFjNEBrgXkaH9zbSLXBfGAIhIXQTdRhIWJJAghVNdN3yVYHvXEheeQLik3hhiy FbfPLgfdor5/jKOGWKnEL38BY9ROmSH0lUVlN8jQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guanglei Li , Honglei Wang , Junxiao Bi , Yanjun Zhu , Leon Romanovsky , Santosh Shilimkar , Doug Ledford , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 061/268] RDS: IB: Fix null pointer issue Date: Mon, 28 May 2018 12:00:35 +0200 Message-Id: <20180528100208.843364181@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guanglei Li [ Upstream commit 2c0aa08631b86a4678dbc93b9caa5248014b4458 ] Scenario: 1. Port down and do fail over 2. Ap do rds_bind syscall PID: 47039 TASK: ffff89887e2fe640 CPU: 47 COMMAND: "kworker/u:6" #0 [ffff898e35f159f0] machine_kexec at ffffffff8103abf9 #1 [ffff898e35f15a60] crash_kexec at ffffffff810b96e3 #2 [ffff898e35f15b30] oops_end at ffffffff8150f518 #3 [ffff898e35f15b60] no_context at ffffffff8104854c #4 [ffff898e35f15ba0] __bad_area_nosemaphore at ffffffff81048675 #5 [ffff898e35f15bf0] bad_area_nosemaphore at ffffffff810487d3 #6 [ffff898e35f15c00] do_page_fault at ffffffff815120b8 #7 [ffff898e35f15d10] page_fault at ffffffff8150ea95 [exception RIP: unknown or invalid address] RIP: 0000000000000000 RSP: ffff898e35f15dc8 RFLAGS: 00010282 RAX: 00000000fffffffe RBX: ffff889b77f6fc00 RCX:ffffffff81c99d88 RDX: 0000000000000000 RSI: ffff896019ee08e8 RDI:ffff889b77f6fc00 RBP: ffff898e35f15df0 R8: ffff896019ee08c8 R9:0000000000000000 R10: 0000000000000400 R11: 0000000000000000 R12:ffff896019ee08c0 R13: ffff889b77f6fe68 R14: ffffffff81c99d80 R15: ffffffffa022a1e0 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #8 [ffff898e35f15dc8] cma_ndev_work_handler at ffffffffa022a228 [rdma_cm] #9 [ffff898e35f15df8] process_one_work at ffffffff8108a7c6 #10 [ffff898e35f15e58] worker_thread at ffffffff8108bda0 #11 [ffff898e35f15ee8] kthread at ffffffff81090fe6 PID: 45659 TASK: ffff880d313d2500 CPU: 31 COMMAND: "oracle_45659_ap" #0 [ffff881024ccfc98] __schedule at ffffffff8150bac4 #1 [ffff881024ccfd40] schedule at ffffffff8150c2cf #2 [ffff881024ccfd50] __mutex_lock_slowpath at ffffffff8150cee7 #3 [ffff881024ccfdc0] mutex_lock at ffffffff8150cdeb #4 [ffff881024ccfde0] rdma_destroy_id at ffffffffa022a027 [rdma_cm] #5 [ffff881024ccfe10] rds_ib_laddr_check at ffffffffa0357857 [rds_rdma] #6 [ffff881024ccfe50] rds_trans_get_preferred at ffffffffa0324c2a [rds] #7 [ffff881024ccfe80] rds_bind at ffffffffa031d690 [rds] #8 [ffff881024ccfeb0] sys_bind at ffffffff8142a670 PID: 45659 PID: 47039 rds_ib_laddr_check /* create id_priv with a null event_handler */ rdma_create_id rdma_bind_addr cma_acquire_dev /* add id_priv to cma_dev->id_list */ cma_attach_to_dev cma_ndev_work_handler /* event_hanlder is null */ id_priv->id.event_handler Signed-off-by: Guanglei Li Signed-off-by: Honglei Wang Reviewed-by: Junxiao Bi Reviewed-by: Yanjun Zhu Reviewed-by: Leon Romanovsky Acked-by: Santosh Shilimkar Acked-by: Doug Ledford Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/rds/ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -336,7 +336,8 @@ static int rds_ib_laddr_check(struct net /* Create a CMA ID and try to bind it. This catches both * IB and iWARP capable NICs. */ - cm_id = rdma_create_id(&init_net, NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); + cm_id = rdma_create_id(&init_net, rds_rdma_cm_event_handler, + NULL, RDMA_PS_TCP, IB_QPT_RC); if (IS_ERR(cm_id)) return PTR_ERR(cm_id);