{"id":"CVE-2025-21967","state":"PUBLISHED","title":"ksmbd: fix use-after-free in ksmbd_free_work_struct","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in ksmbd_free_work_struct\n\n->interim_entry of ksmbd_work could be deleted after oplock is freed.\nWe don't need to manage it with linked list. The interim request could be\nimmediately sent whenever a oplock break wait is needed.","publishedAt":"2025-04-01T15:47:02.364Z","updatedAt":"2026-10-30T12:21:05.006Z","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":"ffe0909010b21df8f948d624ad00cf14dd856721","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"fb776765bfc21d5e4ed03bb3d4406c2b86ff1ac3","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"62746ae3f5414244a96293e3b017be637b641280","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"eb51f6f59d19b92f6fe84d3873f958495ab32f0a","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"bb39ed47065455604729404729d9116868638d31","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/ksmbd_work.c","fs/smb/server/ksmbd_work.h","fs/smb/server/oplock.c","fs/smb/server/oplock.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.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.84","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.20","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.8","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","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/ksmbd_work.c","fs/smb/server/ksmbd_work.h","fs/smb/server/oplock.c","fs/smb/server/oplock.h"]}],"references":["https://git.kernel.org/stable/c/ffe0909010b21df8f948d624ad00cf14dd856721","https://git.kernel.org/stable/c/fb776765bfc21d5e4ed03bb3d4406c2b86ff1ac3","https://git.kernel.org/stable/c/62746ae3f5414244a96293e3b017be637b641280","https://git.kernel.org/stable/c/eb51f6f59d19b92f6fe84d3873f958495ab32f0a","https://git.kernel.org/stable/c/bb39ed47065455604729404729d9116868638d31"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-30T12:38:04.623Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21967.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21967","state":"PUBLISHED","datePublished":"2025-04-01T15:47:02.364Z","dateUpdated":"2026-10-30T12:21:05.006Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.796Z"},"containers":{"cna":{"title":"ksmbd: fix use-after-free in ksmbd_free_work_struct","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in ksmbd_free_work_struct\n\n->interim_entry of ksmbd_work could be deleted after oplock is freed.\nWe don't need to manage it with linked list. The interim request could be\nimmediately sent whenever a oplock break wait is needed."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"ffe0909010b21df8f948d624ad00cf14dd856721","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"fb776765bfc21d5e4ed03bb3d4406c2b86ff1ac3","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"62746ae3f5414244a96293e3b017be637b641280","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"eb51f6f59d19b92f6fe84d3873f958495ab32f0a","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"bb39ed47065455604729404729d9116868638d31","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/ksmbd_work.c","fs/smb/server/ksmbd_work.h","fs/smb/server/oplock.c","fs/smb/server/oplock.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.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.84","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.20","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.8","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","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/ksmbd_work.c","fs/smb/server/ksmbd_work.h","fs/smb/server/oplock.c","fs/smb/server/oplock.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/ffe0909010b21df8f948d624ad00cf14dd856721"},{"url":"https://git.kernel.org/stable/c/fb776765bfc21d5e4ed03bb3d4406c2b86ff1ac3"},{"url":"https://git.kernel.org/stable/c/62746ae3f5414244a96293e3b017be637b641280"},{"url":"https://git.kernel.org/stable/c/eb51f6f59d19b92f6fe84d3873f958495ab32f0a"},{"url":"https://git.kernel.org/stable/c/bb39ed47065455604729404729d9116868638d31"}],"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, and the entire trigger sequence (a CREATE requesting a batch oplock/write lease on one connection, a conflicting overwrite CREATE plus a close/disconnect on a second) is driven purely by remote SMB2 protocol traffic. No local access to the target is required.\nAC:L - The double `list_add` of the same `work->interim_entry` in `smb2_open()` is deterministic, not racy, and the attacker owns both connections so it chooses exactly when the peer's `oplock_info` is released relative to `ksmbd_free_work_struct()`, and can loop the sequence indefinitely. Per guidance, an attacker-created ordering and a use-after-free are Low.\nPR:L - Reaching `smb_grant_oplock()`/`smb_break_all_oplock()` requires a completed SESSION_SETUP, TREE_CONNECT and SMB2 CREATE, so an authenticated but otherwise unprivileged share account (including a mapped guest) is needed. This matches the scoring of the sibling post-authentication ksmbd oplock UAFs.\nUI:N - The attacker drives every step from its own two SMB sessions — take the oplock, issue the conflicting overwrite CREATE, then close or drop the first connection. No administrator or other client has to do anything.\nS:U - The list corruption and its consequences stay entirely within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The stale `interim_list` head lets `smb2_lease_break_noti()` treat reclaimed heap memory as a `struct ksmbd_work`, dereferencing its `conn`, `sess`, and `request_buf` fields, and `smb2_send_interim_resp()` then transmits data derived from that object back to the attacker — an arbitrary kernel memory disclosure primitive after a heap spray.\nI:H - `list_del()` in `ksmbd_free_work_struct()` writes two attacker-influenced kernel heap pointers at a fixed offset into a freed kmalloc-256 slot that the attacker can reclaim with a chosen object, and the fake-`ksmbd_work` path yields further controlled pointer writes and indirect calls, giving control-flow hijack.\nA:H - Even unweaponized, the `list_del` on freed memory trips `CONFIG_DEBUG_LIST`/`BUG()` or silently corrupts the slab, and walking the dangling `interim_list` oopses the ksmbd worker; the attacker can repeat it at will to keep the file server down."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:21:05.006Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.6.84"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12.20"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.13.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.14"}]}]}],"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-2025-21967","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-04-16T13:14:51.011092Z"}}}],"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-04-16T13:19:52.457Z"}}]}}}