Skip to content
Snippets Groups Projects
Commit ee7e40f7 authored by Wentao Liang's avatar Wentao Liang Committed by Greg Kroah-Hartman
Browse files

ksmbd: fix a missing return value check bug


[ Upstream commit 4c16e1ca ]

In the smb2_send_interim_resp(), if ksmbd_alloc_work_struct()
fails to allocate a node, it returns a NULL pointer to the
in_work pointer. This can lead to an illegal memory write of
in_work->response_buf when allocate_interim_rsp_buf() attempts
to perform a kzalloc() on it.

To address this issue, incorporating a check for the return
value of ksmbd_alloc_work_struct() ensures that the function
returns immediately upon allocation failure, thereby preventing
the aforementioned illegal memory access.

Fixes: 041bba44 ("ksmbd: fix wrong interim response on compound")
Signed-off-by: default avatarWentao Liang <liangwentao@iscas.ac.cn>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f05f5ab5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment