]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ksmbd: do not allow the actual frame length to be smaller than the rfc1002 length
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 10 Feb 2023 15:27:34 +0000 (00:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:07 +0000 (09:34 +0100)
commitdf6c263a31a4dcdf2c48e0e8d3158fd406151e48
tree0b34924382eb65c6d3227f0c28198646fc0de198
parent2254e82d2018692d06bee47dae01b85652ddc804
ksmbd: do not allow the actual frame length to be smaller than the rfc1002 length

commit fb533473d1595fe79ecb528fda1de33552b07178 upstream.

ksmbd allowed the actual frame length to be smaller than the rfc1002
length. If allowed, it is possible to allocates a large amount of memory
that can be limited by credit management and can eventually cause memory
exhaustion problem. This patch do not allow it except SMB2 Negotiate
request which will be validated when message handling proceeds.
Also, Allow a message that padded to 8byte boundary.

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/smb2misc.c