{"id":"CVE-2026-97559","state":"PUBLISHED","title":"smb: client: fail DACL rewrite when the new DACL exceeds 64K","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fail DACL rewrite when the new DACL exceeds 64K\n\nreplace_sids_and_copy_aces() and set_chmod_dacl() accumulate the size of\nthe DACL they build in a u16. That accumulator can wrap.\n\nvalidate_dacl() caps num_aces at (dacl_size - sizeof(struct smb_acl)) /\n20, i.e. 3276 for a maximally sized DACL, while each rewritten ACE can\ngrow to sizeof(struct smb_ace) (76 bytes) once its SID is replaced with\none carrying SID_MAX_SUB_AUTHORITIES sub-authorities. The worst case is\ntherefore sizeof(struct smb_acl) + 3276 * 76 = 248984 bytes, far beyond\nwhat a u16 can hold. A wraparound is reached with 863 ACEs.\n\nAfter the wraparound, ndacl_ptr->size becomes meaningless and the offset\nwill point anywhere in the ACE array. As a result, we will see\ncorruption of the DACL, which then gets sent to the server. This is not\nan out-of-bounds write as the allocation now covers the worst-case\nexpansion, so writes will always go into the buffer.\n\nAdjust the code to use a u32 internally and return -EOVERFLOW in the\noverflow case. The operation must be refused, because a DACL can only\nhold 2^16-1 bytes on the wire and larger DACLs cannot be represented.\n\nset_chmod_dacl() carries the same pattern and is fixed the same way. It\nonly wraps once the source DACL comes within roughly 380 bytes of the\n64K ceiling, but the failure mode is identical.","publishedAt":"2026-09-25T10:21:48.866Z","updatedAt":"2026-10-30T12:37:24.247Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"f033d6e5aadf3e8c6a12873110557ed40cd71388","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"284877c6189fda1ac3d81771dd8482660a0c7dc1","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"d433376abc47e10870ae732f89c7c1a60b199a0c","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"2ef532a01f44687f5b95001e88247cf05bff9892","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"ee13d687d06a6fbb2008625dd560c654231b28e0","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"d05045177a855386bca5e1909e08d06290e6e3b3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/cifsacl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.12","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.112","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.53","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.7","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/cifsacl.c"]}],"references":["https://git.kernel.org/stable/c/f033d6e5aadf3e8c6a12873110557ed40cd71388","https://git.kernel.org/stable/c/284877c6189fda1ac3d81771dd8482660a0c7dc1","https://git.kernel.org/stable/c/d433376abc47e10870ae732f89c7c1a60b199a0c","https://git.kernel.org/stable/c/2ef532a01f44687f5b95001e88247cf05bff9892","https://git.kernel.org/stable/c/ee13d687d06a6fbb2008625dd560c654231b28e0","https://git.kernel.org/stable/c/d05045177a855386bca5e1909e08d06290e6e3b3"],"weaknesses":[],"ingestedAt":"2026-10-30T12:56:04.490Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/97xxx/CVE-2026-97559.json","commit":"1f312381e38164a43607eebab851b151dd16861e","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-97559","state":"PUBLISHED","datePublished":"2026-09-25T10:21:48.866Z","dateUpdated":"2026-10-30T12:37:24.247Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-24T16:01:01.155Z"},"containers":{"cna":{"title":"smb: client: fail DACL rewrite when the new DACL exceeds 64K","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fail DACL rewrite when the new DACL exceeds 64K\n\nreplace_sids_and_copy_aces() and set_chmod_dacl() accumulate the size of\nthe DACL they build in a u16. That accumulator can wrap.\n\nvalidate_dacl() caps num_aces at (dacl_size - sizeof(struct smb_acl)) /\n20, i.e. 3276 for a maximally sized DACL, while each rewritten ACE can\ngrow to sizeof(struct smb_ace) (76 bytes) once its SID is replaced with\none carrying SID_MAX_SUB_AUTHORITIES sub-authorities. The worst case is\ntherefore sizeof(struct smb_acl) + 3276 * 76 = 248984 bytes, far beyond\nwhat a u16 can hold. A wraparound is reached with 863 ACEs.\n\nAfter the wraparound, ndacl_ptr->size becomes meaningless and the offset\nwill point anywhere in the ACE array. As a result, we will see\ncorruption of the DACL, which then gets sent to the server. This is not\nan out-of-bounds write as the allocation now covers the worst-case\nexpansion, so writes will always go into the buffer.\n\nAdjust the code to use a u32 internally and return -EOVERFLOW in the\noverflow case. The operation must be refused, because a DACL can only\nhold 2^16-1 bytes on the wire and larger DACLs cannot be represented.\n\nset_chmod_dacl() carries the same pattern and is fixed the same way. It\nonly wraps once the source DACL comes within roughly 380 bytes of the\n64K ceiling, but the failure mode is identical."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"f033d6e5aadf3e8c6a12873110557ed40cd71388","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"284877c6189fda1ac3d81771dd8482660a0c7dc1","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"d433376abc47e10870ae732f89c7c1a60b199a0c","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"2ef532a01f44687f5b95001e88247cf05bff9892","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"ee13d687d06a6fbb2008625dd560c654231b28e0","versionType":"git"},{"version":"f5065508897a922327f32223082325d10b069ebc","status":"affected","lessThan":"d05045177a855386bca5e1909e08d06290e6e3b3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/cifsacl.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.12","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.112","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.53","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.7","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/cifsacl.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/f033d6e5aadf3e8c6a12873110557ed40cd71388"},{"url":"https://git.kernel.org/stable/c/284877c6189fda1ac3d81771dd8482660a0c7dc1"},{"url":"https://git.kernel.org/stable/c/d433376abc47e10870ae732f89c7c1a60b199a0c"},{"url":"https://git.kernel.org/stable/c/2ef532a01f44687f5b95001e88247cf05bff9892"},{"url":"https://git.kernel.org/stable/c/ee13d687d06a6fbb2008625dd560c654231b28e0"},{"url":"https://git.kernel.org/stable/c/d05045177a855386bca5e1909e08d06290e6e3b3"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:37:24.247Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"6.12.112"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"6.18.53"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"7.2.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}