]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: limit pdu length size according to connection status
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 24 Jan 2023 15:13:20 +0000 (00:13 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:38 +0000 (08:34 +0100)
commit2a1a910cc1b3b0959629e9811fba51a5ccba298c
treedb3639fa272603e245a16c3dd891e4e0d3196735
parent5af07c82dc86b806de59128a37af2e421c0eba9d
ksmbd: limit pdu length size according to connection status

commit 75f1cd3a442b871c08c80e99f790287b621d6d03 upstream.

Stream protocol length will never be larger than 16KB until session setup.
After session setup, the size of requests will not be larger than
16KB + SMB2 MAX WRITE size. This patch limits these invalidly oversized
requests and closes the connection immediately.

Fixes: 4857d6d8e019 ("cifsd: add server handler for central processing and tranport layers")
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-18259
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/connection.c
fs/ksmbd/smb2pdu.h