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

- Priority: **Prioritise**
- Reason: Severe, CVSS 9.8 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2026-04-22 · Modified: 2026-10-19
- Aliases: UBUNTU-CVE-2026-31478, DEBIAN-CVE-2026-31478
- Record: https://cvemate.com/vulnerability/CVE-2026-31478 · JSON: https://cvemate.com/vulnerability/CVE-2026-31478/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.522%, percentile 45.823%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 149)

- debian linux (Debian): \< 6.1.170-1 \| \< 6.12.85-1 \| \< 6.19.11-1
- ubuntu linux (Ubuntu): \< 5.15.0-185.195 \| \< 6.8.0-134.134 \| \< 6.17.0-40.40
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 5.15.0-1111.118 \| \< 6.8.0-1060.63 \| \< 6.17.0-1019.19
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1111.118~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.17 (Ubuntu): \< 6.17.0-1019.19~24.04.1
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1060.63~22.04.1
- ubuntu linux-aws-fips (Ubuntu): \< 5.15.0-1111.118+fips1 \| \< 6.8.0-1060.63+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1116.125 \| \< 6.8.0-1063.71
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 37)

- <https://git.kernel.org/stable/c/70b4c414889492c522b6e4331562360f49be2361>
- <https://git.kernel.org/stable/c/9a7166f0ef8cbb7bb48dd05e2471d995566003f5>
- <https://git.kernel.org/stable/c/c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683>
- <https://git.kernel.org/stable/c/6aef1765d6807e0f027cd87f6ac973eb0879a46d>
- <https://git.kernel.org/stable/c/80824c7e527b70cf9039534e60aff592e8f209d1>
- <https://git.kernel.org/stable/c/4cb537ae4f37d7d0f617815ed4bed7173fb50861>
- <https://git.kernel.org/stable/c/0e55f63dd08f09651d39e1b709a91705a8a0ddcb>
- <https://ubuntu.com/security/CVE-2026-31478>
- <https://www.cve.org/CVERecord?id=CVE-2026-31478>
- <https://git.kernel.org/linus/0e55f63dd08f09651d39e1b709a91705a8a0ddcb>
- <https://ubuntu.com/security/notices/USN-8490-1>
- <https://ubuntu.com/security/notices/USN-8491-1>
- <https://ubuntu.com/security/notices/USN-8492-1>
- <https://ubuntu.com/security/notices/USN-8493-1>
- <https://ubuntu.com/security/notices/USN-8492-2>
- <https://ubuntu.com/security/notices/USN-8497-1>
- <https://ubuntu.com/security/notices/USN-8498-1>
- <https://ubuntu.com/security/notices/USN-8499-1>
- <https://ubuntu.com/security/notices/USN-8493-2>
- <https://ubuntu.com/security/notices/USN-8508-1>

---

Data as of 2026-12-05T03:09:29.399Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
