Subject: CVE-2024-26952: ksmbd: fix potencial out-of-bounds when buffer offset is invalid

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

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

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

ksmbd: fix potencial out-of-bounds when buffer offset is invalid

I found potencial out-of-bounds when buffer offset fields of a few requests
is invalid. This patch set the minimum value of buffer offset field to
->Buffer offset to validate buffer length.

The Linux kernel CVE team has assigned CVE-2024-26952 to this issue.

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

	Fixed in 6.6.32 with commit 39bdc4197acf
	Fixed in 6.7.12 with commit 2dcda336b6e8
	Fixed in 6.8.3 with commit 0c5541b4c980
	Fixed in 6.9 with commit c6cd2e8d2d9a

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-2024-26952
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/smb2misc.c
	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/39bdc4197acf2ed13269167ccf093ee28cfa2a4e
	https://git.kernel.org/stable/c/2dcda336b6e80b72d58d30d40f2fad9724e5fe63
	https://git.kernel.org/stable/c/0c5541b4c980626fa3cab16ba1a451757778bbb5
	https://git.kernel.org/stable/c/c6cd2e8d2d9aa7ee35b1fa6a668e32a22a9753da