Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2525036imu; Thu, 29 Nov 2018 06:24:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/VjD7x34lkL0+W8YszilSjEaEAxTIJQzaCI3xegKVzivhKP87FB2rsxglxWA1z5lj/t9yyT X-Received: by 2002:a17:902:e01:: with SMTP id 1-v6mr1588182plw.251.1543501463253; Thu, 29 Nov 2018 06:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501463; cv=none; d=google.com; s=arc-20160816; b=RcER0j7OFLoJ1a77auub3dlYk22ZCIPUX+Ntu3ekXLH0gnNU1nauaaNRFZodWiVyCB KHofSfqxmJrrITKd2m2tV/7QSFKw6tjpqXRMz7tNGL8L096aBl8TssSNWyXSDWNtSzRm MB+Oqx+yRTFKEcKHJyYb17eVsiZXrWxgraE90SX/G2nXM1ShOg8/3o+yOZ7DGNumkkgp sh3ZNlcVnCA5M0yfgv8JMxoYd2SAqg4mlpVl9S45zyDBHfE+ZcsboIkqa+VAknKEIr9h SLpFuqVBN31zceVraSSkdM1GdFjEGAFIygIG5oRMEUDlvO8R3BR2F8sgkUKU7Ks2lVgi 9RPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tC8Wr1pLRedQT93IkqzCbQ68Gl290rCM2zVxFx6S1P4=; b=SpkGonRwxbNnSyA4Aol4dzlSZrEzNKpGWBfeOaHlaCEcPuqFHCL3tq616iZbmwew+j GD+SJHk8AAvp25DFJn59XdC3sGtm7vN80VSD8iSpIxbO6kApLFCFd5qhSZCgy3IeTfnV Gk6LnzZ132nJwFWHmLijLrxf1AzNyvDh4eCnA4Ojk6uGaqD1yQFCLMYYoquKX5VvpO57 YSXKh+BNjq3vyYcAFc1oEMA2/wiNwNoeGCUsfNyNO/UsYcDf22up0eXPWbr6laEmNbl/ XxFA5zSUTylQYIdmaAIEBnJuzIbp1Xjs4aq2SqIIZ+vJ3//z7qfkXCQS1W/sk2hNmEVk SD9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k9xCsX4P; 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 n15si1948109pgk.27.2018.11.29.06.24.07; Thu, 29 Nov 2018 06:24:23 -0800 (PST) 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=k9xCsX4P; 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 S1732083AbeK3B2S (ORCPT + 99 others); Thu, 29 Nov 2018 20:28:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:53780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731095AbeK3B2R (ORCPT ); Thu, 29 Nov 2018 20:28:17 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 18520205C9; Thu, 29 Nov 2018 14:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501365; bh=DvncEL8XKxLlxqf1uOO69i1UCJhOlByYK2SppQDJW8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9xCsX4PEpsqzVyM4YkgLSWEkSgaLvIZOZhZeRZ0QykaXySWNLNAx6b+++LTbVF9c G2kCCFJWRsubInBNEJk+DW847YpAPV7AEn/IvltwVjXnjtzlsT6acSlmoxwwHzW8KL 9h88ahv9Qhin2JZySZzLClTiZILNP2WqULqkDPMU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuval Shaia , Dennis Dalessandro , Alex Estrin , Leon Romanovsky , Doug Ledford , Mike Marciniszyn , stable@kernel.org Subject: [PATCH 4.9 25/92] IB/core: Fix for core panic Date: Thu, 29 Nov 2018 15:11:54 +0100 Message-Id: <20181129140108.408252939@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140106.520639693@linuxfoundation.org> References: <20181129140106.520639693@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alex Estrin commit e6f9bc34d3779cb7b6a337afed5de8be3f0fab77 upstream. Build with the latest patches resulted in panic: 11384.486289] BUG: unable to handle kernel NULL pointer dereference at (null) [11384.486293] IP: (null) [11384.486295] PGD 0 [11384.486295] P4D 0 [11384.486296] [11384.486299] Oops: 0010 [#1] SMP ......... snip ...... [11384.486401] CPU: 0 PID: 968 Comm: kworker/0:1H Tainted: G W O 4.13.0-a-stream-20170825 #1 [11384.486402] Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0014.121820151719 12/18/2015 [11384.486418] Workqueue: ib-comp-wq ib_cq_poll_work [ib_core] [11384.486419] task: ffff880850579680 task.stack: ffffc90007fec000 [11384.486420] RIP: 0010: (null) [11384.486420] RSP: 0018:ffffc90007fef970 EFLAGS: 00010206 [11384.486421] RAX: ffff88084cfe8000 RBX: ffff88084dce4000 RCX: ffffc90007fef978 [11384.486422] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88084cfe8000 [11384.486422] RBP: ffffc90007fefab0 R08: 0000000000000000 R09: ffff88084dce4080 [11384.486423] R10: ffffffffa02d7f60 R11: 0000000000000000 R12: ffff88105af65a00 [11384.486423] R13: ffff88084dce4000 R14: 000000000000c000 R15: 000000000000c000 [11384.486424] FS: 0000000000000000(0000) GS:ffff88085f400000(0000) knlGS:0000000000000000 [11384.486425] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [11384.486425] CR2: 0000000000000000 CR3: 0000000001c09000 CR4: 00000000001406f0 [11384.486426] Call Trace: [11384.486431] ? is_valid_mcast_lid.isra.21+0xfb/0x110 [ib_core] [11384.486436] ib_attach_mcast+0x6f/0xa0 [ib_core] [11384.486441] ipoib_mcast_attach+0x81/0x190 [ib_ipoib] [11384.486443] ipoib_mcast_join_complete+0x354/0xb40 [ib_ipoib] [11384.486448] mcast_work_handler+0x330/0x6c0 [ib_core] [11384.486452] join_handler+0x101/0x220 [ib_core] [11384.486455] ib_sa_mcmember_rec_callback+0x54/0x80 [ib_core] [11384.486459] recv_handler+0x3a/0x60 [ib_core] [11384.486462] ib_mad_recv_done+0x423/0x9b0 [ib_core] [11384.486466] __ib_process_cq+0x5d/0xb0 [ib_core] [11384.486469] ib_cq_poll_work+0x20/0x60 [ib_core] [11384.486472] process_one_work+0x149/0x360 [11384.486474] worker_thread+0x4d/0x3c0 [11384.486487] kthread+0x109/0x140 [11384.486488] ? rescuer_thread+0x380/0x380 [11384.486489] ? kthread_park+0x60/0x60 [11384.486490] ? kthread_park+0x60/0x60 [11384.486493] ret_from_fork+0x25/0x30 [11384.486493] Code: Bad RIP value. [11384.486493] Code: Bad RIP value. [11384.486496] RIP: (null) RSP: ffffc90007fef970 [11384.486497] CR2: 0000000000000000 [11384.486531] ---[ end trace b1acec6fb4ff6e75 ]--- [11384.532133] Kernel panic - not syncing: Fatal exception [11384.536541] Kernel Offset: disabled [11384.969491] ---[ end Kernel panic - not syncing: Fatal exception [11384.976875] sched: Unexpected reschedule of offline CPU#1! [11384.983646] ------------[ cut here ]------------ Rdma device driver may not have implemented (*get_link_layer)() so it can not be called directly. Should use appropriate helper function. Reviewed-by: Yuval Shaia Fixes: 523633359224 ("IB/core: Fix the validations of a multicast LID in attach or detach operations") Cc: stable@kernel.org # 4.13 Reviewed-by: Dennis Dalessandro Signed-off-by: Alex Estrin Signed-off-by: Dennis Dalessandro Reviewed-by: Leon Romanovsky Signed-off-by: Doug Ledford Cc: Mike Marciniszyn Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/core/verbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -1522,7 +1522,7 @@ static bool is_valid_mcast_lid(struct ib */ if (!ib_query_qp(qp, &attr, IB_QP_STATE | IB_QP_PORT, &init_attr)) { if (attr.qp_state >= IB_QPS_INIT) { - if (qp->device->get_link_layer(qp->device, attr.port_num) != + if (rdma_port_get_link_layer(qp->device, attr.port_num) != IB_LINK_LAYER_INFINIBAND) return true; goto lid_check; @@ -1531,7 +1531,7 @@ static bool is_valid_mcast_lid(struct ib /* Can't get a quick answer, iterate over all ports */ for (port = 0; port < qp->device->phys_port_cnt; port++) - if (qp->device->get_link_layer(qp->device, port) != + if (rdma_port_get_link_layer(qp->device, port) != IB_LINK_LAYER_INFINIBAND) num_eth_ports++;