CVE-2021-47198
JSON

7.8high

scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine

Severity
7.8high CVSS:3.1 by NVD
Exploit likelihood
0.22% (higher than 13% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine An error is detected with the following report when unloading the driver: "KASAN: use-after-free in lpfc_unreg_rpi+0x1b1b" The NLP_REG_LOGIN_SEND nlp_flag is set in lpfc_reg_fab_ctrl_node(), but the flag is not cleared upon completion of the login. This allows a second call to lpfc_unreg_rpi() to proceed with nlp_rpi set to LPFC_RPI_ALLOW_ERROR. This results in a use after free access when used as an rpi_ids array index. Fix by clearing the NLP_REG_LOGIN_SEND nlp_flag in lpfc_mbx_cmpl_fc_reg_login().

Affected

Product or packageVersionsReported by
Linux Linuxfrom fe83e3b9b422ac8ece2359c7b7290efe7f0335a2 before dbebf865b3239595c1d4dba063b122862583b52a, from fe83e3b9b422ac8ece2359c7b7290efe7f0335a2 before 79b20beccea3a3938a8500acef4e6b9d7c66142f, 5.14
Not affected: before 5.14, from 5.15.5 up to 5.15.*, from 5.16 up to *
CVE List
linux linux_kernelfrom 5.14 before 5.15.5NVD

Classification

CWE-416

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix use-after-free in lpfc_unreg_rpi() routine An error is detected with the following report when unloading the driver: "KASAN: use-after-free in lpfc_unreg_rpi+0x1b1b" The NLP_REG_LOGIN_SEND nlp_flag is set in lpfc_reg_fab_ctrl_node(), but the flag is not cleared upon completion of the login. This allows a second call to lpfc_unreg_rpi() to proceed with nlp_rpi set to LPFC_RPI_ALLOW_ERROR. This results in a use after free access when used as an rpi_ids array index. Fix by clearing the NLP_REG_LOGIN_SEND nlp_flag in lpfc_mbx_cmpl_fc_reg_login().

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: scsi: lpfc: Fix use-after-free en la rutina lpfc_unreg_rpi() Se detecta un error con el siguiente reporte al descargar el driver: "KASAN: use-after-free en lpfc_unreg_rpi +0x1b1b" El NLP_REG_LOGIN_SEND nlp_flag está configurado en lpfc_reg_fab_ctrl_node(), pero el indicador no se borra al finalizar el inicio de sesión. Esto permite una segunda llamada a lpfc_unreg_rpi() para continuar con nlp_rpi configurado en LPFC_RPI_ALLOW_ERROR. Esto da como resultado un acceso de use after free cuando se usa como índice de matriz rpi_ids. Para solucionarlo, borre NLP_REG_LOGIN_SEND nlp_flag en lpfc_mbx_cmpl_fc_reg_login().

References

Sources

SourceRecordLicence
CVE ListCVE-2021-47198 changed 2026-05-11CVE Terms of Use
NVDCVE-2021-47198 changed 2026-06-17Public domain