In the Linux kernel, the following vulnerability has been resolved:
scsi: qla2xxx: Fix use-after-free of qpair work on queue teardown
The response queue MSI-X handler qla2xxx_msix_rsp_q() schedules
qla_do_work() via queue_work(ha->wq, &qpair->q_work). qla_do_work()
dereferences the qpair (vha, rsp) and takes qpair->qp_lock.
During teardown, qla2xxx_delete_qpair() deletes the response queue, which
calls free_irq() in qla25xx_free_rsp_que(), and then frees the queue and
the qpair. free_irq() waits for running hardirq handlers but does not
cancel work already placed on ha->wq. A still-pending q_work then runs
qla_do_work() against the freed qpair and response queue, causing a
use-after-free. This is especially likely during full adapter teardown,
where destroy_workqueue(ha->wq) forces pending work to run after the queue
pairs have been freed.
Flush the work item with cancel_work_sync() in qla25xx_free_rsp_que()
after free_irq() has released the interrupt (so no new work can be
queued) and before the response queue and qpair memory are freed (so the
flushed handler still sees valid memory). Guard on rsp->qpair and ha->wq
to match the INIT_WORK() condition and avoid operating on an
uninitialized work_struct.
CVSS Vector: CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.5
AV:A - qla2xxx_msix_rsp_q() queue_work()s &qpair->q_work when firmware posts FC/FCoE response-queue IOCBs (STATUS_TYPE/FCP_RSP, LOGINOUT, CT/ELS); qla25xx_free_rsp_que() is reached from qla2xxx_delete_qpair() via qla25xx_delete_rsp_que(). IS_CNA_CAPABLE QLogic CNAs speak FCoE on the SAN fabric, an L2/adjacent transport not a routable IP service.
AC:H - The UAF fires only when qla25xx_free_rsp_que() free_irq()s then kfree()s rsp and qla2xxx_delete_qpair() kfree()s the qpair while q_work is still queued. Those run from qla24xx_vport_delete() (fc_vport sysfs S_IWUSR) or qla2x00_free_device() after scsi_remove_host, a victim qpair/adapter teardown a fabric peer cannot initiate.
PR:N - qla2xxx_msix_rsp_q() handles unauthenticated Fibre Channel/FCoE firmware completions in IRQ context with no capable() or Linux credential check, so a SAN N_Port needs no account on the victim. The teardown path is victim-side and does not grant the fabric attacker host privileges.
UI:N - qla2xxx_msix_rsp_q() schedules q_work automatically on response-queue interrupts. Concurrent qpair teardown in qla24xx_vport_delete() or qla2x00_remove_one()->qla2x00_free_device() is driver/NPIV/PCI lifecycle, not a victim mount or open of attacker-supplied media.
S:U - kfree of struct qla_qpair and struct rsp_que and the later qla_do_work() use-after-free stay inside the host kernel qla2xxx driver and do not cross a VM, IOMMU, or other separate security-authority boundary.
C:H - After kfree(qpair) and kfree(rsp), qla_do_work() container_of()s the freed qpair, loads qpair->vha and qpair->rsp, then qla24xx_process_response_queue() reads the dangling rsp ring/IOCBs. That kernel heap use-after-free enables disclosure of reused object contents.
I:H - qla_do_work() takes spin_lock_irqsave(&qpair->qp_lock) on the freed qpair and qla24xx_process_response_queue() writes rsp->ring_index and completion state through dangling rsp/req pointers, yielding a kernel write and control-flow hijack primitive.
A:H - Use-after-free of qpair from qla_do_work() produces a kernel oops or panic even when not fully exploited. qla2x00_free_device() calls destroy_workqueue(ha->wq) after qla25xx_delete_queues() has already kfree'd the qpairs, forcing pending q_work to run against freed memory.
| Attack Vector |
Adjacent Network |
Scope |
Unchanged |
| Attack Complexity |
High |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:A - qla2xxx_msix_rsp_q() queue_work()s &qpair->q_work when firmware posts FC/FCoE response-queue IOCBs (STATUS_TYPE/FCP_RSP, LOGINOUT, CT/ELS); qla25xx_free_rsp_que() is reached from qla2xxx_delete_qpair() via qla25xx_delete_rsp_que(). IS_CNA_CAPABLE QLogic CNAs speak FCoE on the SAN fabric, an L2/adjacent transport not a routable IP service.
AC:H - The UAF fires only when qla25xx_free_rsp_que() free_irq()s then kfree()s rsp and qla2xxx_delete_qpair() kfree()s the qpair while q_work is still queued. Those run from qla24xx_vport_delete() (fc_vport sysfs S_IWUSR) or qla2x00_free_device() after scsi_remove_host, a victim qpair/adapter teardown a fabric peer cannot initiate.
PR:N - qla2xxx_msix_rsp_q() handles unauthenticated Fibre Channel/FCoE firmware completions in IRQ context with no capable() or Linux credential check, so a SAN N_Port needs no account on the victim. The teardown path is victim-side and does not grant the fabric attacker host privileges.
UI:N - qla2xxx_msix_rsp_q() schedules q_work automatically on response-queue interrupts. Concurrent qpair teardown in qla24xx_vport_delete() or qla2x00_remove_one()->qla2x00_free_device() is driver/NPIV/PCI lifecycle, not a victim mount or open of attacker-supplied media.
S:U - kfree of struct qla_qpair and struct rsp_que and the later qla_do_work() use-after-free stay inside the host kernel qla2xxx driver and do not cross a VM, IOMMU, or other separate security-authority boundary.
C:H - After kfree(qpair) and kfree(rsp), qla_do_work() container_of()s the freed qpair, loads qpair->vha and qpair->rsp, then qla24xx_process_response_queue() reads the dangling rsp ring/IOCBs. That kernel heap use-after-free enables disclosure of reused object contents.
I:H - qla_do_work() takes spin_lock_irqsave(&qpair->qp_lock) on the freed qpair and qla24xx_process_response_queue() writes rsp->ring_index and completion state through dangling rsp/req pointers, yielding a kernel write and control-flow hijack primitive.
A:H - Use-after-free of qpair from qla_do_work() produces a kernel oops or panic even when not fully exploited. qla2x00_free_device() calls destroy_workqueue(ha->wq) after qla25xx_delete_queues() has already kfree'd the qpairs, forcing pending q_work to run against freed memory.
CVSS 3.1