]> git.baikalelectronics.ru Git - kernel.git/commit
lpfc: Fix memory corruption of the lpfc_ncmd->list pointers
authorJames Smart <jsmart2021@gmail.com>
Sat, 22 Apr 2017 00:49:08 +0000 (17:49 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 25 Apr 2017 18:00:58 +0000 (20:00 +0200)
commitd8b308e554557bc739c02a885fa2769d180fae98
treebcc1fa183ac7c391c3a002c3bfd6bb6446a99fe8
parentff3f3051f75f2560002b3233d33e7afb5eae62b2
lpfc: Fix memory corruption of the lpfc_ncmd->list pointers

lpfc was changing the private pointer that is set/maintained by
the nvme_fc transport. This caused two issues: a) the transport, on
teardown may erroneous attempt to free whatever address was set;
and b) lfpc uses any value set in lpfc_nvme_fcp_abort() and
assumes its a valid io request.

Correct issue by properly defining a context structure for lpfc.
Lpfc also updated to clear the private context structure on io
completion.

Since this bug caused scrutiny of the way lpfc moves local request
structures between lists, also cleaned up list_del()'s to
list_del_inits()'s.

This is a nvme-specific bug. The patch was cut against the
linux-block tree, for-4.12/block tree. It should be pulled in through
that tree.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/lpfc/lpfc_nvme.c
drivers/scsi/lpfc/lpfc_nvme.h