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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:19 +0000 (09:34 +0200)
commit7a509a9f2bb7b7edce6e26242fceaf0d212369f9
treecff692f5603cb346e2e15acc1431161e73d43691
parentbd17422b9b675414d0f1a5e070d42fe85b785cd6
cifs: verify that tcon is valid before dereference in cifs_kill_sb

commit 8b6c58458ee3206dde345fce327a4cb83e69caf9 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifsfs.c