linux/fs/cifs
Enzo Matsumiya 9351590f51 cifs: properly invalidate cached root handle when closing it
Cached root file was not being completely invalidated sometimes.

Reproducing:
- With a DFS share with 2 targets, one disabled and one enabled
- start some I/O on the mount
  # while true; do ls /mnt/dfs; done
- at the same time, disable the enabled target and enable the disabled
  one
- wait for DFS cache to expire
- on reconnect, the previous cached root handle should be invalid, but
  open_cached_dir_by_dentry() will still try to use it, but throws a
  use-after-free warning (kref_get())

Make smb2_close_cached_fid() invalidate all fields every time, but only
send an SMB2_close() when the entry is still valid.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-09-09 17:34:38 -05:00
..
Kconfig cifs: create a MD4 module and switch cifs.ko to use it 2021-08-25 15:48:00 -05:00
Makefile cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
asn1.c cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
cache.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_debug.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
cifs_debug.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_dfs_ref.c cifs: Do not use the original cruid when following DFS links for multiuser mounts 2021-07-14 10:06:33 -05:00
cifs_fs_sb.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_ioctl.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_spnego.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_spnego.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifs_spnego_negtokeninit.asn1 cifs: decoding negTokenInit with generic ASN1 decoder 2021-06-20 21:28:17 -05:00
cifs_swn.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
cifs_swn.h cifs: simplify SWN code with dummy funcs instead of ifdefs 2021-04-25 16:28:22 -05:00
cifs_unicode.c CIFS: Fix a potencially linear read overflow 2021-08-25 15:42:15 -05:00
cifs_unicode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cifs_uniupr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cifsacl.c smb3: fix possible access to uninitialized pointer to DACL 2021-06-23 19:26:40 -05:00
cifsacl.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
cifsencrypt.c cifs: rename cifs_common to smbfs_common 2021-09-08 23:59:26 -05:00
cifsfs.c cifs: create a MD4 module and switch cifs.ko to use it 2021-08-25 15:48:00 -05:00
cifsfs.h cifs: update internal version number 2021-07-09 13:03:36 -05:00
cifsglob.h cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
cifspdu.h cifs: move SMB FSCTL definitions to common code 2021-09-09 00:09:20 -05:00
cifsproto.h cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
cifsroot.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
cifssmb.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
connect.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
dfs_cache.c cifs: support share failover when remounting 2021-07-22 11:43:23 -05:00
dfs_cache.h cifs: support share failover when remounting 2021-07-22 11:43:23 -05:00
dir.c cifs: use the correct max-length for dentry_path_raw() 2021-08-10 10:45:50 -05:00
dns_resolve.c cifs: use the expiry output of dns_query to schedule next resolution 2021-07-14 10:06:03 -05:00
dns_resolve.h cifs: use the expiry output of dns_query to schedule next resolution 2021-07-14 10:06:03 -05:00
export.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
file.c cifs: enable fscache usage even for files opened as rw 2021-08-25 15:45:10 -05:00
fs_context.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
fs_context.h cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
fscache.c cifs: enable fscache usage even for files opened as rw 2021-08-25 15:45:10 -05:00
fscache.h cifs: enable fscache usage even for files opened as rw 2021-08-25 15:45:10 -05:00
inode.c cifs: enable fscache usage even for files opened as rw 2021-08-25 15:45:10 -05:00
ioctl.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
link.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
misc.c cifs: Call close synchronously during unlink/rename/lease break. 2021-08-12 11:29:58 -05:00
netlink.c cifs: Constify static struct genl_ops 2021-06-20 21:28:16 -05:00
netlink.h cifs: Register generic netlink family 2020-12-14 09:16:22 -06:00
netmisc.c cifs`: handle ERRBaduid for SMB1 2020-08-02 18:00:25 -05:00
nterr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
nterr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
ntlmssp.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
readdir.c cifs: Do not leak EDEADLK to dgetents64 for STATUS_USER_SESSION_DELETED 2021-08-25 16:08:38 -05:00
rfc1002pdu.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
sess.c cifs: remove support for NTLM and weaker authentication algorithms 2021-08-25 15:47:06 -05:00
smb1ops.c cifs: constify path argument of ->make_node() 2021-04-25 16:28:23 -05:00
smb2file.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
smb2glob.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
smb2inode.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
smb2maperror.c cifs: cifs_md4 convert to SPDX identifier 2021-08-25 15:51:52 -05:00
smb2misc.c cifs: fix NULL dereference in smb2_check_message() 2021-06-23 13:04:36 -05:00
smb2ops.c cifs: properly invalidate cached root handle when closing it 2021-09-09 17:34:38 -05:00
smb2pdu.c cifs: create sd context must be a multiple of 8 2021-08-05 12:48:42 -05:00
smb2pdu.h SMB3.1.1: fix mount failure to some servers when compression enabled 2021-07-15 19:07:04 -05:00
smb2proto.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
smb2status.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
smb2transport.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
smbdirect.c smbdirect: missing rc checks while waiting for rdma events 2021-06-22 12:08:32 -05:00
smbdirect.h cifs: smbd: Do not schedule work to send immediate packet on every receive 2020-04-07 12:41:16 -05:00
smbencrypt.c cifs: rename cifs_common to smbfs_common 2021-09-08 23:59:26 -05:00
smberr.h cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00
trace.c smb3: Cleanup license mess 2019-01-24 09:37:33 -06:00
trace.h cifs: fix string declarations and assignments in tracepoints 2021-05-27 14:04:32 -05:00
transport.c cifs: make locking consistent around the server session status 2021-07-02 18:35:25 -05:00
unc.c cifs: don't cargo-cult strndup() 2021-04-25 16:28:23 -05:00
winucase.c Replace HTTP links with HTTPS ones: CIFS 2020-07-05 14:23:38 -06:00
xattr.c cifs: use SPDX-Licence-Identifier 2021-06-20 21:28:17 -05:00