cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname
authorPaulo Alcantara <pc@manguebit.com>
Fri, 21 Apr 2023 18:52:32 +0000 (15:52 -0300)
committerSteve French <stfrench@microsoft.com>
Tue, 2 May 2023 14:41:09 +0000 (09:41 -0500)
commit90c49fce1c43e1cc152695e20363ff5087897c09
treecdb9f89842318870f9bbe9fed18bdb02d6af5489
parent1810769e3a51375ca35d7a5e5f79542858ca495a
cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname

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>
fs/cifs/cifs_debug.c
fs/cifs/cifs_debug.h
fs/cifs/connect.c
fs/cifs/sess.c