Commit 65dd25df authored by Wenchao Hao's avatar Wenchao Hao Committed by Cheng Yu
Browse files

scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup()

mainline inclusion
from mainline-v6.7-rc1
commit 4df105f0ce9f6f30cda4e99f577150d23f0c9c5f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RG0L
CVE: CVE-2023-52809

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4df105f0ce9f6f30cda4e99f577150d23f0c9c5f



----------------------------------------

fc_lport_ptp_setup() did not check the return value of fc_rport_create()
which can return NULL and would cause a NULL pointer dereference. Address
this issue by checking return value of fc_rport_create() and log error
message on fc_rport_create() failed.

Signed-off-by: default avatarWenchao Hao <haowenchao2@huawei.com>
Link: https://lore.kernel.org/r/20231011130350.819571-1-haowenchao2@huawei.com


Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarCheng Yu <serein.chengyu@huawei.com>
parent 505199cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment