Received: by 10.213.65.68 with SMTP id h4csp2120837imn; Sun, 8 Apr 2018 20:13:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx48U8ZAy6/477e3eLDItfJn6GM23mFg9vUKRYl5S0p/GMkMUKKdQjjQfYjxUg3RbRTdjfm2v X-Received: by 2002:a17:902:a50d:: with SMTP id s13-v6mr2347655plq.228.1523243589243; Sun, 08 Apr 2018 20:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243589; cv=none; d=google.com; s=arc-20160816; b=k/GzTuOOdfL67W6JoPlYh3uALPgI8S4OG0zoqgFRlnLJ5qRu2LnI6OmW6WK3cRrFZ+ sVnT44WExO0U8JYcl9/ZSWzjxlQjg0S7OL/OIhYVBYvp3cmER+3Amc5V+bEAoIyddA+k NV6jC7y0K2FhVjQNW6e08cxBfhu3Geuazj7GM0wfG0ML8vnAh09leG22Pk4c+5kBgHYI jKmEAYt0l/FDhB7aEUndif4Y4zerU2b7KGXvzPebFFvdKbm+vyxfDfHEShEFe5eiLBGJ 2PQHZzqMpjfW2I4PBzA0iUei/LqGN3yC/M1NYjCSVed/4lzZesxOkTNshX7iuYvbAn3u Vxkw== 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=Hmc+RhWZwOM2zyBlMO1/Su0o5J1riolvkQ4/duZtGO8=; b=g3/mQ4+TwvgEQSt+kMnWumnUnk7KJnI0SbrnRfSU3cJ+3fMBfr0Tj2jGVnhLxjozUN C+cKsoBOpWaBqAUbN5gMBXg97qMMMAD4mKQ3OHe88ResBj/T3u7XdjVt0xvPPTSKpVq8 1VnDYMpNMg59KaLMYW6k83AVbwuBxiUhNIam9y+JyU3DRFmAVHC4Gq4ocsJ6D/P2p9M/ M+IZoiYkPFWxDFEBc8mmOKMXnQvulxQ7uG48VWmnvxnS1YfcT0bbVhWRGjfFz8lJTGDC jDbOK6zX04tI2layMtf9iCjFikdkGt6yp8xCMd6KgdXwccTxzW5lIh0IfPdVGgcfWmj6 65rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Qk7utUbU; 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 1-v6si13446087plw.143.2018.04.08.20.12.32; Sun, 08 Apr 2018 20:13:09 -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=Qk7utUbU; 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 S1757534AbeDIC5X (ORCPT + 99 others); Sun, 8 Apr 2018 22:57:23 -0400 Received: from mail-bn3nam01on0139.outbound.protection.outlook.com ([104.47.33.139]:14848 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755232AbeDIAZn (ORCPT ); Sun, 8 Apr 2018 20:25: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=Hmc+RhWZwOM2zyBlMO1/Su0o5J1riolvkQ4/duZtGO8=; b=Qk7utUbUc+n/82J+e/v83MXZXO4+A8tVKjUz0m+lLiwq+fhPvPF2RSxBP2q5I8ZWvja0QcLTZORmhefiTBaFSeMucSzrywN+O/tBET+loCbppDKuCGDwOn33zML3fzJDwoLAyNoV0BqIfy9YaU6/E0HMGIbPnMBb2F2Cd+zKMbE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) 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:25:37 +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:25:37 +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.14 131/161] RDS: IB: Fix null pointer issue Thread-Topic: [PATCH AUTOSEL for 4.14 131/161] RDS: IB: Fix null pointer issue Thread-Index: AQHTz5i7NC2U+DbD8EC3sGung731Nw== Date: Mon, 9 Apr 2018 00:21:40 +0000 Message-ID: <20180409001936.162706-131-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB1013;7:mWQGAuYxPSN2sYofGSTD+YMWdnPTb8GfHAM0V5Mxb0hMBZAKn+yjBx50LOlRhByXa7cNMdkYV/lLNEJ0jzmZtHFWxVZQHivOH3JDnSxk6R1Fb1JVQsdvnaAWuEq+JB5DHoOn13FnNUjWmDe+FtXqxpmpbe5hCQCbN4C1scG0vro062xcI7M1le5t1Y1y8J9FI1xqZbV3EquUGLeXvQ1bKtbcZyk+nV6h7Y2j9vzBQ53igxSGjA+ZX/YTW3jIiD5B;20:0xctkDzhZj9BlhK3ob5UQhKAtCC7YLTOatDpO6ePGZpUO7Q7rTgJ/ycV4iOMILQe5VIehVe1xoUeSeKGob7deIHIzR9o844e4aGsEl6MJ0YBGSLyGohS0gQ0NmGUPBskSGwzTrtFwzz59BVZaKCNhjtEVWZ3jWjUAnKE7OcL+a4= X-MS-Office365-Filtering-Correlation-Id: f17a40d8-6db0-49ae-0409-08d59db06b12 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:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: 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)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1013;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1013; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(376002)(396003)(39860400002)(39380400002)(189003)(199004)(3280700002)(2616005)(8936002)(7736002)(476003)(446003)(11346002)(53936002)(3660700001)(86362001)(575784001)(86612001)(81156014)(2906002)(186003)(81166006)(105586002)(1076002)(8676002)(26005)(97736004)(25786009)(6512007)(3846002)(68736007)(72206003)(106356001)(5660300001)(6486002)(6666003)(6116002)(14454004)(4326008)(305945005)(6436002)(2501003)(5890100001)(5250100002)(10290500003)(478600001)(2900100001)(59450400001)(22452003)(110136005)(316002)(99286004)(66066001)(10090500001)(107886003)(76176011)(102836004)(54906003)(6506007)(36756003)(486006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1013;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: V6a8FfIelDif6qCHh3G/bjM/2gc1D1IARNfA9iB9k1T1iJ0INZiFYyg1WtLg1+lsBbJaVrQoSMuKk3yELD8qnkV27NHelVtj+l+Zy6/ISkvnJmpdq/5soDWyCXHQGeDtiOwCopHooWX5/j86/mMwc1bXs59LH67FEvd+iIl+VrbR1PjDFC/epkwGGsqDRBrdtASxLh5CfyKCNdM+B20mBbBkOi7Vui4l9FXjLkmWk10NH4jpotat1hMfMMsrS2f1PhA4aJd2faFENFbaNDhwNbGdu9+OK/ua4E/2R88G6yQCdsuqw6x2LMIiZNjU7rgEzK7jY0BjXQyri7XDjbRTds4/KaOZlN2VmV7jDcqKoHv/cJN9GbXDL0Jl6yrFsHDA5S7lPfVZ3dg3vR8hZqYQihTniRE9msiOlXMM/kzlCS8= 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: f17a40d8-6db0-49ae-0409-08d59db06b12 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:40.6749 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 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 a0954ace3774..c21eb4850b9d 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -346,7 +346,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