summaryrefslogtreecommitdiff
path: root/fs/ksmbd
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@kernel.org>2022-09-22 23:35:43 +0900
committerSteve French <stfrench@microsoft.com>2022-10-05 01:15:44 -0500
commit360c8ee6fefdb496fffd2c18bb9a96a376a1a804 (patch)
tree1ab57079bfeb191cde267ccf168f4611e78b8ac4 /fs/ksmbd
parentd5919f2a1459083bd0aaede7fc44e945290e44df (diff)
downloadlwn-360c8ee6fefdb496fffd2c18bb9a96a376a1a804.tar.gz
lwn-360c8ee6fefdb496fffd2c18bb9a96a376a1a804.zip
ksmbd: fix endless loop when encryption for response fails
If ->encrypt_resp return error, goto statement cause endless loop. It send an error response immediately after removing it. Fixes: 0626e6641f6b ("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>
Diffstat (limited to 'fs/ksmbd')
-rw-r--r--fs/ksmbd/server.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ksmbd/server.c b/fs/ksmbd/server.c
index ce42bff42ef9..a0d635304754 100644
--- a/fs/ksmbd/server.c
+++ b/fs/ksmbd/server.c
@@ -235,10 +235,8 @@ send:
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);