• James Smart's avatar
    lpfc: Fix memory corruption of the lpfc_ncmd->list pointers · bbe3012b
    James Smart authored
    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: default avatarDick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    bbe3012b
lpfc_nvme.h 3.56 KB