Received: by 10.213.65.68 with SMTP id h4csp2120071imn; Sun, 8 Apr 2018 20:12:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+f59+53HrKRpJH8k87EdwaL/48iPXfkEEeFhBmiT1Yp81aJ3r1UoabrkEuHtOPE5Z82UGe X-Received: by 10.98.62.150 with SMTP id y22mr26730548pfj.46.1523243429458; Sun, 08 Apr 2018 20:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243429; cv=none; d=google.com; s=arc-20160816; b=oS5yAltD/NF/+BgqPNPX7JCxMv1LM1HVDQoBvWVV8vq/Adoy6B4FnGqJezR/TrsmMW 2b5+mtRKPQBGnwU2HIcRqskgwLl6JrBSx8D9/F/PvKS8KsN5n5Kk1UVmlxqpsGK1EEmY +hJkJeOnHPL6Rjq3A5RJYLqDLxaFMlBfjxanGUTuVkYDix2LbGha9nnZL0wt9bA/snTT LLQT5L/Pzmpn6lBLQbskGAAxXz/3SSo/RG2xf3nnKfcdq3Ihha1CS4PHv5EKTcstw9wt d8wlgT0HlGulbfPnotvNiNmJL+vhN1YhGtzfFXFymPFgFjH3vQYkG3EkEZDtzn2Vk1s9 T/3A== 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=u2iGAJnMWOiN/VeMzWvl9b7MjJ+keGEAl+GqKbvXMBw=; b=OAddSZ2P//RbTv9y37vNwY6mksCuBFe2t6SJ8BgqU8BXbq26emF+JqpnZdBZSTSz// G2HyaoEO2DBqXDnQ+lQu4seCD3wd+DLWBVdVBWqQdaPUoSqhG6a3E+4lzOgUP3zQC6gM JBxrq6zpqCknzLiHEkYfbTGfDmYFF9f9zCQFJFfp8Mjtm4ImXI/5hTdtZQkzK+SfrItE rysZZofDB8uKzOimnCjzX6wGdiwc0Oq0P1raeGz1n1AYbgcjINP7u4Tro0sdyTze+nSy IeqfOwI4zXDzRia3mnQVOWHEO7UVPRNFb8dU4z3qPCo7yt1DN5hSRchEwnQz/mTfrGKX A+fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=T9vvYS0Z; 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 k1-v6si13336600pld.267.2018.04.08.20.09.52; Sun, 08 Apr 2018 20:10:29 -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=T9vvYS0Z; 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 S932983AbeDIBpE (ORCPT + 99 others); Sun, 8 Apr 2018 21:45:04 -0400 Received: from mail-bl2nam02on0118.outbound.protection.outlook.com ([104.47.38.118]:14317 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932492AbeDIAen (ORCPT ); Sun, 8 Apr 2018 20:34:43 -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=u2iGAJnMWOiN/VeMzWvl9b7MjJ+keGEAl+GqKbvXMBw=; b=T9vvYS0ZArZmISKBQ45MtWXZJdqneLCimyqfHVP6dJfxCRgPpALVhlEXDguqo3c39GWTKjeIGYeD9B7Ho3SHo0LFgRwwkN44D1+BL9+vYhXdEXLuoRlDz/9lSjqGaT1GkgcpmOoIEd27Zbxo3NF0cA1dhtTTkdV9pD02D35aULs= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0984.namprd21.prod.outlook.com (52.132.133.30) 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:34:39 +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:34:39 +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.9 277/293] RDS: IB: Fix null pointer issue Thread-Topic: [PATCH AUTOSEL for 4.9 277/293] RDS: IB: Fix null pointer issue Thread-Index: AQHTz5lo0Ee4+yQ9s06m2yH89j8IIw== Date: Mon, 9 Apr 2018 00:26:32 +0000 Message-ID: <20180409002239.163177-277-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0984;7:xqI6JvDV7or5gdjT8XjqtBfYiKMx2kf0ne5FS8LxgvRb/zWMFEeckOeNWYkHBB2nbVYC4eip2KX8QkXbgyMlg+M2+AVZqd3k2M5syCm6vy3RAgoMm2DhZbKgAkG2krt55DpNc7OsNTWSGlvXqgqQnkQnFpnSag25xOsPNVp+Dq8ifpoRqmCb+WmOt6cCmWi6JsCfxAGj1rar91bN/R8tyWbd3brYpoD9h2JlSNkjFyZtAw9bkCyw6gNlQnOTotWF;20:tbs8eJZcDIYtOsi21nnPIshueO/0mFtkemP/UXc0E0aEYR9Nxpx4cs/NrvuJKnFUe2tP29ARu+mLyvqoqkkCAgNzLqUulqJJQXYwpXUTq+3rp24JUyo1J3Lxm6UIKK6UBn2koiQz2o9HX7zCNnyCuWf4I5RtE0EoCabXCu2kvVo= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 8cd1a338-47a1-4d95-c565-08d59db1ada8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0984; x-ms-traffictypediagnostic: DM5PR2101MB0984: 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:DM5PR2101MB0984;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0984; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(366004)(39380400002)(346002)(376002)(199004)(189003)(26005)(99286004)(2906002)(14454004)(97736004)(59450400001)(8676002)(81156014)(81166006)(8936002)(6512007)(106356001)(76176011)(186003)(3280700002)(10090500001)(36756003)(6506007)(66066001)(3660700001)(72206003)(478600001)(6666003)(53936002)(2900100001)(105586002)(102836004)(5890100001)(2501003)(110136005)(54906003)(5250100002)(486006)(1076002)(25786009)(6116002)(6436002)(11346002)(6486002)(22452003)(4326008)(446003)(7736002)(575784001)(86362001)(305945005)(2616005)(476003)(68736007)(3846002)(86612001)(5660300001)(10290500003)(107886003)(316002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0984;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: ve46yVSbz2IJxJuibrTQpU0++53NgwOvIj4UzX8GFW7Ix+zaehrLQQI4zoSfV+7/uyeMD3iY1XazKMJQiEo0xs/VGiPNHbU1kv6X1ZtnzHLxXpnR9jE6/2GpO72VP3yENTMAnFJ+HI95p1QbFrkGtC9AwZVtwZ5yhIWtsBhb7YBNtDTAPFK0slVvbMwo5JebLBFQbnuBbuS3S1YpaMnbEVhd4mS9ERhEFzrfYgtoiO8zn6EVnStXtMvKr9C6wLrDIsNyvLyDvWKQldvZ0eQnRpIm0yVk/nvRlAhY4/UT21+TAeI9yLdclbTdU5BZbS9ZHpc5auXPVWrSGgTtub1JJrEoesoP4CjxtqO0oUPjccWOOqhb296ip1faQpVkk7Eap98nuYsF08pdBiYXKDFO4fv8P/tOMG/xvK8svPNbFXk= 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: 8cd1a338-47a1-4d95-c565-08d59db1ada8 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:26:32.4883 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0984 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 5680d90b0b77..0efb3d2b338d 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -336,7 +336,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