scsi: qla2xxx: Null out freed pointers in qla2x00_mem_alloc() error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d64d6c5671db5e693a0caaee79f2571b098749c9 · < a57570229edb7a0990d5c8067daeb9ac8858a961| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: qla2xxx: Null out freed pointers in qla2x00_mem_alloc() error path
When qla2x00_mem_alloc() fails, qla2x00_probe_one() jumps to probe_hw_failed and calls qla2x00_mem_free(). Several error labels in qla2x00_mem_alloc() freed adapter members (elsrej.c, purex_dma_pool, flt, sfp_data, loop_id_map, async_pd, sf_init_cb, ex_init_cb, npiv_info) but left the pointers dangling. qla2x00_mem_free() then freed them a second time. Worse, for the dma_pool members it issued dma_pool_free(ha->s_dma_pool, ...) after s_dma_pool had already been destroyed and set to NULL at fail_s_dma_pool, dereferencing a NULL pool.
Clear each freed pointer (and its DMA handle) in the error labels so the subsequent qla2x00_mem_free() skips them.
From the CVE record · Linux
The Linux kernel’s qla2xxx driver can free memory twice or dereference a NULL DMA pool when memory allocation fails during device probing. This can cause a crash; the input does not describe an attacker path, authentication requirements, or user interaction.
Engineers running Linux systems that use the qla2xxx SCSI driver should check whether their kernel is affected; affected versions were not provided.