Skip to content

Commit

Permalink
ksmbd: fix endless loop when encryption for response fails
Browse files Browse the repository at this point in the history
commit 360c8ee upstream.

If ->encrypt_resp return error, goto statement cause endless loop.
It send an error response immediately after removing it.

Fixes: 0626e66 ("cifsd: add server handler for central processing and tranport layers")
Cc: stable@vger.kernel.org
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>
  • Loading branch information
namjaejeon authored and gregkh committed Oct 21, 2022
1 parent 4bfa0af commit 7df7cc5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/ksmbd/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,8 @@ static void __handle_ksmbd_work(struct ksmbd_work *work,
if (work->sess && work->sess->enc && work->encrypted &&
conn->ops->encrypt_resp) {
rc = conn->ops->encrypt_resp(work);
if (rc < 0) {
if (rc < 0)
conn->ops->set_rsp_status(work, STATUS_DATA_ERROR);
goto send;
}
}

ksmbd_conn_write(work);
Expand Down

0 comments on commit 7df7cc5

Please sign in to comment.