Skip to main content

Linux Kernel ksmbd CVE-2026-31707

| EUVDEUVD-2026-26516 HIGH
Out-of-bounds Write (CWE-787)
2026-05-01 416baaa9-dc9f-4396-8d5f-8c081fb06d67
7.1
CVSS 3.1 · NVD
Share

Severity by source

NVD PRIMARY
7.1 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
SUSE
HIGH
qualitative
Red Hat
MEDIUM
qualitative

Primary rating from NVD.

CVSS VectorNVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
High

Lifecycle Timeline

7
Analysis Generated
May 03, 2026 - 07:24 vuln.today
CVSS changed
May 03, 2026 - 07:22 NVD
7.1 (HIGH)
Patch released
May 03, 2026 - 07:16 nvd
Patch available
Patch available
May 01, 2026 - 15:02 EUVD
EUVD ID Assigned
May 01, 2026 - 14:22 euvd
EUVD-2026-26516
Analysis Generated
May 01, 2026 - 14:22 vuln.today
CVE Published
May 01, 2026 - 14:16 nvd
HIGH 7.1

DescriptionCVE.org

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

ksmbd: validate response sizes in ipc_validate_msg()

ipc_validate_msg() computes the expected message size for each response type by adding (or multiplying) attacker-controlled fields from the daemon response to a fixed struct size in unsigned int arithmetic. Three cases can overflow:

KSMBD_EVENT_RPC_REQUEST: msg_sz = sizeof(struct ksmbd_rpc_command) + resp->payload_sz; KSMBD_EVENT_SHARE_CONFIG_REQUEST: msg_sz = sizeof(struct ksmbd_share_config_response) + resp->payload_sz; KSMBD_EVENT_LOGIN_REQUEST_EXT: msg_sz = sizeof(struct ksmbd_login_response_ext) + resp->ngroups * sizeof(gid_t);

resp->payload_sz is __u32 and resp->ngroups is __s32. Each addition can wrap in unsigned int; the multiplication by sizeof(gid_t) mixes signed and size_t, so a negative ngroups is converted to SIZE_MAX before the multiply. A wrapped value of msg_sz that happens to equal entry->msg_sz bypasses the size check on the next line, and downstream consumers (smb2pdu.c:6742 memcpy using rpc_resp->payload_sz, kmemdup in ksmbd_alloc_user using resp_ext->ngroups) then trust the unverified length.

Use check_add_overflow() on the RPC_REQUEST and SHARE_CONFIG_REQUEST paths to detect integer overflow without constraining functional payload size; userspace ksmbd-tools grows NDR responses in 4096-byte chunks for calls like NetShareEnumAll, so a hard transport cap is unworkable on the response side. For LOGIN_REQUEST_EXT, reject resp->ngroups outside the signed [0, NGROUPS_MAX] range up front and report the error from ipc_validate_msg() so it fires at the IPC boundary; with that bound the subsequent multiplication and addition stay well below UINT_MAX. The now-redundant ngroups check and pr_err in ksmbd_alloc_user() are removed.

This is the response-side analogue of aab98e2dbd64 ("ksmbd: fix integer overflows on 32 bit systems"), which hardened the request side.

AnalysisAI

Integer overflow in Linux kernel's ksmbd (SMB server) allows local authenticated attackers to bypass size validation and trigger memory corruption via crafted daemon responses. The vulnerability affects three IPC message handlers that fail to detect arithmetic overflow when computing expected message sizes from attacker-controlled fields (payload_sz, ngroups), enabling out-of-bounds memcpy operations. Vendor patches available for affected 5.15+ kernels. EPSS score 0.02% (5th percentile) indicates low observed exploitation probability. No CISA KEV listing or public exploit identified at time of analysis.

Technical ContextAI

The vulnerability exists in ksmbd's Inter-Process Communication validation layer (ipc_validate_msg function), which mediates between the kernel SMB server and userspace daemon. Three response handlers perform unsafe arithmetic on daemon-supplied unsigned 32-bit integers when calculating expected message sizes: RPC_REQUEST and SHARE_CONFIG_REQUEST add payload_sz to struct sizes without overflow detection, while LOGIN_REQUEST_EXT multiplies a signed ngroups field by sizeof(gid_t), converting negative values to SIZE_MAX before multiplication. When overflow produces a wrapped msg_sz that coincidentally equals the actual buffer size, validation passes and downstream consumers (memcpy at smb2pdu.c:6742, kmemdup in ksmbd_alloc_user) trust the unvalidated lengths. The fix introduces check_add_overflow() for addition operations and range-checks ngroups against [0, NGROUPS_MAX] before multiplication. This mirrors the request-side hardening in CVE-2025-aab98e2dbd64. Ksmbd was introduced in Linux 5.15 as an in-kernel SMB3 server implementation replacing the deprecated Samba kernel module.

RemediationAI

Apply vendor-released kernel patches immediately for systems running ksmbd. Specific fixed versions: upgrade to Linux 6.12.84 or later for 6.12.x series (commit d6a6aa81eac2c9bff66dc6e191179cb69a14426b), 6.18.25+ for 6.18.x (commit 99c631d0366c1eab8fb188fe66425f4581ebdde4), 7.0.2+ for 7.0.x (commit 7dd0c858e1909769a4c91842724315ee74f1a5f1), or 7.1-rc1+ for mainline (commit 299db777ea0cfa5c407e41b045c24a14c034c27b). Patch references available at https://git.kernel.org/stable/c/[commit-hash]. If immediate patching is not feasible, disable ksmbd module via 'rmmod ksmbd' and fall back to userspace Samba, which provides equivalent SMB functionality without kernel attack surface - note this requires reconfiguring share definitions in /etc/samba/smb.conf and may impact performance for high-throughput file serving. Alternatively, restrict access to ksmbd management interface using AppArmor or SELinux policies to trusted administrative users only, reducing exposure to the local privilege requirement, though this does not eliminate risk from compromised admin accounts or container escapes. Verify ksmbd status with 'lsmod | grep ksmbd' and review /sys/module/ksmbd/parameters for active configurations.

Vendor StatusVendor

SUSE

Severity: High
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Availability Extension 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed

Share

CVE-2026-31707 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy