CVE-2022-49159: scsi: qla2xxx: Implement ref count for SRB

Published Feb 26, 2025
·
Updated

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

scsi: qla2xxx: Implement ref count for SRB

The timeout handler and the done function are racing. When qla2x00asynciocbtimeout() starts to run it can be preempted by the normal response path (via the firmware?). qla24xxasyncgpscspdone() releases the SRB unconditionally. When scheduling back to qla2x00asynciocbtimeout() qla24xxasyncabortcmd() will access an freed sp->qpair pointer:

qla2xxx [0000:83:00.0]-2871:0: Async-gpsc timeout - hdl=63d portid=234500 50:06:0e:80:08:77:b6:21. qla2xxx [0000:83:00.0]-2853:0: Async done-gpsc res 0, WWPN 50:06:0e:80:08:77:b6:21 qla2xxx [0000:83:00.0]-2854:0: Async-gpsc OUT WWPN 20:45:00:27:f8:75:33:00 speeds=2c00 speed=0400. qla2xxx [0000:83:00.0]-28d8:0: qla24xxhandlegpscevent 50:06:0e:80:08:77:b6:21 DS 7 LS 6 rc 0 login 1|1 rscn 1|0 lid 5 BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 IP: qla24xxasyncabortcmd+0x1b/0x1c0 [qla2xxx]

Obvious solution to this is to introduce a reference counter. One reference is taken for the normal code path (the 'good' case) and one for the timeout path. As we always race between the normal good case and the timeout/abort handler we need to serialize it. Also we cannot assume any order between the handlers. Since this is slow path we can use proper synchronization via locks.

When we are able to cancel a timer (deltimer returns 1) we know there can't be any error handling in progress because the timeout handler hasn't expired yet, thus we can safely decrement the refcounter by one.

If we are not able to cancel the timer, we know an abort handler is running. We have to make sure we call sp->done() in the abort handlers before calling krefput().

Affected Software

4 affected components
Linux Foundation Linux Kernel
Linux Linux kernel>=5.15<5.15.33
Linux Linux kernel>=5.16<5.16.19
Linux Linux kernel>=5.17<5.17.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Linux kernel qla2xxx (qla24xx) to a version that resolves this vulnerability.

    Patch Implement ref count for SRB

Event History

Feb 26, 2025
CVE Published
via MITRE·01:55 AM
Data Sourced
via MITRE·01:55 AM
DescriptionSeverity
Data Sourced
via NVD·07:00 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-49159?

CVE-2022-49159 has been classified with a severity level that can lead to potential denial of service vulnerabilities.

2

Who is affected by CVE-2022-49159?

CVE-2022-49159 affects systems running specific versions of the Linux kernel that utilize the qla2xxx SCSI driver.

3

How do I fix CVE-2022-49159?

To mitigate CVE-2022-49159, update the Linux kernel to the latest version where the vulnerability has been patched.

4

What are the potential impacts of CVE-2022-49159?

The impacts of CVE-2022-49159 include data corruption and system instability due to race conditions in the SCSI driver.

5

Is there a workaround for CVE-2022-49159?

Currently, there are no effective workarounds for CVE-2022-49159 other than applying the recommended kernel updates.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203