CVE-2026-31705
ksmbd Out-of-Bounds Write in EA Alignment
Publication date: 2026-05-01
Last updated on: 2026-05-06
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | From 5.15.145 (inc) to 5.16 (exc) |
| linux | linux_kernel | From 6.1.71 (inc) to 6.2 (exc) |
| linux | linux_kernel | From 6.7 (inc) to 6.12.84 (exc) |
| linux | linux_kernel | From 6.13 (inc) to 6.18.25 (exc) |
| linux | linux_kernel | From 6.19 (inc) to 7.0.2 (exc) |
| linux | linux_kernel | From 6.6 (inc) to 6.6.136 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-787 | The product writes data past the end, or before the beginning, of the intended buffer. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Linux kernel's ksmbd component, specifically in the smb2_get_ea() function. The function applies 4-byte alignment padding using memset() after writing each Extended Attribute (EA) entry. However, while there is a bounds check before copying the EA value, there is no check before the alignment memset is called. This can cause the memset to write 1-3 null bytes beyond the allocated buffer boundary if the EA value exactly fills the remaining buffer.
In compound requests where multiple commands share the response buffer, the first command may consume most of the buffer, leaving very little space for the EA response. The unconditional memset then overwrites adjacent kernel heap memory, leading to an out-of-bounds write.
The fix involves adding a bounds check before the alignment memset to ensure there is enough space for the padding bytes, preventing the out-of-bounds write.
How can this vulnerability impact me? :
This vulnerability can lead to an out-of-bounds write in kernel memory, which may corrupt adjacent kernel heap memory. Such memory corruption can cause system instability, crashes, or potentially allow an attacker to execute arbitrary code with kernel privileges.
Because the vulnerability occurs in the kernel's SMB server component (ksmbd), it could be exploited remotely via crafted SMB requests, increasing the risk of unauthorized access or denial of service.
What immediate steps should I take to mitigate this vulnerability?
The vulnerability has been resolved by adding a bounds check before the alignment memset in the ksmbd smb2_get_ea() function. To mitigate this vulnerability, you should update your Linux kernel to a version that includes this fix.
- Apply the latest Linux kernel patches that address the ksmbd out-of-bounds write issue.
- Avoid using vulnerable kernel versions with the affected ksmbd smb2_get_ea() implementation.