]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: libfc: Fix use after free in fc_exch_abts_resp()
authorJianglei Nie <niejianglei2021@163.com>
Thu, 3 Mar 2022 01:51:15 +0000 (09:51 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 9 Mar 2022 03:32:31 +0000 (22:32 -0500)
commit84ab03a37a87c00c9080ada6a85906854c33e152
tree59f71dc5ce1127a2aacd75b4b0dfe4bca1fdb8ea
parent7a5e7fcd83d145aa249135b33bd39c147d13fc1d
scsi: libfc: Fix use after free in fc_exch_abts_resp()

fc_exch_release(ep) will decrease the ep's reference count. When the
reference count reaches zero, it is freed. But ep is still used in the
following code, which will lead to a use after free.

Return after the fc_exch_release() call to avoid use after free.

Link: https://lore.kernel.org/r/20220303015115.459778-1-niejianglei2021@163.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_exch.c