ksmbd: allocate one more byte for implied bcc[0]

commit 443d61d1fa upstream.

ksmbd_smb2_check_message allows client to return one byte more, so we
need to allocate additional memory in ksmbd_conn_handler_loop to avoid
out-of-bound access.

Cc: stable@vger.kernel.org
Signed-off-by: Chih-Yen Chang <cc85nod@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Chih-Yen Chang 2023-05-06 00:03:54 +09:00 коммит произвёл Greg Kroah-Hartman
Родитель 1c2461b41f
Коммит 61e043326e
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -320,7 +320,8 @@ int ksmbd_conn_handler_loop(void *p)
break;
/* 4 for rfc1002 length field */
size = pdu_size + 4;
/* 1 for implied bcc[0] */
size = pdu_size + 4 + 1;
conn->request_buf = kvmalloc(size, GFP_KERNEL);
if (!conn->request_buf)
break;