CVE-2026-31704
Description
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: use check_add_overflow() to prevent u16 DACL size overflow
set_posix_acl_entries_dacl() and set_ntacl_dacl() accumulate ACE sizes in u16 variables. When a file has many POSIX ACL entries, the accumulated size can wrap past 65535, causing the pointer arithmetic (char *)pndace + *size to land within already-written ACEs. Subsequent writes then overwrite earlier entries, and pndacl->size gets a truncated value.
Use check_add_overflow() at each accumulation point to detect the wrap before it corrupts the buffer, consistent with existing check_mul_overflow() usage elsewhere in smbacl.c.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A u16 integer overflow in ksmbd's ACL size accumulation can corrupt DACL entries; patched by adding check_add_overflow().
KSMBD, the kernel-mode SMB server in Linux, contained a vulnerability in its ACL handling logic. The functions set_posix_acl_entries_dacl() and set_ntacl_dacl() accumulated the size of DACL entries into a u16 variable. When a file has many POSIX ACL entries, the total size could exceed 65535 bytes, causing an integer overflow that wraps the accumulated size to a small value. This overflow leads to incorrect pointer arithmetic and memory corruption during ACL construction [1].
The bug can be triggered by a remote SMB client that creates a file with an excessive number of POSIX ACL entries. No special privileges aside from SMB file-write access are required to reach the vulnerable code path. The attacker must craft a file whose ACL entry count causes the sum of ACE sizes to overflow a u16 [1].
Upon exploitation, the corrupted DACL causes the pndacl->size field to contain a truncated value, and subsequent writes within the ACL buffer can overwrite earlier ACE entries. This could lead to memory corruption, potentially enabling denial of service or other undefined behavior. The CVSS v3 base score is 5. 5.5 (Medium) reflects the local/authenticated attack surface and impact [1].
The fix introduces calls to check_add_overflow() at each accumulation point to detect the overflow before it corrupts the buffer, consistent with existing check_mul_overflow() usage elsewhere in smbacl.c. The advisory does not mention that the patch has been applied to the stable kernel tree; users are advised to update their kernels to incorporate the commit [1][2][3][4].
AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- git.kernel.org/stable/c/299f962c0b02d048fb45d248b4da493d03f3175dnvdPatch
- git.kernel.org/stable/c/5e7b8f3c539d69b2ed5f2408e2f75e68ce7eef43nvdPatch
- git.kernel.org/stable/c/8d5729350b236896f51379588d9a690b7fafb8dbnvdPatch
- git.kernel.org/stable/c/e1955a94b6f17f4b058afa955a6f187eb3ed7615nvdPatch
- git.kernel.org/stable/c/ef7902be3f215b6bf7babe4dc9dd9a7d57dad7a7nvdPatch
News mentions
1- Patch Tuesday - May 2026Rapid7 Blog · May 13, 2026