mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 12:00:22 +09:00
ksmbd: fix wrong error response status by using set_smb2_rsp_status()
[ Upstream commitbe0f89d441] set_smb2_rsp_status() after __process_request() sets the wrong error status. This patch resets all iov vectors and sets the error status on clean one. Fixes:e2b76ab8b5("ksmbd: add support for read compound") 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dd45db4d9b
commit
4b9b7ea1ff
@@ -231,11 +231,12 @@ void set_smb2_rsp_status(struct ksmbd_work *work, __le32 err)
|
||||
{
|
||||
struct smb2_hdr *rsp_hdr;
|
||||
|
||||
if (work->next_smb2_rcv_hdr_off)
|
||||
rsp_hdr = ksmbd_resp_buf_next(work);
|
||||
else
|
||||
rsp_hdr = smb2_get_msg(work->response_buf);
|
||||
rsp_hdr = smb2_get_msg(work->response_buf);
|
||||
rsp_hdr->Status = err;
|
||||
|
||||
work->iov_idx = 0;
|
||||
work->iov_cnt = 0;
|
||||
work->next_smb2_rcv_hdr_off = 0;
|
||||
smb2_set_err_rsp(work);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user