CVE-2024-35954: scsi: sg: Avoid sg device teardown race

Published May 20, 2024
·
Updated

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

scsi: sg: Avoid sg device teardown race

sgremovesfpusercontext() must not use sgdevicedestroy() after calling scsideviceput().

sgdevicedestroy() is accessing the parent scsidevice requestqueue which will already be set to NULL when the preceding call to scsideviceput() removed the last reference to the parent scsidevice.

The resulting NULL pointer exception will then crash the kernel.

Other sources

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

scsi: sg: Avoid sg device teardown race

The Linux kernel CVE team has assigned CVE-2024-35954 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024052018-CVE-2024-35954-cdbf@gregkh/T

Red Hat

Affected Software

7 affected componentsFixes available
redhat/kernel<6.6.28
6.6.28
redhat/kernel<6.8.7
6.8.7
redhat/kernel<6.9
6.9
Linux Linux kernel>=6.4.7<6.6.28
Linux Linux kernel>=6.7<6.8.7
Linux Linux kernel=6.9-rc1
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1
  2. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.6.28
  3. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.8.7
  4. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.9
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch CVE-2024-35954
  6. Compensating control

    If patching is not immediately possible, mitigate by avoiding sg device teardown triggering the affected teardown path (e.g., prevent concurrent removal/unload of sg-related user contexts while SCSI sg devices are active), to reduce the chance of triggering the NULL pointer exception described for sg_device_destroy() after scsi_device_put().

Event History

May 20, 2024
CVE Published
via MITRE·09:41 AM
Data Sourced
via MITRE·09:41 AM
DescriptionSeverity
Data Sourced
via NVD·10:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·05:16 PM
DescriptionSeverityAffected Software
Jul 11, 2024
Data Sourced
via Launchpad·07:47 PM
Description
Mar 10, 2025
Data Sourced
via Ubuntu·12:11 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35954?

CVE-2024-35954 has been classified with a high severity rating due to the potential for a race condition in the Linux kernel.

2

How do I fix CVE-2024-35954?

To fix CVE-2024-35954, update the Linux kernel to versions 6.6.28, 6.8.7, or 6.9, or apply the patch provided by your Linux distribution.

3

Which Linux distributions are affected by CVE-2024-35954?

CVE-2024-35954 affects various versions of the Linux kernel across different distributions including Red Hat and Debian.

4

What is the nature of the vulnerability in CVE-2024-35954?

CVE-2024-35954 is a race condition vulnerability that occurs during the teardown process of SCSI generic (sg) devices, potentially leading to system instability.

5

Is there a workaround for CVE-2024-35954?

As of now, there is no documented workaround for CVE-2024-35954, and applying the appropriate kernel update is recommended.

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