HIGH
smb DACL OOB
CVE-2026-31709
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
KernelScan AI8.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: smb: client: validate the whole DACL before rewriting it in cifsacl build_sec_desc() and id_mode_to_cifs_acl() derive a DACL pointer from a server-supplied dacloffset and then use the incoming ACL to rebuild the chmod/chown security descriptor. The original fix only checked that the struct smb_acl header fits before reading dacl_ptr->size or dacl_ptr->num_aces. That avoids the immediate header-field OOB read, but the rewrite helpers still walk ACEs based on pdacl->num_aces with no structural validation of the incoming DACL body. A malicious server can return a truncated DACL that still contains a header, claims one or more ACEs, and then drive replace_sids_and_copy_aces() or set_chmod_dacl() past the validated extent while they compare or copy attacker-controlled ACEs. Factor the DACL structural checks into validate_dacl(), extend them to validate each ACE against the DACL bounds, and use the shared validator before the chmod/chown rebuild paths. parse_dacl() reuses the same validator so the read-side parser and write-side rewrite paths agree on what constitutes a well-formed incoming DACL.
02KernelScan AI Analysis
Risk summary
A malicious SMB server can send a truncated DACL (Discretionary Access Control List) that causes the Linux SMB client to read beyond allocated memory boundaries during chmod/chown operations. This can lead to information disclosure, memory corruption, or denial of service for systems mounting SMB shares from untrusted servers.
Vulnerability analysis
The vulnerability occurs in build_sec_desc() and id_mode_to_cifs_acl() functions which process server-supplied DACL structures during file permission changes. The original code only validated the DACL header but not the individual Access Control Entries (ACEs) within it. A malicious server can send a DACL with a valid header claiming multiple ACEs, but provide a truncated body. When replace_sids_and_copy_aces() or set_chmod_dacl() iterate through the claimed ACEs based on pdacl->num_aces, they read past the validated memory extent. The fix introduces validate_dacl() which performs comprehensive structural validation of both the DACL header and each ACE against the buffer bounds before any processing occurs. This is a network-reachable vulnerability requiring only authenticated SMB access.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.12 | 6.12.86 | d92f3f0b2241 |
| 6.18 | 6.18.35 | ff0ca46b13b9 |
| 6.6 | 6.6.140 | 8e47d297e7cf |
| 7.0 | 7.0.2 | b78db9bddc84 |
| mainline | 7.1-rc1 | 0a8cf165566b |