Subject: CVE-2023-52755: ksmbd: fix slab out of bounds write in smb_inherit_dacl()

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

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

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

ksmbd: fix slab out of bounds write in smb_inherit_dacl()

slab out-of-bounds write is caused by that offsets is bigger than pntsd
allocation size. This patch add the check to validate 3 offsets using
allocation size.

The Linux kernel CVE team has assigned CVE-2023-52755 to this issue.

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

	Fixed in 5.15.140 with commit aaf0a07d6088
	Fixed in 6.1.64 with commit 8387c94d73ec
	Fixed in 6.5.13 with commit 09d9d8b40a33
	Fixed in 6.6.3 with commit 712e01f32e57
	Fixed in 6.7 with commit eebff19acaa3

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-2023-52755
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/smbacl.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/aaf0a07d60887d6c36fc46a24de0083744f07819
	https://git.kernel.org/stable/c/8387c94d73ec66eb597c7a23a8d9eadf64bfbafa
	https://git.kernel.org/stable/c/09d9d8b40a3338193619c14ed4dc040f4f119e70
	https://git.kernel.org/stable/c/712e01f32e577e7e48ab0adb5fe550646a3d93cb
	https://git.kernel.org/stable/c/eebff19acaa35820cb09ce2ccb3d21bee2156ffb