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.
Published: 2026-04-22
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Incorrect buffer size calculation that could lead to memory corruption
Action: Apply Patch
AI Analysis

Impact

The ksmbd component in the Linux kernel calculated the maximum output buffer size using a hardcoded header length instead of the correct offset of the response structure’s Buffer field. The fix replaces this magic number with an offset calculation. If the incorrect value was used, the function could underestimate the required buffer size, potentially resulting in an out‑of‑bounds write and memory corruption. The specific weakness classification is not explicitly provided (NVD-CWE-noinfo).

Affected Systems

Linux kernels that include ksmbd without the commit e2b76ab8b5c9 are affected. All distributions running a kernel older than this commit and exposing the ksmbd SMB service are at risk. The issue is architecture independent so any platform that builds ksmbd is impacted.

Risk and Exploitability

The CVSS score of 9.8 indicates a critical severity assessment. The EPSS score is below 1%, implying a very low likelihood of observed exploitation. The vulnerability is not listed in the CISA KEV catalog. Based on the description, a remote attacker could exploit the flaw by sending a specially crafted SMB request to a vulnerable ksmbd service, potentially leading to kernel memory corruption. The precise exploitation path is not detailed, so the likelihood of successful exploitation remains uncertain.

Generated by OpenCVE AI on April 28, 2026 at 15:38 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that includes commit e2b76ab8b5c9 or later, which corrects the offset calculation in ksmbd.
  • If a kernel upgrade is not immediately possible, disable the ksmbd service or unload the SMB module to prevent the vulnerable code from executing.
  • Use firewall rules or host‑based controls to restrict or block SMB traffic from untrusted networks until the kernel update is applied.

Generated by OpenCVE AI on April 28, 2026 at 15:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4561-1 linux-6.1 security update
Debian DSA Debian DSA DSA-6238-1 linux security update
Debian DSA Debian DSA DSA-6243-1 linux security update
History

Mon, 27 Apr 2026 23:30:00 +0000

Type Values Removed Values Added
Weaknesses NVD-CWE-noinfo
CPEs cpe:2.3:o:linux:linux_kernel:6.6:-:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:*

Mon, 27 Apr 2026 15:00:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Thu, 23 Apr 2026 00:15:00 +0000


Wed, 22 Apr 2026 14:15:00 +0000

Type Values Removed Values Added
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.
Title ksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-23T16:05:09.041Z

Reserved: 2026-03-09T15:48:24.098Z

Link: CVE-2026-31478

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Analyzed

Published: 2026-04-22T14:16:44.630

Modified: 2026-04-27T23:23:52.747

Link: CVE-2026-31478

cve-icon Redhat

Severity :

Publid Date: 2026-04-22T00:00:00Z

Links: CVE-2026-31478 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-28T15:45:06Z

Weaknesses