Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1979027imm; Thu, 24 May 2018 03:58:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZofDjJlaOj+BBwkH+OrmUTaoAV/nvA3GTR3b37K8y3PZ6AodhEt4FyqTyJr5p/sl0o2Cx/W X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr6834874plz.336.1527159482559; Thu, 24 May 2018 03:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527159482; cv=none; d=google.com; s=arc-20160816; b=jELXo4qshpMVg7Rp9lrvlwDCqByiKr1GL2CiWFxgYgX+2oCEjIIIzn1n35m11KZa0F 7TZKVAnTtENvjLFS5VF6JGmNjiBljg+82hvycAtEhNkMkB/X0maqAAAHl8SlyiCGcKQk /ePSnyKJlmaC3FVqG608+8iZkQG4JybcF+nw8ivV4RjXo3XIIzgYDIltY/+fECURV3uZ HX4j8hmL5eTM9x4wR1RQoq9imkfhWVCsl5q1e+5M6JRScvctadvqSDgcRso11hOh0acK S94ATz61n9kQrciJb90JuPLgDrCq0xR15U47STXsSEdVppqS42snDqzL8xPS45scOkm1 aMew== 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=c5AA2PI6zYK1jT0AZabUsCZvoPHO480/7iDTyweHNxU=; b=yF5nrwvIX4WZg93t3xC6wkU3obRci028P+zs13IBhNvgEE6dta1i2qJVtunmL1uzh0 3X6TZjXM4pAwaKDZDfZY2vXtst/2eSytmJTYOkEUdXbLHuNjlA5NSUeIXFcgIIsGpp2y q2FkPdeWV/DqTAN/9iu/szscjtdOeguWFDiYbuPjf8EIZ0H2kuyvQ1AUQgfzKL3Rmgin Yqxcf0VJRN8hDi4m1GMCYnTaQIael5UpLYOkDcSPplhseABWsePCxIzFa3msr1DCJTY4 Nyh96alnx8nj7sqRCm6Mn7srOGc8Q/iqYcoFTRcsKqVefD5LVa070yq8SG1ZhaqJ57rf 36ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N/VXf+Id; 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 g8-v6si13854168pgv.169.2018.05.24.03.57.47; Thu, 24 May 2018 03:58:02 -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=N/VXf+Id; 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 S1030298AbeEXJ4V (ORCPT + 99 others); Thu, 24 May 2018 05:56:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:36202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030277AbeEXJ4Q (ORCPT ); Thu, 24 May 2018 05:56:16 -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 AA9662089F; Thu, 24 May 2018 09:56:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155776; bh=dXYnk7sSuAMeyXWasi+GPaUOaQ6P0bWRPpPtrM0ioNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/VXf+IdZ+fwK5fL/cJsaRVVAgetP1myfN65pKhp/raa+A/uZb41hwcbgm/uUGYtD 7YlyMP3MMt1UgGZlk1YbJArtfEVz+QUOICHMX8AluhE0E7FpW4VC6n/m2OL0yxAcn3 PvvnIbqMdwgnqv/hrfEGM8ScFxeGqKqeqgeSHw8E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Rangankar , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 111/165] scsi: qedi: Fix kernel crash during port toggle Date: Thu, 24 May 2018 11:38:37 +0200 Message-Id: <20180524093626.511889842@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Manish Rangankar [ Upstream commit 967823d6c3980a30e214b92bfe6a101e7b46d025 ] BUG: unable to handle kernel NULL pointer dereference at 0000000000000100 [ 985.596918] IP: _raw_spin_lock_bh+0x17/0x30 [ 985.601581] PGD 0 P4D 0 [ 985.604405] Oops: 0002 [#1] SMP : [ 985.704533] CPU: 16 PID: 1156 Comm: qedi_thread/16 Not tainted 4.16.0-rc2 #1 [ 985.712397] Hardware name: Dell Inc. PowerEdge R730/0599V5, BIOS 2.4.3 01/17/2017 [ 985.720747] RIP: 0010:_raw_spin_lock_bh+0x17/0x30 [ 985.725996] RSP: 0018:ffffa4b1c43d3e10 EFLAGS: 00010246 [ 985.731823] RAX: 0000000000000000 RBX: ffff94a31bd03000 RCX: 0000000000000000 [ 985.739783] RDX: 0000000000000001 RSI: ffff94a32fa16938 RDI: 0000000000000100 [ 985.747744] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000a33 [ 985.755703] R10: 0000000000000000 R11: ffffa4b1c43d3af0 R12: 0000000000000000 [ 985.763662] R13: ffff94a301f40818 R14: 0000000000000000 R15: 000000000000000c [ 985.771622] FS: 0000000000000000(0000) GS:ffff94a32fa00000(0000) knlGS:0000000000000000 [ 985.780649] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 985.787057] CR2: 0000000000000100 CR3: 000000067a009006 CR4: 00000000001606e0 [ 985.795017] Call Trace: [ 985.797747] qedi_fp_process_cqes+0x258/0x980 [qedi] [ 985.803294] qedi_percpu_io_thread+0x10f/0x1b0 [qedi] [ 985.808931] kthread+0xf5/0x130 [ 985.812434] ? qedi_free_uio+0xd0/0xd0 [qedi] [ 985.817298] ? kthread_bind+0x10/0x10 [ 985.821372] ? do_syscall_64+0x6e/0x1a0 Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qedi/qedi_fw.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -769,6 +769,11 @@ static void qedi_process_cmd_cleanup_res iscsi_cid = cqe->conn_id; qedi_conn = qedi->cid_que.conn_cid_tbl[iscsi_cid]; + if (!qedi_conn) { + QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, + "icid not found 0x%x\n", cqe->conn_id); + return; + } /* Based on this itt get the corresponding qedi_cmd */ spin_lock_bh(&qedi_conn->tmf_work_lock);