CVE-2024-35954 (GCVE-0-2024-35954)

Vulnerability from cvelistv5 – Published: 2024-05-20 09:41 – Updated: 2026-08-05 11:31
VLAI
Title
scsi: sg: Avoid sg device teardown race
Summary
In the Linux kernel, the following vulnerability has been resolved: scsi: sg: Avoid sg device teardown race sg_remove_sfp_usercontext() must not use sg_device_destroy() after calling scsi_device_put(). sg_device_destroy() is accessing the parent scsi_device request_queue which will already be set to NULL when the preceding call to scsi_device_put() removed the last reference to the parent scsi_device. The resulting NULL pointer exception will then crash the kernel.
SSVC
Exploitation: none Automatable: no Technical Impact: partial
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2024-05-20 17:01 UTC
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: db59133e927916d8a25ee1fd8264f2808040909d , < 46af9047523e2517712ae8e71d984286c626e022 (git)
Affected: db59133e927916d8a25ee1fd8264f2808040909d , < b0d1ebcc1a9560e494ea9b3ee808540db26c5086 (git)
Affected: db59133e927916d8a25ee1fd8264f2808040909d , < 27f58c04a8f438078583041468ec60597841284d (git)
Affected: 4cc664e59bf2553771e4c9e90f758f7434cfdc22 (git)
Affected: 6.4.7 , < 6.5 (semver)
guessed Create a notification for this product.
Linux Linux Affected: 6.5
Unaffected: 0 , < 6.5 (semver)
Unaffected: 6.6.28 , ≤ 6.6.* (semver)
Unaffected: 6.8.7 , ≤ 6.8.* (semver)
Unaffected: 6.9 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-35954",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-20T17:01:34.449905Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:34:37.893Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T03:21:49.126Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/46af9047523e2517712ae8e71d984286c626e022"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/b0d1ebcc1a9560e494ea9b3ee808540db26c5086"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/27f58c04a8f438078583041468ec60597841284d"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/scsi/sg.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "46af9047523e2517712ae8e71d984286c626e022",
              "status": "affected",
              "version": "db59133e927916d8a25ee1fd8264f2808040909d",
              "versionType": "git"
            },
            {
              "lessThan": "b0d1ebcc1a9560e494ea9b3ee808540db26c5086",
              "status": "affected",
              "version": "db59133e927916d8a25ee1fd8264f2808040909d",
              "versionType": "git"
            },
            {
              "lessThan": "27f58c04a8f438078583041468ec60597841284d",
              "status": "affected",
              "version": "db59133e927916d8a25ee1fd8264f2808040909d",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "4cc664e59bf2553771e4c9e90f758f7434cfdc22",
              "versionType": "git"
            },
            {
              "lessThan": "6.5",
              "status": "affected",
              "version": "6.4.7",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/scsi/sg.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.5"
            },
            {
              "lessThan": "6.5",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.28",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.9",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.28",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.8.7",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.9",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.4.7",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: sg: Avoid sg device teardown race\n\nsg_remove_sfp_usercontext() must not use sg_device_destroy() after calling\nscsi_device_put().\n\nsg_device_destroy() is accessing the parent scsi_device request_queue which\nwill already be set to NULL when the preceding call to scsi_device_put()\nremoved the last reference to the parent scsi_device.\n\nThe resulting NULL pointer exception will then crash the kernel."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerable path is entered by opening and closing the `/dev/sgN` character device, i.e. local file/syscall access to the SCSI generic driver. There is no network-facing consumer of `sg_remove_sfp_usercontext()`.\nAC:L - The attacker holds one side of the race directly (it owns the open sg fd and chooses when to `close()`), and can supply the other side by hot-unplugging its own removable SCSI/USB storage or by looping open/close across a hot-unplug; once sg holds the last `scsi_device` reference the ordering bug fires deterministically, and the attempt is freely repeatable.\nPR:L - No capability check exists on this path \u2014 only DAC permission on `/dev/sgN`, which is granted to the unprivileged `disk` group on mainstream distros and is world-accessible on many embedded/appliance and storage-software deployments; the device-removal side (physical unplug, transport loss, hypervisor hot-unplug) needs no privilege either.\nUI:N - The attacker performs the `open()`, triggers the device teardown, and performs the final `close()` from its own process; no victim action is required.\nS:U - The use-after-free and the resulting corruption are confined to kernel memory within the same security authority, with no VM, IOMMU, or sandbox boundary crossed.\nC:H - `sg_device_destroy()` dereferences the already-`kfree()`d `struct scsi_device`, and the reclaimed slab can be groomed so the stale `request_queue` pointer aims `blk_trace_remove()`/`blk_put_queue()` at attacker-chosen kernel memory, yielding a leverageable kernel-memory disclosure primitive.\nI:H - The stale pointer loaded from freed memory is used for writes \u2014 `mutex_lock(\u0026q-\u003edebugfs_mutex)`, `rcu_replace_pointer(q-\u003eblk_trace, NULL)`, and `refcount_dec_and_test(\u0026q-\u003erefs)` \u2014 so a reallocated slab gives a controlled write into kernel memory and a path to control-flow hijack.\nA:H - In the common case the stale value is NULL and `blk_trace_remove(NULL)`/`blk_put_queue(NULL)` immediately oops the kernel, as stated in the fix commit; the crash is repeatable and takes down the whole system."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:31:11.820Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/46af9047523e2517712ae8e71d984286c626e022"
        },
        {
          "url": "https://git.kernel.org/stable/c/b0d1ebcc1a9560e494ea9b3ee808540db26c5086"
        },
        {
          "url": "https://git.kernel.org/stable/c/27f58c04a8f438078583041468ec60597841284d"
        }
      ],
      "title": "scsi: sg: Avoid sg device teardown race",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-35954",
    "datePublished": "2024-05-20T09:41:47.944Z",
    "dateReserved": "2024-05-17T13:50:33.135Z",
    "dateUpdated": "2026-08-05T11:31:11.820Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2024-35954",
      "date": "2026-09-21",
      "epss": "0.00241",
      "percentile": "0.15513"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "drivers/scsi/sg.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "46af9047523e2517712ae8e71d984286c626e022",
                    "status": "affected",
                    "version": "db59133e927916d8a25ee1fd8264f2808040909d",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "b0d1ebcc1a9560e494ea9b3ee808540db26c5086",
                    "status": "affected",
                    "version": "db59133e927916d8a25ee1fd8264f2808040909d",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "27f58c04a8f438078583041468ec60597841284d",
                    "status": "affected",
                    "version": "db59133e927916d8a25ee1fd8264f2808040909d",
                    "versionType": "git"
                  },
                  {
                    "status": "affected",
                    "version": "4cc664e59bf2553771e4c9e90f758f7434cfdc22",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "6.5",
                    "status": "affected",
                    "version": "6.4.7",
                    "versionType": "semver"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "drivers/scsi/sg.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "6.5"
                  },
                  {
                    "lessThan": "6.5",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.6.*",
                    "status": "unaffected",
                    "version": "6.6.28",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.8.*",
                    "status": "unaffected",
                    "version": "6.8.7",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.9",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "B86F4EE1-72C4-46B3-A0E8-2532E186FFC4",
                    "versionEndExcluding": "6.6.28",
                    "versionStartIncluding": "6.4.7",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "531BDFB5-EF6A-4707-902E-146368303499",
                    "versionEndExcluding": "6.8.7",
                    "versionStartIncluding": "6.7",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:*",
                    "matchCriteriaId": "22BEDD49-2C6D-402D-9DBF-6646F6ECD10B",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: sg: Avoid sg device teardown race\n\nsg_remove_sfp_usercontext() must not use sg_device_destroy() after calling\nscsi_device_put().\n\nsg_device_destroy() is accessing the parent scsi_device request_queue which\nwill already be set to NULL when the preceding call to scsi_device_put()\nremoved the last reference to the parent scsi_device.\n\nThe resulting NULL pointer exception will then crash the kernel."
          },
          {
            "lang": "es",
            "value": " En el kernel de Linux, se resolvi\u00f3 la siguiente vulnerabilidad: scsi: sg: Evite la ejecuci\u00f3n de desmontaje del dispositivo sg sg_remove_sfp_usercontext() no debe usar sg_device_destroy() despu\u00e9s de llamar a scsi_device_put(). sg_device_destroy() est\u00e1 accediendo al scsi_device principal request_queue que ya estar\u00e1 configurado en NULL cuando la llamada anterior a scsi_device_put() elimin\u00f3 la \u00faltima referencia al scsi_device principal. La excepci\u00f3n de puntero NULL resultante bloquear\u00e1 el kernel."
          }
        ],
        "id": "CVE-2024-35954",
        "lastModified": "2026-08-04T11:18:15.050",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            },
            {
              "cvssData": {
                "attackComplexity": "HIGH",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 4.7,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "NONE",
                "integrityImpact": "NONE",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.0,
              "impactScore": 3.6,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ],
          "ssvcV203": [
            {
              "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "ssvcData": {
                "id": "CVE-2024-35954",
                "options": [
                  {
                    "exploitation": "none"
                  },
                  {
                    "automatable": "no"
                  },
                  {
                    "technicalImpact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-20T17:01:34.449905Z",
                "version": "2.0.3"
              }
            }
          ]
        },
        "published": "2024-05-20T10:15:10.780",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/27f58c04a8f438078583041468ec60597841284d"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/46af9047523e2517712ae8e71d984286c626e022"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/b0d1ebcc1a9560e494ea9b3ee808540db26c5086"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/27f58c04a8f438078583041468ec60597841284d"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/46af9047523e2517712ae8e71d984286c626e022"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/b0d1ebcc1a9560e494ea9b3ee808540db26c5086"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Modified",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-476"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-08-04T18:58:09+00:00",
      "cve": "CVE-2024-35954",
      "id": "CVE-2024-35954",
      "initial_release_date": "2024-05-20T00:00:00+00:00",
      "product_status:fixed": "280",
      "product_status:known_affected": "42",
      "product_status:known_not_affected": "78",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: scsi: sg: Avoid sg device teardown race",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-35954.json",
      "version": "3"
    },
    "vulnrichment": {
      "containers": {
        "adp": [
          {
            "providerMetadata": {
              "dateUpdated": "2024-08-02T03:21:49.126Z",
              "orgId": "af854a3a-2127-422b-91ae-364da2661108",
              "shortName": "CVE"
            },
            "references": [
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/46af9047523e2517712ae8e71d984286c626e022"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/b0d1ebcc1a9560e494ea9b3ee808540db26c5086"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/27f58c04a8f438078583041468ec60597841284d"
              }
            ],
            "title": "CVE Program Container"
          },
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2024-35954",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2024-05-20T17:01:34.449905Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2024-05-23T19:01:24.997Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "defaultStatus": "unaffected",
              "product": "Linux",
              "programFiles": [
                "drivers/scsi/sg.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "lessThan": "46af9047523e2517712ae8e71d984286c626e022",
                  "status": "affected",
                  "version": "db59133e927916d8a25ee1fd8264f2808040909d",
                  "versionType": "git"
                },
                {
                  "lessThan": "b0d1ebcc1a9560e494ea9b3ee808540db26c5086",
                  "status": "affected",
                  "version": "db59133e927916d8a25ee1fd8264f2808040909d",
                  "versionType": "git"
                },
                {
                  "lessThan": "27f58c04a8f438078583041468ec60597841284d",
                  "status": "affected",
                  "version": "db59133e927916d8a25ee1fd8264f2808040909d",
                  "versionType": "git"
                },
                {
                  "status": "affected",
                  "version": "4cc664e59bf2553771e4c9e90f758f7434cfdc22",
                  "versionType": "git"
                },
                {
                  "lessThan": "6.5",
                  "status": "affected",
                  "version": "6.4.7",
                  "versionType": "semver"
                }
              ]
            },
            {
              "defaultStatus": "affected",
              "product": "Linux",
              "programFiles": [
                "drivers/scsi/sg.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "status": "affected",
                  "version": "6.5"
                },
                {
                  "lessThan": "6.5",
                  "status": "unaffected",
                  "version": "0",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.6.*",
                  "status": "unaffected",
                  "version": "6.6.28",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.8.*",
                  "status": "unaffected",
                  "version": "6.8.7",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "*",
                  "status": "unaffected",
                  "version": "6.9",
                  "versionType": "original_commit_for_fix"
                }
              ]
            }
          ],
          "cpeApplicability": [
            {
              "nodes": [
                {
                  "cpeMatch": [
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.6.28",
                      "versionStartIncluding": "6.5",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.8.7",
                      "versionStartIncluding": "6.5",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.9",
                      "versionStartIncluding": "6.5",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionStartIncluding": "6.4.7",
                      "vulnerable": true
                    }
                  ],
                  "negate": false,
                  "operator": "OR"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: sg: Avoid sg device teardown race\n\nsg_remove_sfp_usercontext() must not use sg_device_destroy() after calling\nscsi_device_put().\n\nsg_device_destroy() is accessing the parent scsi_device request_queue which\nwill already be set to NULL when the preceding call to scsi_device_put()\nremoved the last reference to the parent scsi_device.\n\nThe resulting NULL pointer exception will then crash the kernel."
            }
          ],
          "metrics": [
            {
              "cvssV3_1": {
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "scenarios": [
                {
                  "lang": "en",
                  "value": "AV:L - The vulnerable path is entered by opening and closing the `/dev/sgN` character device, i.e. local file/syscall access to the SCSI generic driver. There is no network-facing consumer of `sg_remove_sfp_usercontext()`.\nAC:L - The attacker holds one side of the race directly (it owns the open sg fd and chooses when to `close()`), and can supply the other side by hot-unplugging its own removable SCSI/USB storage or by looping open/close across a hot-unplug; once sg holds the last `scsi_device` reference the ordering bug fires deterministically, and the attempt is freely repeatable.\nPR:L - No capability check exists on this path \u2014 only DAC permission on `/dev/sgN`, which is granted to the unprivileged `disk` group on mainstream distros and is world-accessible on many embedded/appliance and storage-software deployments; the device-removal side (physical unplug, transport loss, hypervisor hot-unplug) needs no privilege either.\nUI:N - The attacker performs the `open()`, triggers the device teardown, and performs the final `close()` from its own process; no victim action is required.\nS:U - The use-after-free and the resulting corruption are confined to kernel memory within the same security authority, with no VM, IOMMU, or sandbox boundary crossed.\nC:H - `sg_device_destroy()` dereferences the already-`kfree()`d `struct scsi_device`, and the reclaimed slab can be groomed so the stale `request_queue` pointer aims `blk_trace_remove()`/`blk_put_queue()` at attacker-chosen kernel memory, yielding a leverageable kernel-memory disclosure primitive.\nI:H - The stale pointer loaded from freed memory is used for writes \u2014 `mutex_lock(\u0026q-\u003edebugfs_mutex)`, `rcu_replace_pointer(q-\u003eblk_trace, NULL)`, and `refcount_dec_and_test(\u0026q-\u003erefs)` \u2014 so a reallocated slab gives a controlled write into kernel memory and a path to control-flow hijack.\nA:H - In the common case the stale value is NULL and `blk_trace_remove(NULL)`/`blk_put_queue(NULL)` immediately oops the kernel, as stated in the fix commit; the crash is repeatable and takes down the whole system."
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-08-05T11:31:11.820Z",
            "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "shortName": "Linux"
          },
          "references": [
            {
              "url": "https://git.kernel.org/stable/c/46af9047523e2517712ae8e71d984286c626e022"
            },
            {
              "url": "https://git.kernel.org/stable/c/b0d1ebcc1a9560e494ea9b3ee808540db26c5086"
            },
            {
              "url": "https://git.kernel.org/stable/c/27f58c04a8f438078583041468ec60597841284d"
            }
          ],
          "title": "scsi: sg: Avoid sg device teardown race",
          "x_generator": {
            "engine": "bippy-1.2.0"
          }
        }
      },
      "cveMetadata": {
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "assignerShortName": "Linux",
        "cveId": "CVE-2024-35954",
        "datePublished": "2024-05-20T09:41:47.944Z",
        "dateReserved": "2024-05-17T13:50:33.135Z",
        "dateUpdated": "2026-08-05T11:31:11.820Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…