Description
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.
Published: 2026-05-01
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The kernel contains a bug in the ksmbd Samba server component, where the smb2_get_ea() function applies 4‑byte alignment padding with memset() after writing each EA entry without checking if sufficient space remains. When an EA value exactly fills the remaining buffer, the subsequent padding writes 1–3 NUL bytes past the allocated boundary, overwriting adjacent kernel heap memory. The flaw can be triggered by a SMB client that issues a compound request which depletes the response buffer, allowing the OOB write to occur. This overflow can corrupt kernel memory, potentially enabling an attacker to gain higher privileges or crash the system. Based on the description, it is inferred that a specially crafted SMB request can exercise the bug.

Affected Systems

Linux kernel builds that include the ksmbd component are affected. No specific kernel version list is provided, so all kernels before the commit that introduced the bounds check may be vulnerable.

Risk and Exploitability

The CVSS score is not reported, and the EPSS score is unavailable, leaving the quantitative risk uncertain. The vulnerability represents a classic out‑of‑bounds write in kernel space, which is a high‑severity flaw. Since the flaw lies in low‑level kernel code and can corrupt privileged memory, it potentially allows an attacker to achieve privilege escalation or denial of service. The lack of a public exploit or KEV listing suggests limited but plausible attack exposure. The likely attack vector is a remote SMB client sending a compound request that forces the alignment write to overflow.

Generated by OpenCVE AI on May 1, 2026 at 23:44 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that contains the ksmbd OOB write fix (the commit that adds the bounds check for the alignment memset).
  • Reboot the system after the kernel upgrade to ensure the patched kernel is active.
  • Monitor system logs and kernel crash dumps for signs of memory corruption or unusual SMB activity, and apply stricter access controls to the SMB server as an additional safeguard.

Generated by OpenCVE AI on May 1, 2026 at 23:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 02 May 2026 00:15:00 +0000


Sat, 02 May 2026 00:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-122
CWE-787

Fri, 01 May 2026 14:15:00 +0000

Type Values Removed Values Added
Description 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.
Title ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-01T13:56:03.896Z

Reserved: 2026-03-09T15:48:24.132Z

Link: CVE-2026-31705

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-01T14:16:20.473

Modified: 2026-05-01T15:24:14.893

Link: CVE-2026-31705

cve-icon Redhat

Severity :

Publid Date: 2026-05-01T00:00:00Z

Links: CVE-2026-31705 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-05-01T23:45:09Z

Weaknesses