CVE-2026-31705: ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment
smb2_get_ea() applies 4-byte alignment padding via memset() after
writing each EA entry. The bounds check on buf_free_len is performed
before the value memcpy, but the alignment memset fires unconditionally
afterward with no check on remaining space.
When the EA value exactly fills the remaining buffer (buf_free_len == 0
after value subtraction), the alignment memset writes 1-3 NUL bytes
past the buf_free_len boundary. In compound requests where the response
buffer is shared across commands, the first command (e.g., READ) can
consume most of the buffer, leaving a tight remainder for the QUERY_INFO
EA response. The alignment memset then overwrites past the physical
kvmalloc allocation into adjacent kernel heap memory.
Add a bounds check before the alignment memset to ensure buf_free_len
can accommodate the padding bytes.
This is the same bug pattern fixed by commit beef2634f81f ("ksmbd: fix
potencial OOB in get_file_all_info() for compound requests") and
commit fda9522ed6af ("ksmbd: fix OOB write in QUERY_INFO for compound
requests"), both of which added bounds checks before unconditional
writes in QUERY_INFO response handlers.
Security readout for executives and security teams
Plain-English summary
A flaw in Linux’s ksmbd SMB server can let an unauthenticated network client overwrite adjacent kernel memory. Successful triggering could crash the system or threaten data confidentiality and integrity. The issue is rated critical at CVSS 9.8, although the supplied sources do not establish active exploitation.
Executive priority
Treat network-reachable ksmbd systems as an urgent patching priority, especially where SMB is exposed beyond trusted administrative networks. First establish whether ksmbd is actually in use, then deploy vendor-supported fixed kernels through an accelerated change process.
Technical view
In smb2_get_ea(), value bounds are checked before copying, but 4-byte alignment padding is written without verifying remaining space. A compound SMB response can leave an exact-sized remainder, causing a 1–3-byte NUL overwrite beyond the kvmalloc buffer into adjacent kernel heap memory.
Likely exposure
Potential exposure is limited to systems running an affected Linux kernel with ksmbd enabled and reachable by untrusted clients. The supplied version data contains ambiguous entries and commit identifiers, so organizations should confirm exposure using distribution-specific kernel advisories and build information.
Exploitation context
The bundle marks KEV false and provides no evidence of active exploitation or a public exploit. CVSS describes network access, low complexity, no privileges, and no user interaction; these are severity characteristics, not proof of reliable exploitation.
Researcher notes
The overwrite is only 1–3 NUL bytes but reaches adjacent kernel heap memory when compound replies leave a tight buffer. The bundle identifies related prior bug patterns, but supplies no CWE, proof of concept, exploitation analysis, or clear branch-by-branch fixed-version mapping.
Mitigation direction
Prioritize a vendor-supported kernel update containing the referenced ksmbd bounds-check fix.
Check Linux distribution advisories for exact fixed package versions before deployment.
Disable ksmbd where SMB service is unnecessary, following approved operational procedures.
Restrict SMB access to trusted networks until affected systems are patched.
Validation and detection
Inventory kernel versions and builds on systems providing SMB through ksmbd.
Confirm whether ksmbd is enabled, loaded, and reachable over the network.
Verify installed kernels include a referenced fix or vendor-confirmed backport.
Review kernel logs for ksmbd crashes or memory-corruption symptoms; no specific indicators are supplied.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2026-31705 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
7Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.