GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2025-40285 (GCVE-0-2025-40285)

Vulnerability from cvelistv5 – Published: 2025-12-06 21:51 – Updated: 2026-08-05 12:09
VLAI
Title
smb/server: fix possible refcount leak in smb2_sess_setup()
Summary
In the Linux kernel, the following vulnerability has been resolved: smb/server: fix possible refcount leak in smb2_sess_setup() Reference count of ksmbd_session will leak when session need reconnect. Fix this by adding the missing ksmbd_user_session_put().
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 37a0e2b362b3150317fb6e2139de67b1e29ae5ff , < 6fc935f798d44a8eb8a5e6659198399fbf57b981 (git)
Affected: 450a844c045ff0895d41b05a1cbe8febd1acfcfd , < e671f9bb97805771380c98de944e2ceab6949188 (git)
Affected: a39e31e22a535d47b14656a7d6a893c7f6cf758c , < dcc51dfe6ff26b52cac106865a172ac982d78401 (git)
Affected: b95629435b84b9ecc0c765995204a4d8a913ed52 , < d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d (git)
Affected: b95629435b84b9ecc0c765995204a4d8a913ed52 , < 379510a815cb2e64eb0a379cb62295d6ade65df0 (git)
Affected: 2107ab40629aeabbec369cf34b8cf0f288c3eb1b (git)
Affected: 6.1.121 , < 6.1.159 (semver)
Affected: 6.6.67 , < 6.6.117 (semver)
Affected: 6.12.6 , < 6.12.59 (semver)
Affected: 5.15.176 , < 5.16 (semver)
guessed Create a notification for this product.
Linux Linux Affected: 6.13
Unaffected: 0 , < 6.13 (semver)
Unaffected: 6.1.159 , ≤ 6.1.* (semver)
Unaffected: 6.6.117 , ≤ 6.6.* (semver)
Unaffected: 6.12.59 , ≤ 6.12.* (semver)
Unaffected: 6.17.9 , ≤ 6.17.* (semver)
Unaffected: 6.18 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/smb/server/smb2pdu.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "6fc935f798d44a8eb8a5e6659198399fbf57b981",
              "status": "affected",
              "version": "37a0e2b362b3150317fb6e2139de67b1e29ae5ff",
              "versionType": "git"
            },
            {
              "lessThan": "e671f9bb97805771380c98de944e2ceab6949188",
              "status": "affected",
              "version": "450a844c045ff0895d41b05a1cbe8febd1acfcfd",
              "versionType": "git"
            },
            {
              "lessThan": "dcc51dfe6ff26b52cac106865a172ac982d78401",
              "status": "affected",
              "version": "a39e31e22a535d47b14656a7d6a893c7f6cf758c",
              "versionType": "git"
            },
            {
              "lessThan": "d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d",
              "status": "affected",
              "version": "b95629435b84b9ecc0c765995204a4d8a913ed52",
              "versionType": "git"
            },
            {
              "lessThan": "379510a815cb2e64eb0a379cb62295d6ade65df0",
              "status": "affected",
              "version": "b95629435b84b9ecc0c765995204a4d8a913ed52",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "2107ab40629aeabbec369cf34b8cf0f288c3eb1b",
              "versionType": "git"
            },
            {
              "lessThan": "6.1.159",
              "status": "affected",
              "version": "6.1.121",
              "versionType": "semver"
            },
            {
              "lessThan": "6.6.117",
              "status": "affected",
              "version": "6.6.67",
              "versionType": "semver"
            },
            {
              "lessThan": "6.12.59",
              "status": "affected",
              "version": "6.12.6",
              "versionType": "semver"
            },
            {
              "lessThan": "5.16",
              "status": "affected",
              "version": "5.15.176",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/smb/server/smb2pdu.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.13"
            },
            {
              "lessThan": "6.13",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.159",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.117",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.59",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.9",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.159",
                  "versionStartIncluding": "6.1.121",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.117",
                  "versionStartIncluding": "6.6.67",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.59",
                  "versionStartIncluding": "6.12.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.9",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "5.15.176",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nsmb/server: fix possible refcount leak in smb2_sess_setup()\n\nReference count of ksmbd_session will leak when session need reconnect.\nFix this by adding the missing ksmbd_user_session_put()."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.5,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:N - ksmbd is the in-kernel SMB server on TCP/445, and the leak is driven entirely by remote SMB2 SESSION_SETUP and LOGOFF PDUs on the attacker\u0027s own TCP connections. No local access to the target is required.\nAC:L - The attacker controls both sides of the race \u2014 it pipelines the SESSION_SETUP requests that take the reference and issues the LOGOFF/PreviousSessionId request that flips conn-\u003estatus to NEED_RECONNECT \u2014 and the window is wide because ksmbd_conn_wait_idle()/ksmbd_conn_wait_idle_sess_id() hold that status for the duration of the teardown (up to 120 s). Failed attempts are harmless and can be retried indefinitely.\nPR:N - smb2_check_user_session() explicitly bypasses session validation for SMB2_SESSION_SETUP, and the session is registered in conn-\u003esessions before any credential check, so the leaking lookup is reached with zero credentials. On the common guest-mapped ksmbd share, ntlm_authenticate() skips password verification for user_guest(), so the LOGOFF that flips the connection to NEED_RECONNECT is also available unauthenticated.\nUI:N - The attacker opens its own connections and issues every request itself; no legitimate user or administrator action is involved.\nS:U - The leaked session object and its pinned file references are kernel resources within the same security authority as the ksmbd server; no VM, IOMMU, or sandbox boundary is crossed.\nC:N - Nothing is read out of bounds and nothing is transmitted back to the client on this error path \u2014 the only effect is that a reference count is never decremented, so no kernel data is disclosed.\nI:N - No memory is written out of bounds or freed early; the object simply outlives its intended lifetime, so no kernel data or control flow is modified.\nA:H - Each won race permanently leaks a struct ksmbd_session plus its entire file table, so open struct file/inode/dentry references are pinned forever (also blocking unmount), and the attack is replayable without limit over surviving connections, driving unbounded kernel memory and handle exhaustion to OOM and system hang."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:09:15.214Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/6fc935f798d44a8eb8a5e6659198399fbf57b981"
        },
        {
          "url": "https://git.kernel.org/stable/c/e671f9bb97805771380c98de944e2ceab6949188"
        },
        {
          "url": "https://git.kernel.org/stable/c/dcc51dfe6ff26b52cac106865a172ac982d78401"
        },
        {
          "url": "https://git.kernel.org/stable/c/d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d"
        },
        {
          "url": "https://git.kernel.org/stable/c/379510a815cb2e64eb0a379cb62295d6ade65df0"
        }
      ],
      "title": "smb/server: fix possible refcount leak in smb2_sess_setup()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40285",
    "datePublished": "2025-12-06T21:51:09.590Z",
    "dateReserved": "2025-04-16T07:20:57.184Z",
    "dateUpdated": "2026-08-05T12:09:15.214Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-40285",
      "date": "2026-09-16",
      "epss": "0.00411",
      "percentile": "0.34829"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40285\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-12-06T22:15:56.667\",\"lastModified\":\"2026-07-30T06:24:26.730\",\"vulnStatus\":\"Deferred\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nsmb/server: fix possible refcount leak in smb2_sess_setup()\\n\\nReference count of ksmbd_session will leak when session need reconnect.\\nFix this by adding the missing ksmbd_user_session_put().\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"fs/smb/server/smb2pdu.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"37a0e2b362b3150317fb6e2139de67b1e29ae5ff\",\"lessThan\":\"6fc935f798d44a8eb8a5e6659198399fbf57b981\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"450a844c045ff0895d41b05a1cbe8febd1acfcfd\",\"lessThan\":\"e671f9bb97805771380c98de944e2ceab6949188\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"a39e31e22a535d47b14656a7d6a893c7f6cf758c\",\"lessThan\":\"dcc51dfe6ff26b52cac106865a172ac982d78401\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"b95629435b84b9ecc0c765995204a4d8a913ed52\",\"lessThan\":\"d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"b95629435b84b9ecc0c765995204a4d8a913ed52\",\"lessThan\":\"379510a815cb2e64eb0a379cb62295d6ade65df0\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"2107ab40629aeabbec369cf34b8cf0f288c3eb1b\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"6.1.121\",\"lessThan\":\"6.1.159\",\"versionType\":\"semver\",\"status\":\"affected\"},{\"version\":\"6.6.67\",\"lessThan\":\"6.6.117\",\"versionType\":\"semver\",\"status\":\"affected\"},{\"version\":\"6.12.6\",\"lessThan\":\"6.12.59\",\"versionType\":\"semver\",\"status\":\"affected\"},{\"version\":\"5.15.176\",\"lessThan\":\"5.16\",\"versionType\":\"semver\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"fs/smb/server/smb2pdu.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"6.13\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.13\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.1.159\",\"lessThanOrEqual\":\"6.1.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.6.117\",\"lessThanOrEqual\":\"6.6.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.59\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.17.9\",\"lessThanOrEqual\":\"6.17.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.18\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":7.5,\"baseSeverity\":\"HIGH\",\"attackVector\":\"NETWORK\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":3.9,\"impactScore\":3.6}]},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/379510a815cb2e64eb0a379cb62295d6ade65df0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/6fc935f798d44a8eb8a5e6659198399fbf57b981\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/dcc51dfe6ff26b52cac106865a172ac982d78401\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e671f9bb97805771380c98de944e2ceab6949188\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}",
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-30T10:19:35+00:00",
      "cve": "CVE-2025-40285",
      "id": "CVE-2025-40285",
      "initial_release_date": "2025-12-06T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: smb/server: fix possible refcount leak in smb2_sess_setup()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-40285.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-09-01T13:42:50Z",
      "cve": "CVE-2025-40285",
      "id": "CVE-2025-40285",
      "initial_release_date": "2025-12-08T00:22:58Z",
      "product_status:known_not_affected": "560",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-40285",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-40285.json",
      "version": "18"
    }
  }
}



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…