{"id":"CVE-2025-22039","state":"PUBLISHED","title":"ksmbd: fix overflow in dacloffset bounds check","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix overflow in dacloffset bounds check\n\nThe dacloffset field was originally typed as int and used in an\nunchecked addition, which could overflow and bypass the existing\nbounds check in both smb_check_perm_dacl() and smb_inherit_dacl().\n\nThis could result in out-of-bounds memory access and a kernel crash\nwhen dereferencing the DACL pointer.\n\nThis patch converts dacloffset to unsigned int and uses\ncheck_add_overflow() to validate access to the DACL.","publishedAt":"2025-04-16T14:11:56.975Z","updatedAt":"2026-09-14T11:57:53.618Z","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":"abbb4ec41867f2cd1c971258e493893bf43bcbd3","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"8483d7b532be1d1bc149556a2fedf903868c6303","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"73f074fb5e139cd42ad75089abe4e28a49a30003","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"6a9cd9ff0fa2bcc30b2bfb8bdb161eb20e44b9dc","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"6b8d379048b168a0dff5ab1acb975b933f368514","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"443b373a4df5a2cb9f7b8c4658b2afedeb16397f","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/smbacl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"5.15.221","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.188","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.157","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.23","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.11","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14.2","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/smbacl.c"]}],"references":["https://git.kernel.org/stable/c/abbb4ec41867f2cd1c971258e493893bf43bcbd3","https://git.kernel.org/stable/c/8483d7b532be1d1bc149556a2fedf903868c6303","https://git.kernel.org/stable/c/73f074fb5e139cd42ad75089abe4e28a49a30003","https://git.kernel.org/stable/c/6a9cd9ff0fa2bcc30b2bfb8bdb161eb20e44b9dc","https://git.kernel.org/stable/c/6b8d379048b168a0dff5ab1acb975b933f368514","https://git.kernel.org/stable/c/443b373a4df5a2cb9f7b8c4658b2afedeb16397f","https://git.kernel.org/stable/c/beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42"],"weaknesses":[],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/22xxx/CVE-2025-22039.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-22039","state":"PUBLISHED","datePublished":"2025-04-16T14:11:56.975Z","dateUpdated":"2026-09-14T11:57:53.618Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.809Z"},"containers":{"cna":{"title":"ksmbd: fix overflow in dacloffset bounds check","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix overflow in dacloffset bounds check\n\nThe dacloffset field was originally typed as int and used in an\nunchecked addition, which could overflow and bypass the existing\nbounds check in both smb_check_perm_dacl() and smb_inherit_dacl().\n\nThis could result in out-of-bounds memory access and a kernel crash\nwhen dereferencing the DACL pointer.\n\nThis patch converts dacloffset to unsigned int and uses\ncheck_add_overflow() to validate access to the DACL."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"abbb4ec41867f2cd1c971258e493893bf43bcbd3","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"8483d7b532be1d1bc149556a2fedf903868c6303","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"73f074fb5e139cd42ad75089abe4e28a49a30003","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"6a9cd9ff0fa2bcc30b2bfb8bdb161eb20e44b9dc","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"6b8d379048b168a0dff5ab1acb975b933f368514","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"443b373a4df5a2cb9f7b8c4658b2afedeb16397f","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/smbacl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"5.15.221","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.188","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.157","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.23","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.11","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14.2","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/smbacl.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/abbb4ec41867f2cd1c971258e493893bf43bcbd3"},{"url":"https://git.kernel.org/stable/c/8483d7b532be1d1bc149556a2fedf903868c6303"},{"url":"https://git.kernel.org/stable/c/73f074fb5e139cd42ad75089abe4e28a49a30003"},{"url":"https://git.kernel.org/stable/c/6a9cd9ff0fa2bcc30b2bfb8bdb161eb20e44b9dc"},{"url":"https://git.kernel.org/stable/c/6b8d379048b168a0dff5ab1acb975b933f368514"},{"url":"https://git.kernel.org/stable/c/443b373a4df5a2cb9f7b8c4658b2afedeb16397f"},{"url":"https://git.kernel.org/stable/c/beff0bc9d69bc8e733f9bca28e2d3df5b3e10e42"}],"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; the malicious `dacloffset` arrives in an SMB2 SET_INFO security-descriptor payload over TCP/445 and is triggered by a subsequent SMB2 CREATE. No local access is needed.\nAC:L - The attacker fully controls the 32-bit `dacloffset` field and simply picks a value in 0xFFFFFFF8–0xFFFFFFFF to bypass the check; there is no race, no memory-layout guessing, and the trigger is two ordinary SMB2 requests that can be repeated at will.\nPR:L - The path requires an established SMB2 session and tree connect plus an open handle with write access, so valid (even minimal, non-admin) share credentials are needed — this is squarely post-authentication, not a handshake path.\nUI:N - The attacker plants the crafted security descriptor and re-opens the file entirely on their own; no action by an administrator or any other client is involved.\nS:U - The out-of-bounds access and resulting crash are confined to the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - `pdacl` is dereferenced roughly 4 GiB beyond a small kmalloc'd buffer and the ACE walk then reads further from there — an unbounded kernel-memory read, whose bytes are OR'd into `granted` and returned to the client in the maximal-access create context, and are persisted into on-disk ACLs by smb_inherit_dacl.\nI:H - The out-of-bounds bytes directly determine the DACL verdict and the granted access mask stored in `fp->daccess` (including WRITE_DAC/DELETE/GENERIC_ALL), so the Windows ACL enforcement layer can be defeated, and smb_inherit_dacl writes out-of-bounds heap contents into the security.NTACL xattr of newly created files.\nA:H - Dereferencing a pointer ~4 GiB past the allocation faults on any system where that address is not backed by the direct map, producing a kernel oops in the ksmbd worker (a panic with panic_on_oops); the attacker can repeat it at will."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-09-14T11:57:53.618Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"5.15.221"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.1.188"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.6.157"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12.23"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.13.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.14.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.15"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}