CVE-2026-31705·Kernel vulnerability
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.
- Severity
- critical
- Software
- Kernel
- Fixed in
- 7.0.2
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.40% — higher than 33% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2026-31705 scores 9.8 on CVSS, so a successful attack would be serious — but at 0.40%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 6.19
Until: 7.0.2
Fixed in: 7.0.2
How to fix this CVE
Update your Linux kernel to version 7.0.2 or later to patch an out-of-bounds memory write in the ksmbd SMB server component. This vulnerability affects kernel versions 6.19 through 7.0.1 and can be exploited by attackers to corrupt kernel heap memory through specially crafted EA (Extended Attribute) QUERY_INFO requests in compound SMB operations. Immediate patching is recommended for systems running vulnerable kernel versions, particularly those exposing SMB services.
sudo dnf update kernel kernel-headers kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed kernel version with `uname -r` and compare against the affected range 6.19-7.0.1
- Step 2: Verify ksmbd is enabled in kernel config by running `grep CONFIG_SMB_SERVER /boot/config-$(uname -r)` — if it returns 'y' or 'm', the vulnerable code is present
- Step 3: Search kernel logs for memory corruption signs related to SMB operations using `sudo dmesg | grep -i 'smb\|ksmbd\|memory\|corruption'`
- Step 4: After patching, reboot and confirm new kernel version with `uname -r` to ensure version 7.0.2 or later is running
FAQ
What is CVE-2026-31705?
This vulnerability is an out-of-bounds write flaw in the Linux kernel's ksmbd SMB server where alignment padding operations bypass bounds checking, allowing heap memory corruption when processing EA (Extended Attribute) queries in compound SMB requests.
Is CVE-2026-31705 being actively exploited?
No, CVE-2026-31705 is not currently listed on the CISA Known Exploited Vulnerabilities catalog, and no public exploits have been disclosed, though the vulnerability is critical and should still be patched promptly.
What versions of Kernel are affected by CVE-2026-31705?
Linux kernel versions 6.19.0 through 7.0.1 are vulnerable; version 7.0.2 and later contain the fix.
How do I check if my server is vulnerable to CVE-2026-31705?
Run `uname -r` to display your kernel version and compare it to the affected range (6.19-7.0.1), then verify ksmbd is compiled in with `grep CONFIG_SMB_SERVER /boot/config-$(uname -r)` — if both conditions are true, your system is vulnerable.
Does Defensia detect CVE-2026-31705?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2026-31705 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/30010c952077a1c89ecdd71fc4d574c75a8f5617
- https://git.kernel.org/stable/c/790304c02bf9bd7b8171feda4294d6e62d32ae8f
- https://git.kernel.org/stable/c/922d48fe8c19f388ffa2f709f33acaae4e408de2
- https://git.kernel.org/stable/c/98f3de6ef4efbd899348d333f0902dc4ff14380c
- https://git.kernel.org/stable/c/ddbbc8b2a09dd2cfed90871313e3691ae1db08a2
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-31705. Free for 1 server.
Get started free