{
  "schemaVersion": 1,
  "attribution": [
    {
      "source": "CISA Known Exploited Vulnerabilities",
      "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
      "licence": "US government work"
    },
    {
      "source": "GitHub Advisory Database",
      "url": "https://github.com/advisories",
      "licence": "CC BY 4.0"
    },
    {
      "source": "Have I Been Pwned",
      "url": "https://haveibeenpwned.com/",
      "licence": "CC BY 4.0"
    },
    {
      "source": "CVE Program (CVE records)",
      "url": "https://www.cve.org/Legal/TermsOfUse",
      "licence": "CVE Terms of Use",
      "notice": "Copyright © 1999-2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation.",
      "terms": "CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy."
    },
    {
      "source": "FIRST EPSS",
      "url": "https://www.first.org/epss/",
      "licence": "free to use; FIRST requests attribution"
    }
  ],
  "record": {
    "id": "CVE-2024-56631",
    "sourceURL": "https://www.cve.org/CVERecord?id=CVE-2024-56631",
    "idYear": 2024,
    "status": "PUBLISHED",
    "publishedAt": "2024-12-27T15:02:29.428Z",
    "updatedAt": "2026-10-15T00:59:50.536Z",
    "importedAt": "2026-10-24T01:57:20.494Z",
    "snapshot": {
      "id": "cve_2026-10-24_midnight_baseline",
      "at": "2026-10-24T00:00:00.000Z",
      "source": "https://github.com/CVEProject/cvelistV5/releases/tag/cve_2026-10-24_0100Z"
    },
    "facts": {
      "title": "scsi: sg: Fix slab-use-after-free read in sg_release()",
      "summary": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: sg: Fix slab-use-after-free read in sg_release()\n\nFix a use-after-free bug in sg_release(), detected by syzbot with KASAN:\n\nBUG: KASAN: slab-use-after-free in lock_release+0x151/0xa30\nkernel/locking/lockdep.c:5838\n__mutex_unlock_slowpath+0xe2/0x750 kernel/locking/mutex.c:912\nsg_release+0x1f4/0x2e0 drivers/scsi/sg.c:407\n\nIn sg_release(), the function kref_put(&sfp->f_ref, sg_remove_sfp) is\ncalled before releasing the open_rel_lock mutex. The kref_put() call may\ndecrement the reference count of sfp to zero, triggering its cleanup\nthrough sg_remove_sfp(). This cleanup includes scheduling deferred work\nvia sg_remove_sfp_usercontext(), which ultimately frees sfp.\n\nAfter kref_put(), sg_release() continues to unlock open_rel_lock and may\nreference sfp or sdp. If sfp has already been freed, this results in a\nslab-use-after-free error.\n\nMove the kref_put(&sfp->f_ref, sg_remove_sfp) call after unlocking the\nopen_rel_lock mutex. This ensures:\n\n - No references to sfp or sdp occur after the reference count is\n   decremented.\n\n - Cleanup functions such as sg_remove_sfp() and\n   sg_remove_sfp_usercontext() can safely execute without impacting the\n   mutex handling in sg_release().\n\nThe fix has been tested and validated by syzbot. This patch closes the\nbug reported at the following syzkaller link and ensures proper\nsequencing of resource cleanup and mutex operations, eliminating the\nrisk of use-after-free errors in sg_release().",
      "affected": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "e19acb1926c4a1f30ee1ec84d8afba2d975bd534"
            },
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "285ce1f89f8d414e7eecab5ef5118cd512596318"
            },
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "198b89dd5a595ee3f96e5ce5c448b0484cd0e53c"
            },
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "275b8347e21ab8193e93223a8394a806e4ba8918"
            },
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "59b30afa578637169e2819536bb66459fdddc39d"
            },
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "1f5e2f1ca5875728fcf62bc1a054707444ab4960"
            },
            {
              "version": "cc833acbee9db5ca8c6162b015b4c93863c6f821",
              "status": "affected",
              "versionType": "git",
              "lessThan": "f10593ad9bc36921f623361c9e3dd96bd52d85ee"
            },
            {
              "version": "3a27c0defb0315760100f8b1adc7c4acbe04c884",
              "status": "affected",
              "versionType": "git"
            },
            {
              "version": "3.16.85",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "3.17"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "versions": [
            {
              "version": "3.17",
              "status": "affected"
            },
            {
              "version": "0",
              "status": "unaffected",
              "versionType": "semver",
              "lessThan": "3.17"
            },
            {
              "version": "5.4.290",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.4.*"
            },
            {
              "version": "5.10.234",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.10.*"
            },
            {
              "version": "5.15.177",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.15.*"
            },
            {
              "version": "6.1.127",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.1.*"
            },
            {
              "version": "6.6.66",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.6.*"
            },
            {
              "version": "6.12.5",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.12.*"
            },
            {
              "version": "6.13",
              "status": "unaffected",
              "versionType": "original_commit_for_fix",
              "lessThanOrEqual": "*"
            }
          ]
        }
      ]
    }
  }
}