From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Quinn Tran <quinn.tran@cavium.com>,
Himanshu Madhani <himanshu.madhani@cavium.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 4.14 01/21] scsi: qla2xxx: Fix unintialized List head crash
Date: Tue, 7 Aug 2018 20:51:15 +0200 [thread overview]
Message-ID: <20180807172331.014943210@linuxfoundation.org> (raw)
In-Reply-To: <20180807172330.953888701@linuxfoundation.org>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quinn Tran <quinn.tran@cavium.com>
commit e3dde080ebbdbb4bda8eee35d770714fee8c59ac upstream.
In case of IOCB Queue full or system where memory is low and driver
receives large number of RSCN storm, the stale sp pointer can stay on
gpnid_list resulting in page_fault.
This patch fixes this issue by initializing the sp->elem list head and
removing sp->elem before memory is freed.
Following stack trace is seen
9 [ffff987b37d1bc60] page_fault at ffffffffad516768 [exception RIP: qla24xx_async_gpnid+496]
10 [ffff987b37d1bd10] qla24xx_async_gpnid at ffffffffc039866d [qla2xxx]
11 [ffff987b37d1bd80] qla2x00_do_work at ffffffffc036169c [qla2xxx]
12 [ffff987b37d1be38] qla2x00_do_dpc_all_vps at ffffffffc03adfed [qla2xxx]
13 [ffff987b37d1be78] qla2x00_do_dpc at ffffffffc036458a [qla2xxx]
14 [ffff987b37d1bec8] kthread at ffffffffacebae31
Fixes: 2d73ac6102d9 ("scsi: qla2xxx: Serialize GPNID for multiple RSCN")
Cc: <stable@vger.kernel.org> # v4.17+
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/qla2xxx/qla_gs.c | 4 ++++
drivers/scsi/qla2xxx/qla_inline.h | 2 ++
2 files changed, 6 insertions(+)
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3368,6 +3368,10 @@ int qla24xx_async_gpnid(scsi_qla_host_t
return rval;
done_free_sp:
+ spin_lock_irqsave(&vha->hw->vport_slock, flags);
+ list_del(&sp->elem);
+ spin_unlock_irqrestore(&vha->hw->vport_slock, flags);
+
if (sp->u.iocb_cmd.u.ctarg.req) {
dma_free_coherent(&vha->hw->pdev->dev,
sizeof(struct ct_sns_pkt),
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -221,6 +221,8 @@ qla2xxx_get_qpair_sp(struct qla_qpair *q
sp->fcport = fcport;
sp->iocbs = 1;
sp->vha = qpair->vha;
+ INIT_LIST_HEAD(&sp->elem);
+
done:
if (!sp)
QLA_QPAIR_MARK_NOT_BUSY(qpair);
next prev parent reply other threads:[~2018-08-07 18:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 18:51 [PATCH 4.14 00/21] 4.14.62-stable review Greg Kroah-Hartman
2018-08-07 18:51 ` Greg Kroah-Hartman [this message]
2018-08-07 18:51 ` [PATCH 4.14 02/21] scsi: qla2xxx: Fix NPIV deletion by calling wait_for_sess_deletion Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 03/21] scsi: qla2xxx: Fix ISP recovery on unload Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 04/21] scsi: qla2xxx: Return error when TMF returns Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 05/21] genirq: Make force irq threading setup more robust Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 06/21] nohz: Fix local_timer_softirq_pending() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 07/21] nohz: Fix missing tick reprogram when interrupting an inline softirq Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 08/21] netlink: Dont shift on 64 for ngroups Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 09/21] ext4: fix false negatives *and* false positives in ext4_check_descriptors() Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 10/21] ACPI / PCI: Bail early in acpi_pci_add_bus() if there is no ACPI handle Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 11/21] ring_buffer: tracing: Inherit the tracing setting to next ring buffer Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 13/21] Btrfs: fix file data corruption after cloning a range and fsync Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 14/21] nvme-pci: allocate device queues storage space at probe Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 15/21] nvme-pci: Fix queue double allocations Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 16/21] nvmet-fc: fix target sgl list on large transfers Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 17/21] intel_idle: Graceful probe failure when MWAIT is disabled Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 18/21] xfs: catch inode allocation state mismatch corruption Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 19/21] xfs: validate cached inodes are free when allocated Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 20/21] xfs: dont call xfs_da_shrink_inode with NULL bp Greg Kroah-Hartman
2018-08-07 18:51 ` [PATCH 4.14 21/21] jfs: Fix inconsistency between memory allocation and ea_buf->max_size Greg Kroah-Hartman
2018-08-08 2:55 ` [PATCH 4.14 00/21] 4.14.62-stable review Shuah Khan
2018-08-08 5:22 ` Naresh Kamboju
2018-08-08 15:48 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180807172331.014943210@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=himanshu.madhani@cavium.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quinn.tran@cavium.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).