CVE-2026-89847 in Linuxinfo

Summary

by MITRE • 09/16/2026

In the Linux kernel, the following vulnerability has been resolved:

scsi: qla2xxx: Avoid double completion in async IOCB timeout

qla2x00_async_iocb_timeout() tries to abort a timed-out async IOCB. When qla24xx_async_abort_cmd() fails, both the SRB_LOGIN_CMD path and the SRB_CTRL_VP/default path scan outstanding_cmds[] for the SRB and then
call sp->done(sp, QLA_FUNCTION_TIMEOUT) unconditionally, without checking whether the SRB was actually found and removed.

If the response ISR completes the same handle first, it removes the SRB under qp_lock_ptr and runs sp->done() -> complete(sp->comp). The submitter qla24xx_control_vp() wakes from wait_for_completion(), clears sp->comp, drops its reference and returns, reclaiming the on-stack completion. The timer reference keeps the SRB alive across the timeout handler, but not the submitter's stack. The timeout then issues a second sp->done() -> qla_ctrlvp_sp_done(), which evaluates "if (sp->comp) complete(sp->comp)"; with the pointer loaded before the submitter's NULL store, complete() writes into the freed stack frame, a use-after-free.

Track whether this path removed the SRB from outstanding_cmds and only call sp->done() when it did, so the command is completed exactly once by whichever path owns it. This mirrors the sp_found guard already used in qla24xx_abort_iocb_timeout().

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 09/16/2026

The Linux kernel SCSI subsystem contains a critical concurrency flaw within the QLogic Fibre Channel driver, specifically affecting the qla2xxx module's handling of asynchronous IOCB timeouts. The vulnerability arises from improper synchronization and state management during command abortion procedures. When an asynchronous I/O control block times out, the function qla2x00_async_iocb_timeout attempts to abort the associated SCSI request by invoking qla24xx_async_abort_cmd. This routine scans the outstanding commands list for a matching SRB (SCSI Request Block) and removes it if found. However, in scenarios where this removal fails or is not properly tracked across all execution paths, specifically within the SRB_LOGIN_CMD and SRB_CTRL_VP default handlers, the code proceeds to unconditionally call sp->done with QLA_FUNCTION_TIMEOUT. This unconditional invocation occurs without verifying whether the SRB was successfully located and removed from the outstanding list, creating a race condition that leads to memory corruption.

The operational impact of this flaw is severe, manifesting as a use-after-free vulnerability due to double completion of the same SCSI request block. The core issue lies in the interaction between the interrupt service routine responsible for completing commands and the timeout handler managing asynchronous operations. If the response ISR completes the command handle first, it removes the SRB from the outstanding list under lock protection and executes sp->done followed by complete(sp->comp). This action wakes up the submitting thread via wait_for_completion(), which then clears the completion pointer, drops its reference count, and returns, thereby reclaiming the on-stack completion structure. Although the timer reference keeps the SRB object alive in memory across the timeout handler execution, it does not protect the stack-allocated completion variable from being reclaimed by the submitter thread. Consequently, when the timeout handler subsequently issues a second sp->done call leading to qla_ctrlvp_sp_done(), it evaluates if (sp->comp) complete(sp->comp). Because the pointer was loaded before the submitter's NULL store took effect, the complete function writes into the already freed stack frame. This use-after-free can lead to kernel panics, data corruption, or potentially arbitrary code execution depending on how the overwritten memory is utilized by subsequent operations.

This vulnerability aligns with CWE-416, Use After Free, as it involves accessing memory that has been deallocated due to incorrect lifecycle management of shared resources. Furthermore, from a threat modeling perspective using MITRE ATT&CK frameworks, this flaw relates to techniques involving exploitation of race conditions and improper handling of system objects, which can be leveraged for privilege escalation or denial of service attacks against the host operating system. The lack of atomic checks on whether an SRB was actually removed allows multiple execution paths to believe they own the completion responsibility, violating the principle that a resource should have exactly one owner at any given time during its lifecycle management in concurrent environments.

To mitigate this vulnerability and prevent similar issues in future code revisions, developers must ensure strict ownership semantics for SCSI request blocks during asynchronous operations. The fix involves tracking whether the abort path successfully removed the SRB from the outstanding_cmds list before invoking sp->done(). By mirroring the guard logic already present in qla24xx_abort_iocb_timeout(), where a check is performed to confirm removal, the code ensures that the command is completed exactly once by whichever execution path legitimately owns it. This approach eliminates the race condition by preventing the timeout handler from acting on an SRB that has already been processed and freed by the interrupt context or submitter thread. Implementing such checks requires careful synchronization using appropriate locking mechanisms to ensure atomicity of the check-and-complete operation, thereby preserving memory integrity and system stability under high-concurrency scenarios typical in storage subsystems.

Responsible

Linux

Reservation

09/11/2026

Disclosure

09/16/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!