CVE-2026-31478
ksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()
Reported by linux · Published April 22, 2026
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.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | f2283680a80571ca82d710bc6ecd8f8beac67d63, 9f297df20d93411c0b4ddad7f88ba04a7cd36e77, e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d |
| Linux | Linux | 6.6, 0, 5.15.203 |
| Linux | Linux | 6.1.71, 6.6.131, 6.12.80 |
| linux | linux_kernel | 6.6, 6.6, 6.6 |
Timeline
- Apr 22, 2026 CVE Published
- Apr 22, 2026 PoC Published
- Apr 23, 2026 Security Advisory (97 in total, the first dated here)
- May 18, 2026 EPSS Score (30 in total, the first dated here)
- Jul 16, 2026 Coalition ESS Score
- Aug 6, 2026 CVE Updated
- Aug 11, 2026 Distribution Patch (92 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-31478
vulnetix vdb fixes CVE-2026-31478
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-31478/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart