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, 21 Jul 2022 15:40:02 +0000 (10:40 -0500)
commit3e12a53ace522d55697d918d27ec34e42a439945
tree42328c98cbe7e6ff7028fc20a39306b9703a968b
parent2c0235601334521c8f818748565a18b759684615
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