Skip to contentSkip to conversation

CVE-2025-38191: ksmbd: fix null pointer dereference in destroy_previous_session

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 4, 2025

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: fix null pointer dereference in destroy_previous_session

If client set ->PreviousSessionId on kerberos session setup stage, NULL pointer dereference error will happen. Since sess->user is not set yet, It can pass the user argument as NULL to destroy_previous_session. sess->user will be set in ksmbd_krb5_authenticate(). So this patch move calling destroy_previous_session() after ksmbd_krb5_authenticate().

The Linux kernel CVE team has assigned CVE-2025-38191 to this issue.

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

	Fixed in 6.1.142 with commit 281afc52e2961cd5dd8326ebc9c5bc40904c0468
	Fixed in 6.6.95 with commit 0902625a24eea7fdc187faa5d97df244d159dd6e
	Fixed in 6.12.35 with commit 1193486dffb7432a09f57f5d09049b4d4123538b
	Fixed in 6.15.4 with commit 076f1adefb9837977af7ed233883842ddc446644
	Fixed in 6.16-rc3 with commit 7ac5b66acafcc9292fb935d7e03790f2b8b2dc0e

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-2025-38191

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/281afc52e2961cd5dd8326ebc9c5bc40904c0468
	https://git.kernel.org/stable/c/0902625a24eea7fdc187faa5d97df244d159dd6e
	https://git.kernel.org/stable/c/1193486dffb7432a09f57f5d09049b4d4123538b
	https://git.kernel.org/stable/c/076f1adefb9837977af7ed233883842ddc446644
	https://git.kernel.org/stable/c/7ac5b66acafcc9292fb935d7e03790f2b8b2dc0e