{"id":"CVE-2024-50286","state":"PUBLISHED","title":"ksmbd: fix slab-use-after-free in ksmbd_smb2_session_create","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix slab-use-after-free in ksmbd_smb2_session_create\n\nThere is a race condition between ksmbd_smb2_session_create and\nksmbd_expire_session. This patch add missing sessions_table_lock\nwhile adding/deleting session from global session table.","publishedAt":"2024-11-19T01:30:29.948Z","updatedAt":"2026-08-05T11:43:05.795Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/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":"f56446ba5378d19e31040b548a14ee9a8f1500ea","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"e923503a56b3385b64ae492e3225e4623f560c5b","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"e7a2ad2044377853cf8c59528dac808a08a99c72","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"0a77715db22611df50b178374c51e2ba0d58866e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.1.117","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.61","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.8","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12","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"]}],"references":["https://git.kernel.org/stable/c/f56446ba5378d19e31040b548a14ee9a8f1500ea","https://git.kernel.org/stable/c/e923503a56b3385b64ae492e3225e4623f560c5b","https://git.kernel.org/stable/c/e7a2ad2044377853cf8c59528dac808a08a99c72","https://git.kernel.org/stable/c/0a77715db22611df50b178374c51e2ba0d58866e","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:07:56.516Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/50xxx/CVE-2024-50286.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-50286","state":"PUBLISHED","datePublished":"2024-11-19T01:30:29.948Z","dateUpdated":"2026-08-05T11:43:05.795Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-10-21T19:36:19.984Z"},"containers":{"cna":{"title":"ksmbd: fix slab-use-after-free in ksmbd_smb2_session_create","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix slab-use-after-free in ksmbd_smb2_session_create\n\nThere is a race condition between ksmbd_smb2_session_create and\nksmbd_expire_session. This patch add missing sessions_table_lock\nwhile adding/deleting session from global session table."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"f56446ba5378d19e31040b548a14ee9a8f1500ea","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"e923503a56b3385b64ae492e3225e4623f560c5b","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"e7a2ad2044377853cf8c59528dac808a08a99c72","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"0a77715db22611df50b178374c51e2ba0d58866e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.1.117","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.61","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.8","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12","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"]}],"references":[{"url":"https://git.kernel.org/stable/c/f56446ba5378d19e31040b548a14ee9a8f1500ea"},{"url":"https://git.kernel.org/stable/c/e923503a56b3385b64ae492e3225e4623f560c5b"},{"url":"https://git.kernel.org/stable/c/e7a2ad2044377853cf8c59528dac808a08a99c72"},{"url":"https://git.kernel.org/stable/c/0a77715db22611df50b178374c51e2ba0d58866e"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - ksmbd is the in-kernel SMB server; the entire path is driven by SMB2 SESSION_SETUP packets arriving on TCP/445 from a remote peer. No local access is needed.\nAC:L - The attacker controls both sides of the race — one connection deterministically triggers ksmbd_expire_session()'s unlocked hash_del()+kfree() via a second SessionId=0 SESSION_SETUP, while parallel connections drive hash_add()/__session_lookup() on the same 8-bucket global table, making bucket collisions near-certain.\nPR:N - smb2_check_user_session() explicitly exempts SMB2_SESSION_SETUP_HE from the conn-good/session-validity check, and ksmbd_smb2_session_create() plus ksmbd_session_register() run before any NTLMSSP/Kerberos credential is processed. An unauthenticated remote attacker reaches the bug.\nUI:N - Exploitation requires only that the attacker open TCP connections to the listening ksmbd port and send SESSION_SETUP requests; no action by any local user or administrator is involved.\nS:U - The corruption is confined to kernel slab memory within the same security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The UAF lets __session_lookup()/ksmbd_session_lookup_slowpath() return a dangling struct ksmbd_session that is then used as work->sess, exposing sess->user credentials, sess_key, smb3signingkey and smb3encryptionkey/decryptionkey read out of attacker-groomable freed memory.\nI:H - hlist_add_head() writes a kernel pointer (first->pprev = &n->next) into the freed, sprayable slab object, and __session_lookup() writes sess->last_active into freed memory — a write primitive usable for heap grooming and control-flow hijack.\nA:H - Corrupting the global session hlist and using a freed session reliably produces a slab-use-after-free oops or panic, remotely and repeatably without authentication."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:43:05.795Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.1.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.6.61"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.11.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-50286","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-03-06T16:07:56.848996Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-03-06T16:14:33.108Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T22:28:07.988Z"}}]}}}