Skip to content

Commit be0f89d

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: fix wrong error response status by using set_smb2_rsp_status()
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: e2b76ab ("ksmbd: add support for read compound") Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent f433283 commit be0f89d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,12 @@ void set_smb2_rsp_status(struct ksmbd_work *work, __le32 err)
231231
{
232232
struct smb2_hdr *rsp_hdr;
233233

234-
if (work->next_smb2_rcv_hdr_off)
235-
rsp_hdr = ksmbd_resp_buf_next(work);
236-
else
237-
rsp_hdr = smb2_get_msg(work->response_buf);
234+
rsp_hdr = smb2_get_msg(work->response_buf);
238235
rsp_hdr->Status = err;
236+
237+
work->iov_idx = 0;
238+
work->iov_cnt = 0;
239+
work->next_smb2_rcv_hdr_off = 0;
239240
smb2_set_err_rsp(work);
240241
}
241242

0 commit comments

Comments
 (0)