CVE-2026-139181

ksmbd: fix SMB2 CREATE response buffer overflow in compound requests

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ksmbd: fix SMB2 CREATE response buffer overflow in compound requests

A CREATE response that carries an AAPL create context can reach
create_rsp_size (572 bytes for SMB 3.1.1). Commit 713c31a3a225
("ksmbd: fix SMB2 CREATE response buffer overflow") makes
smb2_allocate_rsp_buf() reserve that much, but only for the first
command of a compound. A CREATE later in the compound is guarded by
is_chained_smb2_message() instead, which reserves only
MAX_CIFS_SMALL_BUFFER_SIZE (448 bytes) for the next response. smb2_open()
then appends the create contexts without checking the space left.

That check also uses the unpadded length of the response so far.
init_chained_smb2_rsp() pads the previous response to 8 bytes before the
next command runs, so the next response can start up to 7 bytes later
than the check assumes.

When a CREATE follows a command that fills the response buffer, such as
QUERY_DIRECTORY, it writes its create contexts past the end of the
buffer. The AAPL context is written last.

BUG: KASAN: slab-out-of-bounds in create_aapl_rsp_buf+0x31/0x6e0 [ksmbd]
Call Trace:
create_aapl_rsp_buf+0x31/0x6e0 [ksmbd]
smb2_open+0x4fa8/0xd900 [ksmbd]
handle_ksmbd_work+0x88c/0x1cb0 [ksmbd]

When the next command is a CREATE, reserve create_rsp_size, as
smb2_allocate_rsp_buf() does for a single CREATE, and check the reserve
against the 8-byte aligned offset where the next response starts.

Analysis

AI-generated

Technical impact

In the Linux kernel, a buffer overflow exists in the ksmbd SMB server when processing compound SMB2 CREATE requests. The overflow occurs because the response buffer is allocated with insufficient size for a second CREATE after a preceding command fills the buffer, and the subsequent CREATE writes its create contexts past the buffer boundary. An attacker controlling the SMB client can send a crafted compound request that triggers the overflow and corrupts kernel memory, potentially leading to arbitrary code execution or a kernel crash.

Affected Systems

The affected product is the Linux kernel’s ksmbd SMB server component. No specific versions are enumerated in the advisory, so any kernel that implements the vulnerable ksmbd code before the fix (commit 713c31a3a225) is likely impacted. This includes all distributions that ship a kernel with ksmbd before the patch.

Risk and Exploitability

Although no CVSS score is provided, the kernel buffer overflow grants an attacker a high level of privilege escalation or denial of service. The vulnerability is exploitable remotely via SMB connections and has not been listed in the CISA KEV catalog. Because no public exploit is known, the EPSS score is absent, but the risk remains significant due to the potential impact on system integrity and availability.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that incorporates commit 713c31a3a225.
  • If unable to patch immediately, block or limit external SMB traffic to the ksmbd service from untrusted networks using firewall rules.
  • Consider disabling ksmbd if SMB functionality is not required in the environment.

Generated by OpenCVE AI on November 30, 2026 at 20:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-119
CWE-122
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix SMB2 CREATE response buffer overflow in compound requests A CREATE response that carries an AAPL create context can reach create_rsp_size (572 bytes for SMB 3.1.1). Commit 713c31a3a225 ("ksmbd: fix SMB2 CREATE response buffer overflow") makes smb2_allocate_rsp_buf() reserve that much, but only for the first command of a compound. A CREATE later in the compound is guarded by is_chained_smb2_message() instead, which reserves only MAX_CIFS_SMALL_BUFFER_SIZE (448 bytes) for the next response. smb2_open() then appends the create contexts without checking the space left. That check also uses the unpadded length of the response so far. init_chained_smb2_rsp() pads the previous response to 8 bytes before the next command runs, so the next response can start up to 7 bytes later than the check assumes. When a CREATE follows a command that fills the response buffer, such as QUERY_DIRECTORY, it writes its create contexts past the end of the buffer. The AAPL context is written last. BUG: KASAN: slab-out-of-bounds in create_aapl_rsp_buf+0x31/0x6e0 [ksmbd] Call Trace: create_aapl_rsp_buf+0x31/0x6e0 [ksmbd] smb2_open+0x4fa8/0xd900 [ksmbd] handle_ksmbd_work+0x88c/0x1cb0 [ksmbd] When the next command is a CREATE, reserve create_rsp_size, as smb2_allocate_rsp_buf() does for a single CREATE, and check the reserve against the 8-byte aligned offset where the next response starts.
Title ksmbd: fix SMB2 CREATE response buffer overflow in compound requests
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-119

    Improper Restriction of Operations within the Bounds of a Memory Buffer

  • CWE-122

    Heap-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:32 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM