]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ksmbd: fix endless loop when encryption for response fails
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 22 Sep 2022 14:35:43 +0000 (23:35 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 5 Oct 2022 06:15:44 +0000 (01:15 -0500)
If ->encrypt_resp return error, goto statement cause endless loop.
It send an error response immediately after removing it.

Fixes: 34342fc8255d ("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>
fs/ksmbd/server.c

index ce42bff42ef9fad4ebb89a05b8fe33445d38c5fc..a0d635304754a4be9462e8ae1290e42c771697e0 100644 (file)
@@ -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);