Received: by 10.213.65.68 with SMTP id h4csp2141503imn; Sun, 8 Apr 2018 20:46:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx49jLJdGBHSwc2gNnRWP6iXidPn2A27/uMRyFlhFiVRO0IDyys1QUfrA/DYbLwIaoGqY1S12 X-Received: by 10.98.185.15 with SMTP id z15mr20329430pfe.199.1523245595076; Sun, 08 Apr 2018 20:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523245595; cv=none; d=google.com; s=arc-20160816; b=0zgaxH4a/BLfP5qK2IQk+p+5QYwGkdUAkAVUeZ4knOev0p7vWgXblmFvynK3HZfm8X 93m14DMEi1ealwdiJC6GjszTTKcKTdYc65Uk5YLLyV4EduoMEqU7xZKTIaOKPIobC3yp 8KayN5+JTWrKqyJjMWrmhuh7gZtOxUIr7guVtQewzYK6W7zHca+YE6aM0FBBYMMBDW/J 8MAwakmifAWxoA+XA5n/n3zlZnqerbBnG+m/w4GdWkAgUpvYzgNi7YZDGEdnc/uedLAZ 0oyzq3SbnwtWU1jK7dUb/2Har/KaaGFFcAAwCekVSu4GGfpkdDX3eafNdr5pqZXhPp9V LMHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=aQGP3eHkMTuvtCbV61+S8FcXLryeLxDt6mMomRW3Wxo=; b=FNEuEFMSKh3SOW1gwemX25IcXW8jE0WihyRuasJ19y5v1kcdGm1nH9bKZ5lezZ8VLd I4YpbI1GI9jptJBZDmcJM42yukrRBi3cPfXsKwJ2DJd03dCNZZKXlChJTRDBazwff0ft lh1AqAu17S5dAMwrLM3JKt9MLeNGvNywaqjMXWMGzV85skDEWrveZ5HMBJMkXAwyzEaJ QW2+G0WADt9t0pxVindBueyHe39xgc1WKlTjG+0ax5ICm+NGl4Cp52/ZdGZUHKrK0QV5 PPyCuWc07ymQnuhbPrGGV+H1vaQt/Ya8WK1sFUy3ygLa8u3daRiymX4vHgNMQgdZfOls Ybyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=VETxrMbT; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si10259586pgv.596.2018.04.08.20.45.57; Sun, 08 Apr 2018 20:46:35 -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=@microsoft.com header.s=selector1 header.b=VETxrMbT; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754627AbeDIDk5 (ORCPT + 99 others); Sun, 8 Apr 2018 23:40:57 -0400 Received: from mail-sn1nam01on0114.outbound.protection.outlook.com ([104.47.32.114]:12752 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754360AbeDIAVF (ORCPT ); Sun, 8 Apr 2018 20:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aQGP3eHkMTuvtCbV61+S8FcXLryeLxDt6mMomRW3Wxo=; b=VETxrMbT6ByvmD5EAS5855lA0Glv0cAdauXIkq0nvvaTu09RJsGZcUTHbxuEeU386KVb+iFYTRqzUDW1rfa6OEyZgj6aNgDxVmP4rcKGv029R8TJ56Hqy5axL+Q6gQX8Q50TYUMLtek/6P0nV+qa2nGu5HqICJzYrKSOTi06p7Q= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:20:59 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:20:59 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Guanglei Li , Honglei Wang , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 155/189] RDS: IB: Fix null pointer issue Thread-Topic: [PATCH AUTOSEL for 4.15 155/189] RDS: IB: Fix null pointer issue Thread-Index: AQHTz5hX1+KGJxvn5EqF2AvSM4xc4w== Date: Mon, 9 Apr 2018 00:18:53 +0000 Message-ID: <20180409001637.162453-155-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0920;7:KTI3OJhGFp00rhvYt7Qi2ufbFrlN3NdmjK/zqK3FJUxxkYqbVyTKuZ7A1Qr37VJQh7PkjL++RPE6Xt2QwEjeXy7i6m2oXNI+0hOKIpwc6iCwWaBAd47/DdP7lvVNNqKsn96TKUaxaBOImwTiT8ZVo2LbrRvOomncShdJ37FWcprC0/WjwEwe163fGbezNI8J4ZCJCNcI9dOD85vTp/93uQ/JmTNUwJgxA5fHHo9t3LOBlzrgnlw7pBZzfYHxKGHg;20:r+j7SgrcUzgDrGHToVZLz/prFH4LQcCXWGrbyTJZy+9pgA6kV3x0XYYAPQHvc/SqMq4qv9qxAt4S+tR6ldYjvopsR8Z6ZsyTE5HVAdFjNp3D2Sm+iF6IGJXLmt9zzQnlFQnC5UbkCgULcxOvwdiEazyKq3oa0BxsKVIYeG22iTQ= X-MS-Office365-Filtering-Correlation-Id: 867d2538-b90d-4bdb-1c75-08d59dafc52a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(396003)(366004)(346002)(376002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(25786009)(5890100001)(76176011)(2900100001)(36756003)(6506007)(2906002)(99286004)(86612001)(6486002)(102836004)(305945005)(1076002)(7736002)(575784001)(97736004)(2616005)(446003)(11346002)(476003)(486006)(26005)(6666003)(6512007)(4326008)(107886003)(5660300001)(478600001)(6436002)(105586002)(10290500003)(5250100002)(22452003)(316002)(186003)(8676002)(110136005)(81166006)(54906003)(6116002)(8936002)(72206003)(53936002)(2501003)(3846002)(68736007)(14454004)(81156014)(10090500001)(106356001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: D1P7kFIoZvSK4kw8N9NlxqDoN33B+tvidlfvoHgSwPpNLNdsiwM9gZmTQapkAdBRYHse58b+TiBID7fw4C2FCzWgxZhyyUCZT7hu3kIfAdiqdnBhxODboxSL6shvqTv/uLt6aGX81/ENkRpeeyrQmFzuZQWXff3cPXjcv2T1p61OOmvZrOUT0WiXKh1wE3mye7R6GZaBO+P0RSwLU/pgcCt7eJdE15L6+Mh3dVQ2tZDJkRLFQrk9WSh/AU1xfO6a25o/Le7gv1s38S2OBo56VhmjzTfF6cfeApLWCNyAd0Rhxt3/X22Qublu4bSt/8/k81sWzzI+IetzivY0/W/iTYX98wYS6+yaR9hHFwl65kwb7IyUn7avtWRcKodE+VdHTY33Nb/13vKEzLb6Co5U+s/mJpsjCD2cVJppSaChJ/A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 867d2538-b90d-4bdb-1c75-08d59dafc52a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:53.0339 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- net/rds/ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rds/ib.c b/net/rds/ib.c index 36dd2099048a..04da68e5dbe6 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -347,7 +347,8 @@ static int rds_ib_laddr_check(struct net *net, __be32 a= ddr) /* Create a CMA ID and try to bind it. This catches both * IB and iWARP capable NICs. */ - cm_id =3D rdma_create_id(&init_net, NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); + cm_id =3D 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); =20 --=20 2.15.1