cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname

commit 90c49fce1c upstream.

TCP_Server_Info::hostname may be updated once or many times during
reconnect, so protect its access outside reconnect path as well and
then prevent any potential use-after-free bugs.

Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Paulo Alcantara 2023-04-21 15:52:32 -03:00 • committed by Greg Kroah-Hartman
commit 64d62ac6d6
4 changed files with 23 additions and 13 deletions