CVE-2026-31705
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedIn 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceIn the Linux kernel's ksmbd (SMB daemon), the smb2_get_ea() function writes Extended Attribute (EA) entries to an SMB response buffer. After writing each EA entry, it applies 4-byte alignment padding via memset(). The bug is that a bounds check on buf_free_len happens before the memcpy of the EA value, but the alignment memset fires unconditionally afterward with no bounds check. When the EA value exactly fills the remaining buffer (buf_free_len becomes 0 after the value subtraction), the alignment memset writes 1-3 NUL bytes past the buffer boundary. In compound SMB requests where the response buffer is shared across commands, this causes an out-of-bounds write into adjacent kernel heap memory.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data>= 5.15.145, < 5.16>= 6.1.71, < 6.2>= 6.6, < 6.6.136>= 6.7, < 6.12.84>= 6.13, < 6.18.25>= 6.19, < 7.0.2CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Confirm ksmbd is runningCheck if the ksmbd kernel module is loaded using 'lsmod | grep ksmbd' or if the ksmbd service is active via 'systemctl status ksmbd' (or equivalent service manager).Affected if ksmbd module is loaded or ksmbd service is running and the kernel version falls within the affected ranges.
-
Check kernel versionRun 'uname -r' to obtain the running kernel version, then compare it against the affected ranges: >= 5.15.145 and < 5.16; >= 6.1.71 and < 6.2; >= 6.6 and < 6.6.136; >= 6.7 and < 6.12.84; >= 6.13 and < 6.18.25; >= 6.19 and < 7.0.2.Affected if The kernel version matches any of the listed affected ranges.
-
Verify SMB share configurationExamine SMB share definitions in /etc/ksmbd/ or /etc/samba/ (depending on configuration) to confirm the system is configured to serve SMB shares that utilize Extended Attributes.Affected if The system is configured to serve SMB shares and ksmbd is actively handling SMB requests.
If ksmbd is actively running (module loaded or service active), the kernel version is within any of the affected ranges, and SMB shares are being served, the environment is potentially affected by the out-of-bounds write in smb2_get_ea().
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped5.166.26.6.136
Apply the kernel patch that adds a bounds check before the alignment memset in smb2_get_ea() to ensure sufficient buffer space remains. This requires updating the ksmbd kernel module to a version containing the fix.
Linux kernel 5.16 or later; or 6.2 or later; or 6.6.136 or later; or 6.12.84 or later (depending on your stable branch)
- Identify the currently running Linux kernel version using `uname -r`
- Check if the running kernel version is one of the affected versions: 5.15.145+, 6.1.71+, 6.6+, or 6.7+
- If running an affected version, schedule a maintenance window for kernel upgrade
- Upgrade the Linux kernel to a fixed release: version 5.16 or higher, 6.2 or higher, 6.6.136 or higher, or 6.12.84 or higher
- Reboot the system to load the new kernel
- Verify the fix is applied by checking the kernel version and confirming ksmbd functionality works correctly
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation3.0 h
- Testing4.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,328.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-31705 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-31705 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data