CVE-2024-58087 (GCVE-0-2024-58087)
Vulnerability from cvelistv5
Published
2025-03-12 07:28
Modified
2026-08-05 11:47
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix racy issue from session lookup and expire Increment the session reference count within the lock for lookup to avoid racy issue with session expire.
Impacted products
Vendor Product Version
Linux Linux Version: 0626e6641f6b467447c81dd7678a69c66f7746cf
Version: 0626e6641f6b467447c81dd7678a69c66f7746cf
Version: 0626e6641f6b467447c81dd7678a69c66f7746cf
Version: 0626e6641f6b467447c81dd7678a69c66f7746cf
Version: 0626e6641f6b467447c81dd7678a69c66f7746cf
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "HIGH",
              "attackVector": "NETWORK",
              "availabilityImpact": "HIGH",
              "baseScore": 8.1,
              "baseSeverity": "HIGH",
              "confidentialityImpact": "HIGH",
              "integrityImpact": "HIGH",
              "privilegesRequired": "NONE",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2024-58087",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-10-01T19:26:55.319254Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "cweId": "CWE-667",
                "description": "CWE-667 Improper Locking",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-10-01T19:36:35.134Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/smb/server/auth.c",
            "fs/smb/server/mgmt/user_session.c",
            "fs/smb/server/server.c",
            "fs/smb/server/smb2pdu.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "2107ab40629aeabbec369cf34b8cf0f288c3eb1b",
              "status": "affected",
              "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
              "versionType": "git"
            },
            {
              "lessThan": "37a0e2b362b3150317fb6e2139de67b1e29ae5ff",
              "status": "affected",
              "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
              "versionType": "git"
            },
            {
              "lessThan": "450a844c045ff0895d41b05a1cbe8febd1acfcfd",
              "status": "affected",
              "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
              "versionType": "git"
            },
            {
              "lessThan": "a39e31e22a535d47b14656a7d6a893c7f6cf758c",
              "status": "affected",
              "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
              "versionType": "git"
            },
            {
              "lessThan": "b95629435b84b9ecc0c765995204a4d8a913ed52",
              "status": "affected",
              "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/smb/server/auth.c",
            "fs/smb/server/mgmt/user_session.c",
            "fs/smb/server/server.c",
            "fs/smb/server/smb2pdu.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.15"
            },
            {
              "lessThan": "5.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.176",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.121",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.67",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.176",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.121",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.67",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.6",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix racy issue from session lookup and expire\n\nIncrement the session reference count within the lock for lookup to avoid\nracy issue with session expire."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 9.8,
            "baseSeverity": "CRITICAL",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:N - ksmbd is the in-kernel SMB server processing requests received on TCP port 445; every affected path (`smb2_sess_setup`, `smb2_check_user_session`, `smb3_decrypt_req`, `__handle_ksmbd_work`) is driven directly by attacker-supplied SMB2 PDUs from a remote peer.\nAC:L - The attacker controls both sides of the race \u2014 it pipelines up to 8192 concurrent requests per connection (each handled by a separate ksmbd-io kworker), drives sessions into EXPIRED/IN_PROGRESS state so `ksmbd_expire_session()` frees them with no timeout, and the `__handle_ksmbd_work` window spans an entire AES-GCM response encryption. A lost race yields only a benign SMB error, so it can be retried indefinitely.\nPR:N - Two of the three unreferenced lookups live inside `smb2_sess_setup()` \u2014 the authentication handshake itself \u2014 and operate on attacker-supplied, sequentially-allocated (trivially enumerable) session IDs before any credential is verified, including `ksmbd_session_lookup_slowpath()` against the global session table. Additionally, `ntlm_authenticate()` skips password verification entirely for guest/anonymous users, so under the common \"map to guest\" configuration an unauthenticated peer obtains a VALID session and reaches all remaining paths.\nUI:N - Exploitation requires only that the attacker send SMB2 requests to the listening ksmbd service; no action by any local user or administrator is involved.\nS:U - The use-after-free corrupts kernel heap memory within the kernel\u0027s own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The freed `struct ksmbd_session` is read after free, including `smb3encryptionkey`/`smb3decryptionkey`/`smb3signingkey` \u2014 `encrypt_resp()` encrypts responses using whatever now occupies that slab, leaking freed kernel memory to the wire; controlling the reallocated `sess-\u003euser` and `file_table` pointers escalates this to arbitrary kernel read.\nI:H - The bug yields multiple write primitives on freed memory \u2014 `atomic_inc/dec` on `sess-\u003erefcnt`, `sess-\u003estate = SMB2_SESSION_EXPIRED`, `sess-\u003euser = NULL`, and `kfree(sess-\u003ePreauth_HashValue)` plus xarray-walking frees in `ksmbd_session_destroy()` \u2014 giving arbitrary-free and controlled-pointer corruption suitable for control-flow hijack, and `sess-\u003euser` directly governs SMB access-control decisions.\nA:H - Any lost race dereferences freed slab memory, reliably producing a kernel oops or panic in the ksmbd worker, and the attacker can trigger it repeatedly from the network to take down the file server."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T11:47:38.424Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/2107ab40629aeabbec369cf34b8cf0f288c3eb1b"
        },
        {
          "url": "https://git.kernel.org/stable/c/37a0e2b362b3150317fb6e2139de67b1e29ae5ff"
        },
        {
          "url": "https://git.kernel.org/stable/c/450a844c045ff0895d41b05a1cbe8febd1acfcfd"
        },
        {
          "url": "https://git.kernel.org/stable/c/a39e31e22a535d47b14656a7d6a893c7f6cf758c"
        },
        {
          "url": "https://git.kernel.org/stable/c/b95629435b84b9ecc0c765995204a4d8a913ed52"
        },
        {
          "url": "https://www.zerodayinitiative.com/advisories/ZDI-25-100/"
        }
      ],
      "title": "ksmbd: fix racy issue from session lookup and expire",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2024-58087",
    "datePublished": "2025-03-12T07:28:09.114Z",
    "dateReserved": "2025-03-06T15:52:09.185Z",
    "dateUpdated": "2026-08-05T11:47:38.424Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 8.1, \"attackVector\": \"NETWORK\", \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H\", \"integrityImpact\": \"HIGH\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"HIGH\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"NONE\", \"confidentialityImpact\": \"HIGH\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-58087\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"total\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-10-01T19:26:55.319254Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-667\", \"description\": \"CWE-667 Improper Locking\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-10-01T16:57:53.976Z\"}}], \"cna\": {\"title\": \"ksmbd: fix racy issue from session lookup and expire\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 9.8, \"baseSeverity\": \"CRITICAL\", \"vectorString\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:N - ksmbd is the in-kernel SMB server processing requests received on TCP port 445; every affected path (`smb2_sess_setup`, `smb2_check_user_session`, `smb3_decrypt_req`, `__handle_ksmbd_work`) is driven directly by attacker-supplied SMB2 PDUs from a remote peer.\\nAC:L - The attacker controls both sides of the race \\u2014 it pipelines up to 8192 concurrent requests per connection (each handled by a separate ksmbd-io kworker), drives sessions into EXPIRED/IN_PROGRESS state so `ksmbd_expire_session()` frees them with no timeout, and the `__handle_ksmbd_work` window spans an entire AES-GCM response encryption. A lost race yields only a benign SMB error, so it can be retried indefinitely.\\nPR:N - Two of the three unreferenced lookups live inside `smb2_sess_setup()` \\u2014 the authentication handshake itself \\u2014 and operate on attacker-supplied, sequentially-allocated (trivially enumerable) session IDs before any credential is verified, including `ksmbd_session_lookup_slowpath()` against the global session table. Additionally, `ntlm_authenticate()` skips password verification entirely for guest/anonymous users, so under the common \\\"map to guest\\\" configuration an unauthenticated peer obtains a VALID session and reaches all remaining paths.\\nUI:N - Exploitation requires only that the attacker send SMB2 requests to the listening ksmbd service; no action by any local user or administrator is involved.\\nS:U - The use-after-free corrupts kernel heap memory within the kernel\u0027s own security authority; no VM, IOMMU, or sandbox boundary is crossed.\\nC:H - The freed `struct ksmbd_session` is read after free, including `smb3encryptionkey`/`smb3decryptionkey`/`smb3signingkey` \\u2014 `encrypt_resp()` encrypts responses using whatever now occupies that slab, leaking freed kernel memory to the wire; controlling the reallocated `sess-\u003euser` and `file_table` pointers escalates this to arbitrary kernel read.\\nI:H - The bug yields multiple write primitives on freed memory \\u2014 `atomic_inc/dec` on `sess-\u003erefcnt`, `sess-\u003estate = SMB2_SESSION_EXPIRED`, `sess-\u003euser = NULL`, and `kfree(sess-\u003ePreauth_HashValue)` plus xarray-walking frees in `ksmbd_session_destroy()` \\u2014 giving arbitrary-free and controlled-pointer corruption suitable for control-flow hijack, and `sess-\u003euser` directly governs SMB access-control decisions.\\nA:H - Any lost race dereferences freed slab memory, reliably producing a kernel oops or panic in the ksmbd worker, and the attacker can trigger it repeatedly from the network to take down the file server.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"0626e6641f6b467447c81dd7678a69c66f7746cf\", \"lessThan\": \"2107ab40629aeabbec369cf34b8cf0f288c3eb1b\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"0626e6641f6b467447c81dd7678a69c66f7746cf\", \"lessThan\": \"37a0e2b362b3150317fb6e2139de67b1e29ae5ff\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"0626e6641f6b467447c81dd7678a69c66f7746cf\", \"lessThan\": \"450a844c045ff0895d41b05a1cbe8febd1acfcfd\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"0626e6641f6b467447c81dd7678a69c66f7746cf\", \"lessThan\": \"a39e31e22a535d47b14656a7d6a893c7f6cf758c\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"0626e6641f6b467447c81dd7678a69c66f7746cf\", \"lessThan\": \"b95629435b84b9ecc0c765995204a4d8a913ed52\", \"versionType\": \"git\"}], \"programFiles\": [\"fs/smb/server/auth.c\", \"fs/smb/server/mgmt/user_session.c\", \"fs/smb/server/server.c\", \"fs/smb/server/smb2pdu.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.15\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.15\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.15.176\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"6.1.121\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6.67\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.12.6\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.12.*\"}, {\"status\": \"unaffected\", \"version\": \"6.13\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"fs/smb/server/auth.c\", \"fs/smb/server/mgmt/user_session.c\", \"fs/smb/server/server.c\", \"fs/smb/server/smb2pdu.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/2107ab40629aeabbec369cf34b8cf0f288c3eb1b\"}, {\"url\": \"https://git.kernel.org/stable/c/37a0e2b362b3150317fb6e2139de67b1e29ae5ff\"}, {\"url\": \"https://git.kernel.org/stable/c/450a844c045ff0895d41b05a1cbe8febd1acfcfd\"}, {\"url\": \"https://git.kernel.org/stable/c/a39e31e22a535d47b14656a7d6a893c7f6cf758c\"}, {\"url\": \"https://git.kernel.org/stable/c/b95629435b84b9ecc0c765995204a4d8a913ed52\"}, {\"url\": \"https://www.zerodayinitiative.com/advisories/ZDI-25-100/\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nksmbd: fix racy issue from session lookup and expire\\n\\nIncrement the session reference count within the lock for lookup to avoid\\nracy issue with session expire.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.176\", \"versionStartIncluding\": \"5.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.1.121\", \"versionStartIncluding\": \"5.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6.67\", \"versionStartIncluding\": \"5.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.12.6\", \"versionStartIncluding\": \"5.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.13\", \"versionStartIncluding\": \"5.15\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T11:47:38.424Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-58087\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T11:47:38.424Z\", \"dateReserved\": \"2025-03-06T15:52:09.185Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2025-03-12T07:28:09.114Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…