cifs: fix session state check in reconnect to avoid
authorSteve French <stfrench@microsoft.com>
Thu, 20 Jul 2023 01:06:27 +0000 (20:06 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 20 Jul 2023 01:06:27 +0000 (20:06 -0500)
commit0de71d4a358634edb947ff13540d32bd7229b767
tree39dfd98d89b7c0674e0698d07e06f3009a8aaecc
parente7715735076849e417c33687d0327b2d59d791d7
cifs: fix session state check in reconnect to avoid
 use-after-free issue

Don't collect exiting session in smb2_reconnect_server(), because it
will be released soon.

Note that the exiting session will stay in server->smb_ses_list until
it complete the cifs_free_ipc() and logoff() and then delete itself
from the list.

Signed-off-by: Winston Wen <wentao@uniontech.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c