# CVE-2026-31478: ksmbd: replace hardcoded hdr2\_len with offsetof() in smb2\_calc\_max\_out\_buf\_len()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.77% (percentile 52, 2026-11-26)
- **CWE:** CWE-131
- **Published:** 2026-04-22T13:54:06.157Z
- **Modified:** 2026-11-11T23:10:00.263Z

## Who should check

- Anyone running Linux \>= f2283680a80571ca82d710bc6ecd8f8beac67d63, \< 70b4c414889492c522b6e4331562360f49be2361; \>= 9f297df20d93411c0b4ddad7f88ba04a7cd36e77, \< 9a7166f0ef8cbb7bb48dd05e2471d995566003f5; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 6aef1765d6807e0f027cd87f6ac973eb0879a46d; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 80824c7e527b70cf9039534e60aff592e8f209d1; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 4cb537ae4f37d7d0f617815ed4bed7173fb50861; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 0e55f63dd08f09651d39e1b709a91705a8a0ddcb; \>= 5.15.145, \< 5.15.203; \>= 6.1.71, \< 6.1.168
- Anyone running Linux 6.6

## Description

In the Linux kernel, the following vulnerability has been resolved:

ksmbd: replace hardcoded hdr2\_len with offsetof() in smb2\_calc\_max\_out\_buf\_len()

After this commit (e2b76ab8b5c9 "ksmbd: add support for read compound"),
response buffer management was changed to use dynamic iov array.
In the new design, smb2\_calc\_max\_out\_buf\_len() expects the second
argument (hdr2\_len) to be the offset of -\>Buffer field in the
response structure, not a hardcoded magic number.
Fix the remaining call sites to use the correct offsetof() value.

## Affected and fixed versions

- Linux: \>= f2283680a80571ca82d710bc6ecd8f8beac67d63, \< 70b4c414889492c522b6e4331562360f49be2361; \>= 9f297df20d93411c0b4ddad7f88ba04a7cd36e77, \< 9a7166f0ef8cbb7bb48dd05e2471d995566003f5; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 6aef1765d6807e0f027cd87f6ac973eb0879a46d; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 80824c7e527b70cf9039534e60aff592e8f209d1; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 4cb537ae4f37d7d0f617815ed4bed7173fb50861; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 0e55f63dd08f09651d39e1b709a91705a8a0ddcb; \>= 5.15.145, \< 5.15.203; \>= 6.1.71, \< 6.1.168 (cvelist)
- Linux: 6.6 (cvelist)

## Mitigation

- Upgrade Linux to 6.1.168 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-31478. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-31478.md
Affected: Linux >= f2283680a80571ca82d710bc6ecd8f8beac67d63, < 70b4c414889492c522b6e4331562360f49be2361; >= 9f297df20d93411c0b4ddad7f88ba04a7cd36e77, < 9a7166f0ef8cbb7bb48dd05e2471d995566003f5; >= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, < c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683; >= e2b76ab8b5c9327ab2dae6d…
Fixed in: Linux 70b4c414889492c522b6e4331562360f49be2361, Linux 9a7166f0ef8cbb7bb48dd05e2471d995566003f5, Linux 6aef1765d6807e0f027cd87f6ac973eb0879a46d, Linux 80824c7e527b70cf9039534e60aff592e8f209d1, Linux 4cb537ae4f37d7d0f617815ed4bed7173fb50861, Linux 0e55f63dd08f09651d39e1b709a91705a8a0ddcb, Linux 5.15.…

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-31478 being exploited?

There is no confirmed exploitation: CVE-2026-31478 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.77% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-31478?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-31478?

Linux \>= f2283680a80571ca82d710bc6ecd8f8beac67d63, \< 70b4c414889492c522b6e4331562360f49be2361; \>= 9f297df20d93411c0b4ddad7f88ba04a7cd36e77, \< 9a7166f0ef8cbb7bb48dd05e2471d995566003f5; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 6aef1765d6807e0f027cd87f6ac973eb0879a46d; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 80824c7e527b70cf9039534e60aff592e8f209d1; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 4cb537ae4f37d7d0f617815ed4bed7173fb50861; \>= e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d, \< 0e55f63dd08f09651d39e1b709a91705a8a0ddcb; \>= 5.15.145, \< 5.15.203; \>= 6.1.71, \< 6.1.168; Linux 6.6.

### Is there a fix for CVE-2026-31478?

Yes. Fixed in Linux 70b4c414889492c522b6e4331562360f49be2361, Linux 9a7166f0ef8cbb7bb48dd05e2471d995566003f5, Linux 6aef1765d6807e0f027cd87f6ac973eb0879a46d, Linux 80824c7e527b70cf9039534e60aff592e8f209d1, Linux 4cb537ae4f37d7d0f617815ed4bed7173fb50861, Linux 0e55f63dd08f09651d39e1b709a91705a8a0ddcb, Linux 5.15.203, Linux 6.1.168. Upgrade Linux to 6.1.168 or later.

### How do I check if I'm affected by CVE-2026-31478?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/70b4c414889492c522b6e4331562360f49be2361>
- patch: <https://git.kernel.org/stable/c/9a7166f0ef8cbb7bb48dd05e2471d995566003f5>
- patch: <https://git.kernel.org/stable/c/c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683>
- patch: <https://git.kernel.org/stable/c/6aef1765d6807e0f027cd87f6ac973eb0879a46d>
- patch: <https://git.kernel.org/stable/c/80824c7e527b70cf9039534e60aff592e8f209d1>
- patch: <https://git.kernel.org/stable/c/4cb537ae4f37d7d0f617815ed4bed7173fb50861>
- patch: <https://git.kernel.org/stable/c/0e55f63dd08f09651d39e1b709a91705a8a0ddcb>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-31478>

HTML: <https://flawdb.com/CVE-2026-31478> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-31478>
