CVE-2026-31478
Received Received - Intake

Incorrect Buffer Length Calculation in Linux Kernel ksmbd Component

Vulnerability report for CVE-2026-31478, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-04-22

Last updated on: 2026-04-27

Assigner: kernel.org

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-04-22
Last Modified
2026-04-27
Generated
2026-07-06
AI Q&A
2026-04-22
EPSS Evaluated
2026-07-05
NVD
EUVD

Affected Vendors & Products

Showing 14 associated CPEs
Vendor Product Version / Range
linux linux_kernel 6.6
linux linux_kernel 7.0
linux linux_kernel 7.0
linux linux_kernel 7.0
linux linux_kernel 7.0
linux linux_kernel 7.0
linux linux_kernel 7.0
linux linux_kernel 7.0
linux linux_kernel From 6.13 (inc) to 6.18.21 (exc)
linux linux_kernel From 6.19 (inc) to 6.19.11 (exc)
linux linux_kernel From 6.7 (inc) to 6.12.80 (exc)
linux linux_kernel From 5.15.145 (inc) to 5.15.203 (exc)
linux linux_kernel From 6.1.71 (inc) to 6.1.168 (exc)
linux linux_kernel From 6.6.1 (inc) to 6.6.131 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability relates to the Linux kernel's ksmbd component, specifically in the smb2_calc_max_out_buf_len() function. After a code change introduced support for read compound operations, the way response buffers were managed was altered to use a dynamic iov array. However, the function smb2_calc_max_out_buf_len() was still using a hardcoded value for hdr2_len, which should instead be the offset of the Buffer field within the response structure. This mismatch could lead to incorrect buffer length calculations. The vulnerability was fixed by replacing the hardcoded hdr2_len with the correct offsetof() value.

Impact Analysis

This vulnerability relates to incorrect handling of the response buffer length in the ksmbd component of the Linux kernel. If exploited, it could potentially lead to improper buffer management, which might cause unexpected behavior such as crashes or memory corruption.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-31478. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart