HIGH Introduced in 4.10
qla2xxx QueueCount Overflow
CVE-2026-89856
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI4.5MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: scsi: qla2xxx: Clamp MSI-X derived queue counts to avoid truncation ha->msix_count is u16, but ha->max_req_queues, ha->max_rsp_queues and ha->max_qpairs are u8. Deriving the queue count as "ha->max_req_queues = ha->msix_count - 1" therefore truncates: a board (or a misconfigured/malicious hot-plugged device) advertising 257 MSI-X vectors yields msix_count - 1 == 256, which truncates to 0. An MSI-X count of 1 zeroes it as well, and in target mode the subsequent "ha->max_req_queues--" then underflows 0 to 255. When the count is 0, qla2x00_alloc_queues() calls kzalloc_objs(struct req_que *, 0), which returns ZERO_SIZE_PTR. That is not NULL, so the allocation check passes and the following "ha->req_q_map[0] = req" dereferences ZERO_SIZE_PTR, corrupting memory or crashing the kernel. Add qla_calc_queue_count() to clamp the derived value into [1, QLA_MAX_QUEUES - 1] so it always fits in u8 and is never zero, and use it at all three derivation sites (qla25xx_iospace_config(), qla83xx_iospace_config() and qla24xx_enable_msix()). Also guard the target-mode decrement so it cannot reintroduce a zero (which would in turn underflow max_qpairs).
02KernelScan AI Analysis
Risk summary
A malicious or misconfigured QLogic Fibre Channel HBA advertising an unusual MSI-X vector count (257 or 1) triggers an integer truncation in the qla2xxx driver, causing a zero-size allocation to be dereferenced as a valid pointer and corrupting memory or crashing the kernel. Systems with QLogic FC HBAs in accessible PCIe slots are at risk; no software privileges are required beyond access to the device. The fix clamps the derived queue count to a safe non-zero range.
Vulnerability analysis
The qla2xxx driver derives hardware queue counts by subtracting one from the device's reported MSI-X vector count, but stores the result in a narrower integer type than the source. When a device advertises 257 MSI-X vectors (or only 1), the arithmetic truncates to zero, causing a zero-size memory allocation that returns a special non-NULL sentinel pointer. The driver treats this pointer as valid and writes through it, corrupting memory or crashing the kernel. In target mode, a subsequent decrement can also underflow zero to 255, producing an absurdly large queue count. The fix introduces a helper that clamps the queue count to a valid non-zero range that always fits in the destination type, and guards the target-mode decrement against reintroducing a zero. The vulnerability is reachable from a malicious or misconfigured QLogic Fibre Channel HBA that is present in or hot-plugged into a PCIe slot; no software privileges are required, only access to the hardware.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.10 | 5.10.270 | cf623d32761b |
| 5.15 | 4.10 | 5.15.221 | 9eeddbeaa896 |
| 6.1 | 4.10 | 6.1.188 | 802068b9b683 |
| 6.12 | 4.10 | 6.12.110 | 2efe50b2da82 |
| 6.18 | 4.10 | 6.18.51 | 7a448f5ed0b2 |
| 6.6 | 4.10 | 6.6.157 | e80adfeac61b |
| 7.2 | 4.10 | 7.2.5 | 33c77254e6e9 |
| mainline | 4.10 | 7.3 | ebfd35c64433 |
| cip/5.10 | 4.10 | 5.10.271-cip78 | cf623d32761b |
| cip/6.1 | 4.10 | 6.1.189-cip61 | 802068b9b683 |
| cip/6.1-rt | 4.10 | 6.1.189-cip61-rt32 | 802068b9b683 |
| cip/6.12 | 4.10 | 6.12.111-cip32 | 2efe50b2da82 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.268-cip77-rt34) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |