cifs: verify that tcon is valid before dereference in cifs_kill_sb
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 13 Apr 2022 00:02:17 +0000 (10:02 +1000)
committerSteve French <stfrench@microsoft.com>
Thu, 14 Apr 2022 05:07:36 +0000 (00:07 -0500)
commit8b6c58458ee3206dde345fce327a4cb83e69caf9
tree7f5d022280835e26823cc8171c38685a7d5395fc
parent64c4a37ac04eeb43c42d272f6e6c8c12bfcf4304
cifs: verify that tcon is valid before dereference in cifs_kill_sb

On umount, cifs_sb->tlink_tree might contain entries that do not represent
a valid tcon.
Check the tcon for error before we dereference it.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsfs.c