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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:26 +0000 (12:34 +0200)
commit39b68556282584ebbc03bc37b8770cbaf4e056cf
treee99961218c5601594b7024e28b8eb849ceeefdb4
parent2b0897e33682a332167b7d355eec28693b62119e
ksmbd: fix endless loop when encryption for response fails

commit 360c8ee6fefdb496fffd2c18bb9a96a376a1a804 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/server.c