{"id":"CVE-2025-37926","state":"PUBLISHED","title":"ksmbd: fix use-after-free in ksmbd_session_rpc_open","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in ksmbd_session_rpc_open\n\nA UAF issue can occur due to a race condition between\nksmbd_session_rpc_open() and __session_rpc_close().\nAdd rpc_lock to the session to protect it.","publishedAt":"2025-05-20T15:21:53.359Z","updatedAt":"2026-08-05T11:58:26.156Z","severity":{"score":8.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"a4348710a7267705b75692dc1a000920481d1d92","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"1067361a1cc6ad9cdf7acfc47f90012b72ad1502","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"8fb3b6c85b7e3127161623586b62abcc366caa20","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"6323fec65fe54b365961fed260dd579191e46121","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"a1f46c99d9ea411f9bf30025b912d881d36fc709","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.1.162","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.122","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.28","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.6","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h"]}],"references":["https://git.kernel.org/stable/c/a4348710a7267705b75692dc1a000920481d1d92","https://git.kernel.org/stable/c/1067361a1cc6ad9cdf7acfc47f90012b72ad1502","https://git.kernel.org/stable/c/8fb3b6c85b7e3127161623586b62abcc366caa20","https://git.kernel.org/stable/c/6323fec65fe54b365961fed260dd579191e46121","https://git.kernel.org/stable/c/a1f46c99d9ea411f9bf30025b912d881d36fc709"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:03.054Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/37xxx/CVE-2025-37926.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-37926","state":"PUBLISHED","datePublished":"2025-05-20T15:21:53.359Z","dateUpdated":"2026-08-05T11:58:26.156Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:23.969Z"},"containers":{"cna":{"title":"ksmbd: fix use-after-free in ksmbd_session_rpc_open","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in ksmbd_session_rpc_open\n\nA UAF issue can occur due to a race condition between\nksmbd_session_rpc_open() and __session_rpc_close().\nAdd rpc_lock to the session to protect it."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"a4348710a7267705b75692dc1a000920481d1d92","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"1067361a1cc6ad9cdf7acfc47f90012b72ad1502","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"8fb3b6c85b7e3127161623586b62abcc366caa20","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"6323fec65fe54b365961fed260dd579191e46121","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"a1f46c99d9ea411f9bf30025b912d881d36fc709","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.1.162","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.122","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.28","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.6","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/a4348710a7267705b75692dc1a000920481d1d92"},{"url":"https://git.kernel.org/stable/c/1067361a1cc6ad9cdf7acfc47f90012b72ad1502"},{"url":"https://git.kernel.org/stable/c/8fb3b6c85b7e3127161623586b62abcc366caa20"},{"url":"https://git.kernel.org/stable/c/6323fec65fe54b365961fed260dd579191e46121"},{"url":"https://git.kernel.org/stable/c/a1f46c99d9ea411f9bf30025b912d881d36fc709"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":8.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - ksmbd is the in-kernel SMB server listening on TCP/445; the entire attack consists of SMB2 CREATE and CLOSE PDUs sent over the network to the IPC$ share. No local access is needed at any point.\nAC:L - The attacker drives both sides of the race by pipelining concurrent SMB2 requests on one connection (ksmbd's workqueue has no per-connection serialization), and the race window spans a blocking userspace IPC round-trip of up to 2 seconds, while the target handle ID is a predictable small `ida_alloc()` value.\nPR:L - Reaching create_smb2_pipe() requires a completed SMB2 SESSION_SETUP and a TREE_CONNECT to IPC$, i.e. any valid low-privileged SMB account (or a guest account where mapping is enabled). This matches the scoring of the sibling ksmbd session UAFs CVE-2025-22040/CVE-2025-22041.\nUI:N - The attacker generates every request in the sequence; no action by a legitimate user or administrator is required to trigger the race.\nS:U - The corruption is confined to the kernel's own heap and the ksmbd server's data structures, all within the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The success path returns `entry->id` read from freed slab memory and sends it back to the attacker as the CREATE response VolatileFileId, directly leaking reclaimed kernel heap contents, and the UAF/double-free of a small generic-cache object gives a spray-controlled read primitive.\nI:H - The error path double-frees the entry and calls ksmbd_rpc_id_free() on a stale IDA id now owned by a different live RPC handle, yielding freelist corruption and cross-handle aliasing that are classic stepping stones to arbitrary write and control-flow hijack in kernel context.\nA:H - Use-after-free and double-free of a kmalloc object reliably produce slab corruption, oops, or panic, and the attacker can repeat the race indefinitely over new sessions to crash the server."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:58:26.156Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.1.162"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.6.122"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12.28"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.14.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.15"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}