Skip to contentSkip to conversation

CVE-2024-26954: ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 1, 2024

lore
Share & tools
lore
#0 lore raw

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

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

ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()

If ->NameOffset of smb2_create_req is smaller than Buffer offset of smb2_create_req, slab-out-of-bounds read can happen from smb2_open. This patch set the minimum value of the name offset to the buffer offset to validate name length of smb2_create_req().

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

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

	Fixed in 6.7.12 with commit 3b8da67191e9
	Fixed in 6.8.3 with commit 4f97e6a9d62c
	Fixed in 6.9-rc1 with commit a80a486d72e2

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

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

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/3b8da67191e938a63d2736dabb4ac5d337e5de57
	https://git.kernel.org/stable/c/4f97e6a9d62cb1fce82fbf4baff44b83221bc178
	https://git.kernel.org/stable/c/a80a486d72e20bd12c335bcd38b6e6f19356b0aa