Skip to contentSkip to conversation

CVE-2026-31612: ksmbd: validate EaNameLength in smb2_get_ea()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 24

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

ksmbd: validate EaNameLength in smb2_get_ea()

smb2_get_ea() reads ea_req->EaNameLength from the client request and passes it directly to strncmp() as the comparison length without verifying that the length of the name really is the size of the input buffer received.

Fix this up by properly checking the size of the name based on the value received and the overall size of the request, to prevent a later strncmp() call to use the length as a "trusted" size of the buffer. Without this check, uninitialized heap values might be slowly leaked to the client.

The Linux kernel CVE team has assigned CVE-2026-31612 to this issue.

Affected and fixed versions
===========================

	Fixed in 6.12.83 with commit 551dfb15b182abad4600eaf7b37e6eb7000d5b1b
	Fixed in 6.18.24 with commit 3363a770b193f555f29d76ddf4ced3305c0ccf6d
	Fixed in 6.19.14 with commit 243b206bcb5a7137e8bddd57b2eec81e1ebd3859
	Fixed in 7.0.1 with commit dfc6878d14acafffbe670bf2576620757a10a3d8

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-31612

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/smb/server/smb2pdu.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/551dfb15b182abad4600eaf7b37e6eb7000d5b1b
	https://git.kernel.org/stable/c/3363a770b193f555f29d76ddf4ced3305c0ccf6d
	https://git.kernel.org/stable/c/243b206bcb5a7137e8bddd57b2eec81e1ebd3859
	https://git.kernel.org/stable/c/dfc6878d14acafffbe670bf2576620757a10a3d8
	https://git.kernel.org/stable/c/66751841212c2cc196577453c37f7774ff363f02