CVE-2026-97529: scsi: qla2xxx: Validate BSG request_len before reading vendor_cmd[]
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
scsi: qla2xxx: Validate BSG request_len before reading vendor_cmd[]
The FC BSG transport allocates job->request via memdup_user() using the exact user-supplied request_len. For FC_BSG_HST_VENDOR, fc_bsg_host_dispatch() only guarantees request_len covers msgcode and vendor_id; it does not account for the vendor_cmd[] flexible array.
qla2xxx then reads the command selector vendor_cmd[0] and, in several sub-handlers, vendor_cmd[1]/[2] or structures overlaid on the vendor command area without verifying request_len. A caller holding CAP_SYS_RAWIO can submit a short request whose vendor_id matches the host, triggering out-of-bounds heap reads (KASAN-detectable, and able to mis-select a command or panic).
Add a central guard in qla2x00_process_vendor_specific() so the selector is always in bounds, restrict the early vendor_cmd[0] read in qla24xx_bsg_request() to sufficiently long vendor messages, and add request_len checks to the sub-handlers that read further:qla24xx_proc_fcp_prio_cfg_cmd(), qla2x00_process_loopback(), qla84xx_reset(), qla84xx_updatefw(), qla2x00_read_optrom(), qla2x00_update_optrom(), qlafx00_mgmt_cmd() and qla28xx_validate_flash_image().
The Linux kernel CVE team has assigned CVE-2026-97529 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.10 with commit 01e0e15c8b3b32e006e5cccac10c8b377ac3d803 and fixed in 6.18.53 with commit 740f3458a4798af54aaf8cf63e797d407e8b6d3b Issue introduced in 4.10 with commit 01e0e15c8b3b32e006e5cccac10c8b377ac3d803 and fixed in 7.2.7 with commit f75bff451a2fac5aed82f9641df1e9a42c5a899d Issue introduced in 4.10 with commit 01e0e15c8b3b32e006e5cccac10c8b377ac3d803 and fixed in 7.3-rc1 with commit 4cf38dd9465736141263ebb63375868311a0ec81
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-97529
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/scsi/qla2xxx/qla_bsg.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/740f3458a4798af54aaf8cf63e797d407e8b6d3b https://git.kernel.org/stable/c/f75bff451a2fac5aed82f9641df1e9a42c5a899d https://git.kernel.org/stable/c/4cf38dd9465736141263ebb63375868311a0ec81