]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix list corruption detected in lpfc_put_sgl_per_hdwq
authorJames Smart <jsmart2021@gmail.com>
Sun, 22 Sep 2019 03:59:02 +0000 (20:59 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 1 Oct 2019 02:07:11 +0000 (22:07 -0400)
commit8de1b716254c076947b1dfd26116fd7f3c1f73d0
tree449816283867ba8228f8f425c4cfbdad4e104beb
parentc0fff4ea58eddb823ae63c4accd246b17f9a3963
scsi: lpfc: Fix list corruption detected in lpfc_put_sgl_per_hdwq

In lpfc_release_io_buf, an lpfc_io_buf is returned to the 'available' pool
before any associated sgl or cmd and rsp buffers are returned via their
respective 'put' routines.  If xri rebalancing occurs and an lpfc_io_buf
structure is reused quickly, there may be a race condition between release
of old and association of new resources.

Re-ordered lpfc_release_io_buf to release sgl and cmd/rsp
buffer lists before releasing the lpfc_io_buf structure for re-use.

Fixes: 5eaddb9a5459 ("scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware.")
Link: https://lore.kernel.org/r/20190922035906.10977-17-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c