CVE-2026-64381: smb: client: Fix next buffer leak in receive_encrypted_standard()

Greg Kroah-Hartman <[email protected]> Sat, 25 Jul 2026 10:49:58 +0200
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026072525-CVE-2026-64381-5b4a@gregkh>
From: Greg Kroah-Hartman <[email protected]>

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

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

smb: client: Fix next buffer leak in receive_encrypted_standard()

receive_encrypted_standard() allocates next_buffer before checking
whether the number of compound PDUs already reached MAX_COMPOUND. If
the limit check fails, the function returns immediately and the newly
allocated next_buffer is not assigned to server->smallbuf/server->bigbuf,
making it leaked.

Move the MAX_COMPOUND check before allocating next_buffer.

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


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

	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 5.10.261 with commit 94e4f672db029414b9888b5137a7559f1febf2d8
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 5.15.212 with commit 68fc0b6cc03ca58060c0f36454e169f5fe258974
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 6.1.178 with commit 07e0ab81df1790afa35732a4e8e07ff831b29008
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 6.6.145 with commit 9136a08dc29328edd9867f2545e73906ac9df93b
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 6.12.96 with commit 67097772df7791c53d608f04bd31c676ccf79b83
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 6.18.39 with commit 297243e365fc9fe2f8e9b7dd535a65d922cd108b
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 7.1.4 with commit 927d4805aea0a287d36dd4f826ee24d69a2afee3
	Issue introduced in 4.19 with commit b24df3e30cbf48255db866720fb71f14bf9d2f39 and fixed in 7.2-rc1 with commit 1c6267a1d5cf4c73b656f8181b310cbbb3e4767b

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-64381
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/client/smb2ops.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/94e4f672db029414b9888b5137a7559f1febf2d8
	https://git.kernel.org/stable/c/68fc0b6cc03ca58060c0f36454e169f5fe258974
	https://git.kernel.org/stable/c/07e0ab81df1790afa35732a4e8e07ff831b29008
	https://git.kernel.org/stable/c/9136a08dc29328edd9867f2545e73906ac9df93b
	https://git.kernel.org/stable/c/67097772df7791c53d608f04bd31c676ccf79b83
	https://git.kernel.org/stable/c/297243e365fc9fe2f8e9b7dd535a65d922cd108b
	https://git.kernel.org/stable/c/927d4805aea0a287d36dd4f826ee24d69a2afee3
	https://git.kernel.org/stable/c/1c6267a1d5cf4c73b656f8181b310cbbb3e4767b