CVE-2024-46842: scsi: lpfc: Handle mailbox timeouts in lpfc_get_sfp_info
In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Handle mailbox timeouts in lpfcgetsfpinfo
The MBXTIMEOUT return code is not handled in lpfcgetsfpinfo and the routine unconditionally frees submitted mailbox commands regardless of return status. The issue is that for MBXTIMEOUT cases, when firmware returns SFP information at a later time, that same mailbox memory region references previously freed memory in its cmpl routine.
Fix by adding checks for the MBXTIMEOUT return code. During mailbox resource cleanup, check the mbox flag to make sure that the wait did not timeout. If the MBOXWAKE flag is not set, then do not free the resources because it will be freed when firmware completes the mailbox at a later time in its cmpl routine.
Also, increase the timeout from 30 to 60 seconds to accommodate boot scripts requiring longer timeouts.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.22-1 - Configuration
Increase the timeout from 30 to 60 seconds to accommodate boot and boot scripts requiring longer timeouts.
Boot/initialization scripts (timeout setting) timeout = 60 seconds - Configuration
Fix lpfc_get_sfp_info to handle the MBX_TIMEOUT return code by adding checks for the MBX_TIMEOUT return code (i.e., do not proceed as if the mailbox returned successfully when MBX_TIMEOUT occurs).
lpfc_get_sfp_info MBX_TIMEOUT handling = Add checks for MBX_TIMEOUT return code - Configuration
In lpfc_get_sfp_info, if the MBOX_WAKE flag is not set, do not free the submitted mailbox resources because it will be freed when firmware completes the mailbox at a later time in its cmpl routine.
lpfc_get_sfp_info MBOX_WAKE behavior = If MBOX_WAKE not set, do not free resources - Configuration
During mailbox resource cleanup, check the mbox flag to make sure that the wait did not timeout before performing cleanup.
Mailbox resource cleanup logic mbox flag validation = Check mbox flag to ensure wait did not timeout
Event History
Frequently Asked Questions
What is the severity of CVE-2024-46842?
The severity of CVE-2024-46842 is classified as moderate.
How do I fix CVE-2024-46842?
To fix CVE-2024-46842, update your Linux kernel to version 6.12.11-1 or later.
Which software is affected by CVE-2024-46842?
CVE-2024-46842 affects Linux kernel versions prior to 6.10.10 and certain Debian packages.
What type of vulnerability is CVE-2024-46842?
CVE-2024-46842 is a mailbox timeout handling vulnerability in the SCSI lpfc driver.
Is CVE-2024-46842 exploitable remotely?
CVE-2024-46842 is not considered to be remotely exploitable.