Skip to contentSkip to conversation

CVE-2026-31476: ksmbd: do not expire session on binding failure

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 22

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: do not expire session on binding failure

When a multichannel session binding request fails (e.g. wrong password), the error path unconditionally sets sess->state = SMB2_SESSION_EXPIRED. However, during binding, sess points to the target session looked up via ksmbd_session_lookup_slowpath() -- which belongs to another connection's user. This allows a remote attacker to invalidate any active session by simply sending a binding request with a wrong password (DoS).

Fix this by skipping session expiration when the failed request was a binding attempt, since the session does not belong to the current connection. The reference taken by ksmbd_session_lookup_slowpath() is still correctly released via ksmbd_user_session_put().

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

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

	Fixed in 6.1.168 with commit f5300690c23c5ac860499bb37dbc09cf43fd62e6
	Fixed in 6.6.131 with commit 6fafc4c4238e538969f1375f9ecdc6587c53f1cc
	Fixed in 6.12.80 with commit 1d1888b4a7aec518b707f6eca0bf08992c0e8da3
	Fixed in 6.18.21 with commit a897064a457056acb976e20e3007cdf553de340f
	Fixed in 6.19.11 with commit e0e5edc81b241c70355217de7e120c97c3429deb
	Fixed in 7.0 with commit 9bbb19d21ded7d78645506f20d8c44895e3d0fb9

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-31476

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/f5300690c23c5ac860499bb37dbc09cf43fd62e6
	https://git.kernel.org/stable/c/6fafc4c4238e538969f1375f9ecdc6587c53f1cc
	https://git.kernel.org/stable/c/1d1888b4a7aec518b707f6eca0bf08992c0e8da3
	https://git.kernel.org/stable/c/a897064a457056acb976e20e3007cdf553de340f
	https://git.kernel.org/stable/c/e0e5edc81b241c70355217de7e120c97c3429deb
	https://git.kernel.org/stable/c/9bbb19d21ded7d78645506f20d8c44895e3d0fb9