CVE-2023-52480 (GCVE-0-2023-52480)
Vulnerability from cvelistv5
Published
2024-02-29 05:43
Modified
2026-08-15 12:23
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix race condition between session lookup and expire Thread A + Thread B ksmbd_session_lookup | smb2_sess_setup sess = xa_load | | | xa_erase(&conn->sessions, sess->id); | | ksmbd_session_destroy(sess) --> kfree(sess) | // UAF! | sess->last_active = jiffies | + This patch add rwsem to fix race condition between ksmbd_session_lookup and ksmbd_expire_session.
Impacted products
Vendor Product Version
Linux Linux Version: a6a9601ba995d0fec635324cb9fd8d14f9bea14e
Version: 1fc8a2b14ef5223f8e0b95faba2ee0a6e4d0f99d
Version: ea174a91893956450510945a0c5d1a10b5323656
Version: ea174a91893956450510945a0c5d1a10b5323656
Version: 750a2d772e9d9ff377fd32e3b6797bf2cd847a7a
Version: 6775ee7ef4b37c521aa4cf3730f54554c4875542
Version: 6.1.29   
Version: 6.2.16   
Version: 6.3.2   
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T23:03:19.830Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/c77fd3e25a51ac92b0f1b347a96eff6a0b4f066f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a2ca5fd3dbcc665e1169044fa0c9e3eba779202b"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/18ced78b0ebccc2d16f426143dc56ab3aad666be"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/53ff5cf89142b978b1a5ca8dc4d4425e6a09745f"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2023-52480",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T15:57:23.856280Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:33:52.199Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/smb/server/connection.c",
            "fs/smb/server/connection.h",
            "fs/smb/server/mgmt/user_session.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "c77fd3e25a51ac92b0f1b347a96eff6a0b4f066f",
              "status": "affected",
              "version": "a6a9601ba995d0fec635324cb9fd8d14f9bea14e",
              "versionType": "git"
            },
            {
              "lessThan": "a2ca5fd3dbcc665e1169044fa0c9e3eba779202b",
              "status": "affected",
              "version": "1fc8a2b14ef5223f8e0b95faba2ee0a6e4d0f99d",
              "versionType": "git"
            },
            {
              "lessThan": "18ced78b0ebccc2d16f426143dc56ab3aad666be",
              "status": "affected",
              "version": "ea174a91893956450510945a0c5d1a10b5323656",
              "versionType": "git"
            },
            {
              "lessThan": "53ff5cf89142b978b1a5ca8dc4d4425e6a09745f",
              "status": "affected",
              "version": "ea174a91893956450510945a0c5d1a10b5323656",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "750a2d772e9d9ff377fd32e3b6797bf2cd847a7a",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "6775ee7ef4b37c521aa4cf3730f54554c4875542",
              "versionType": "git"
            },
            {
              "lessThan": "6.1.57",
              "status": "affected",
              "version": "6.1.29",
              "versionType": "semver"
            },
            {
              "lessThan": "6.3",
              "status": "affected",
              "version": "6.2.16",
              "versionType": "semver"
            },
            {
              "lessThan": "6.4",
              "status": "affected",
              "version": "6.3.2",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/smb/server/connection.c",
            "fs/smb/server/connection.h",
            "fs/smb/server/mgmt/user_session.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.4"
            },
            {
              "lessThan": "6.4",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.57",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.5.*",
              "status": "unaffected",
              "version": "6.5.7",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.6",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.57",
                  "versionStartIncluding": "6.1.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.5.7",
                  "versionStartIncluding": "6.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6",
                  "versionStartIncluding": "6.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.2.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.3.2",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix race condition between session lookup and expire\n\n Thread A                        +  Thread B\n ksmbd_session_lookup            |  smb2_sess_setup\n   sess = xa_load                |\n                                 |\n                                 |    xa_erase(\u0026conn-\u003esessions, sess-\u003eid);\n                                 |\n                                 |    ksmbd_session_destroy(sess) --\u003e kfree(sess)\n                                 |\n   // UAF!                       |\n   sess-\u003elast_active = jiffies   |\n                                 +\n\nThis patch add rwsem to fix race condition between ksmbd_session_lookup\nand ksmbd_expire_session."
        }
      ],
      "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 on TCP/445; the UAF is reached by processing remotely supplied SMB2 SESSION_SETUP and concurrent session-bearing PDUs in ksmbd worker threads, with no local access required.\nAC:L - The attacker controls both sides of the race by sending concurrent requests on the same connection\u2014one path calls unlocked ksmbd_session_lookup while another SESSION_SETUP(SessionId=0) runs ksmbd_session_register\u2192ksmbd_expire_session\u2192kfree\u2014and can retry freely via the ksmbd-io workqueue.\nPR:N - SESSION_SETUP with SessionId=0 creates an SMB2_SESSION_IN_PROGRESS session before any credential check, and expire destroys any non-VALID session; smb2_check_user_session still enters ksmbd_session_lookup and performs the UAF write before the VALID-state filter, so no authentication is required.\nUI:N - Exploitation is driven entirely by the remote attacker\u2019s SMB traffic to ksmbd; no local user or administrator action is needed beyond ksmbd already listening.\nS:U - This is a standard in-kernel use-after-free within the host kernel\u2019s security authority and does not cross a VM, IOMMU, or sandbox boundary.\nC:H - The race is a use-after-free on struct ksmbd_session; reclaiming the freed object (including forging state==VALID so lookup_all returns a dangling sess) yields a kernel read primitive over session keys, pointers, and adjacent heap.\nI:H - ksmbd_session_lookup performs a write of jiffies into freed session memory, and a reclaimed fake session is then consumed by later SMB command handling\u2014an exploitable UAF write/control-flow hijack primitive in ring 0.\nA:H - Even without full exploitation, the UAF read/write on a kfree\u2019d session crashes ksmbd worker threads (KASAN slab-UAF / oops/panic), and an unauthenticated attacker can retrigger the race indefinitely."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-15T12:23:49.816Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/c77fd3e25a51ac92b0f1b347a96eff6a0b4f066f"
        },
        {
          "url": "https://git.kernel.org/stable/c/a2ca5fd3dbcc665e1169044fa0c9e3eba779202b"
        },
        {
          "url": "https://git.kernel.org/stable/c/18ced78b0ebccc2d16f426143dc56ab3aad666be"
        },
        {
          "url": "https://git.kernel.org/stable/c/53ff5cf89142b978b1a5ca8dc4d4425e6a09745f"
        }
      ],
      "title": "ksmbd: fix race condition between session lookup and expire",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-52480",
    "datePublished": "2024-02-29T05:43:12.019Z",
    "dateReserved": "2024-02-20T12:30:33.300Z",
    "dateUpdated": "2026-08-15T12:23:49.816Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/c77fd3e25a51ac92b0f1b347a96eff6a0b4f066f\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/a2ca5fd3dbcc665e1169044fa0c9e3eba779202b\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/18ced78b0ebccc2d16f426143dc56ab3aad666be\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/53ff5cf89142b978b1a5ca8dc4d4425e6a09745f\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T23:03:19.830Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2023-52480\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-09-10T15:57:23.856280Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-09-11T12:42:19.316Z\"}}], \"cna\": {\"title\": \"ksmbd: fix race condition between 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 on TCP/445; the UAF is reached by processing remotely supplied SMB2 SESSION_SETUP and concurrent session-bearing PDUs in ksmbd worker threads, with no local access required.\\nAC:L - The attacker controls both sides of the race by sending concurrent requests on the same connection\\u2014one path calls unlocked ksmbd_session_lookup while another SESSION_SETUP(SessionId=0) runs ksmbd_session_register\\u2192ksmbd_expire_session\\u2192kfree\\u2014and can retry freely via the ksmbd-io workqueue.\\nPR:N - SESSION_SETUP with SessionId=0 creates an SMB2_SESSION_IN_PROGRESS session before any credential check, and expire destroys any non-VALID session; smb2_check_user_session still enters ksmbd_session_lookup and performs the UAF write before the VALID-state filter, so no authentication is required.\\nUI:N - Exploitation is driven entirely by the remote attacker\\u2019s SMB traffic to ksmbd; no local user or administrator action is needed beyond ksmbd already listening.\\nS:U - This is a standard in-kernel use-after-free within the host kernel\\u2019s security authority and does not cross a VM, IOMMU, or sandbox boundary.\\nC:H - The race is a use-after-free on struct ksmbd_session; reclaiming the freed object (including forging state==VALID so lookup_all returns a dangling sess) yields a kernel read primitive over session keys, pointers, and adjacent heap.\\nI:H - ksmbd_session_lookup performs a write of jiffies into freed session memory, and a reclaimed fake session is then consumed by later SMB command handling\\u2014an exploitable UAF write/control-flow hijack primitive in ring 0.\\nA:H - Even without full exploitation, the UAF read/write on a kfree\\u2019d session crashes ksmbd worker threads (KASAN slab-UAF / oops/panic), and an unauthenticated attacker can retrigger the race indefinitely.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"a6a9601ba995d0fec635324cb9fd8d14f9bea14e\", \"lessThan\": \"c77fd3e25a51ac92b0f1b347a96eff6a0b4f066f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"1fc8a2b14ef5223f8e0b95faba2ee0a6e4d0f99d\", \"lessThan\": \"a2ca5fd3dbcc665e1169044fa0c9e3eba779202b\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ea174a91893956450510945a0c5d1a10b5323656\", \"lessThan\": \"18ced78b0ebccc2d16f426143dc56ab3aad666be\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"ea174a91893956450510945a0c5d1a10b5323656\", \"lessThan\": \"53ff5cf89142b978b1a5ca8dc4d4425e6a09745f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"750a2d772e9d9ff377fd32e3b6797bf2cd847a7a\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6775ee7ef4b37c521aa4cf3730f54554c4875542\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6.1.29\", \"lessThan\": \"6.1.57\", \"versionType\": \"semver\"}, {\"status\": \"affected\", \"version\": \"6.2.16\", \"lessThan\": \"6.3\", \"versionType\": \"semver\"}, {\"status\": \"affected\", \"version\": \"6.3.2\", \"lessThan\": \"6.4\", \"versionType\": \"semver\"}], \"programFiles\": [\"fs/smb/server/connection.c\", \"fs/smb/server/connection.h\", \"fs/smb/server/mgmt/user_session.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.4\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.4\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.1.57\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.1.*\"}, {\"status\": \"unaffected\", \"version\": \"6.5.7\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.5.*\"}, {\"status\": \"unaffected\", \"version\": \"6.6\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"fs/smb/server/connection.c\", \"fs/smb/server/connection.h\", \"fs/smb/server/mgmt/user_session.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/c77fd3e25a51ac92b0f1b347a96eff6a0b4f066f\"}, {\"url\": \"https://git.kernel.org/stable/c/a2ca5fd3dbcc665e1169044fa0c9e3eba779202b\"}, {\"url\": \"https://git.kernel.org/stable/c/18ced78b0ebccc2d16f426143dc56ab3aad666be\"}, {\"url\": \"https://git.kernel.org/stable/c/53ff5cf89142b978b1a5ca8dc4d4425e6a09745f\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nksmbd: fix race condition between session lookup and expire\\n\\n Thread A                        +  Thread B\\n ksmbd_session_lookup            |  smb2_sess_setup\\n   sess = xa_load                |\\n                                 |\\n                                 |    xa_erase(\u0026conn-\u003esessions, sess-\u003eid);\\n                                 |\\n                                 |    ksmbd_session_destroy(sess) --\u003e kfree(sess)\\n                                 |\\n   // UAF!                       |\\n   sess-\u003elast_active = jiffies   |\\n                                 +\\n\\nThis patch add rwsem to fix race condition between ksmbd_session_lookup\\nand ksmbd_expire_session.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.1.57\", \"versionStartIncluding\": \"6.1.29\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.5.7\", \"versionStartIncluding\": \"6.4\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.6\", \"versionStartIncluding\": \"6.4\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionStartIncluding\": \"6.2.16\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionStartIncluding\": \"6.3.2\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-15T12:23:49.816Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2023-52480\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-15T12:23:49.816Z\", \"dateReserved\": \"2024-02-20T12:30:33.300Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-02-29T05:43:12.019Z\", \"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…