CVE-2026-31478: ksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()

Published Apr 22, 2026
·
Updated

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

ksmbd: replace hardcoded hdr2len with offsetof() in smb2calcmaxoutbuflen()

After this commit (e2b76ab8b5c9 "ksmbd: add support for read compound"), response buffer management was changed to use dynamic iov array. In the new design, smb2calcmaxoutbuflen() expects the second argument (hdr2len) 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 Software

15 affected components
Linux Linux kernel
Linux Linux kernel>=5.15.145<5.15.203
Linux Linux kernel>=6.1.71<6.1.168
Linux Linux kernel>=6.6.1<6.6.131
Linux Linux kernel>=6.7<6.12.80
Linux Linux kernel>=6.13<6.18.21
Linux Linux kernel>=6.19<6.19.11
Linux Linux kernel=6.6
Linux Linux kernel=7.0-rc1
Linux Linux kernel=7.0-rc2
Linux Linux kernel=7.0-rc3
Linux Linux kernel=7.0-rc4
Linux Linux kernel=7.0-rc5
Linux Linux kernel=7.0-rc6
Linux Linux kernel=7.0-rc7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch e2b76ab8b5c9

Event History

Apr 22, 2026
CVE Published
via MITRE·01:54 PM
Data Sourced
via MITRE·01:54 PM
DescriptionSeverity
Data Sourced
via NVD·02:16 PM
RemedyDescriptionSeverityAffected Software
Apr 23, 2026
Data Sourced
via Microsoft·08:08 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which systems are implicated?

The issue is in the Linux kernel's ksmbd SMB server component, specifically in response-buffer length calculation after the dynamic iOV-array design introduced by commit e2b76ab8b5c9. Systems not using ksmbd are not identified by the provided information as exposed.

2

How can I determine whether the fix is present?

Review the ksmbd source or applied kernel fixes for calls to smb2_calc_max_out_buf_len(). Affected call sites pass a hardcoded hdr2_len value where the function requires the offset of the response structure's Buffer field; the correction uses offsetof().

3

What is the remediation?

Apply a kernel update containing the correction. The provided stable-tree references identify commits carrying the fix, but the affected and fixed kernel version numbers are not provided.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203