CVE-2023-54250: ksmbd: avoid out of bounds access in decode_preauth_ctxt()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: avoid out of bounds access in decode_preauth_ctxt()
Confirm that the accessed pneg_ctxt->HashAlgorithms address sits within the SMB request boundary; deassemble_neg_contexts() only checks that the eight byte smb2_neg_context header + (client controlled) DataLength are within the packet boundary, which is insufficient.
Checking for sizeof(struct smb2_preauth_neg_context) is overkill given that the type currently assumes SMB311_SALT_SIZE bytes of trailing Salt.
The Linux kernel CVE team has assigned CVE-2023-54250 to this issue.
Affected and fixed versions
===========================
Fixed in 5.15.145 with commit 39f5b4b313b445c980a2a295bed28228c29228ed Fixed in 6.1.25 with commit a2f6ded41bec1d3be643c80a5eb97f1680309001 Fixed in 6.2.12 with commit f02edb9debbd36f44efa7567031485892c7df60d Fixed in 6.3 with commit e7067a446264a7514fa1cfaa4052cdb6803bc6a2
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-54250
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/ksmbd/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/39f5b4b313b445c980a2a295bed28228c29228ed https://git.kernel.org/stable/c/a2f6ded41bec1d3be643c80a5eb97f1680309001 https://git.kernel.org/stable/c/f02edb9debbd36f44efa7567031485892c7df60d https://git.kernel.org/stable/c/e7067a446264a7514fa1cfaa4052cdb6803bc6a2