]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free()
authorJames Smart <james.smart@broadcom.com>
Tue, 20 Oct 2020 20:27:13 +0000 (13:27 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:26:34 +0000 (14:26 +0100)
commit6cd51ee984d47ed37bcf469a66e9edcc1aac111d
tree62b8ebc6e6910b1d8c7fedca1418383b56065029
parent61e9ff18f2e94151e468a92f47b10b95da688f9e
scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free()

BugLink: https://bugs.launchpad.net/bugs/1910822
commit e5785d3ec32f5f44dd88cd7b398e496742630469 upstream.

Commit 9816ef6ecbc1 ("scsi: lpfc: Use after free in lpfc_rq_buf_free()")
was made to correct a use after free condition in lpfc_rq_buf_free().
Unfortunately, a subsequent patch cut on a tree without the fix
inadvertently reverted the fix.

Put the fix back: Move the freeing of the rqb_entry to after the print
function that references it.

Link: https://lore.kernel.org/r/20201020202719.54726-4-james.smart@broadcom.com
Fixes: 411de511c694 ("scsi: lpfc: Fix RQ empty firmware trap")
Cc: <stable@vger.kernel.org> # v4.17+
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/scsi/lpfc/lpfc_mem.c