linux/fs
Paulo Alcantara a8a518ff3b cifs: fix potential deadlock in cache_refresh_path()
[ Upstream commit 9fb0db4051 ]

Avoid getting DFS referral from an exclusive lock in
cache_refresh_path() because the tcon IPC used for getting the
referral could be disconnected and thus causing a deadlock as shown
below:

task A                       task B
======                       ======
cifs_demultiplex_thread()    dfs_cache_find()
 cifs_handle_standard()       cache_refresh_path()
  reconnect_dfs_server()       down_write()
   dfs_cache_noreq_find()       get_dfs_referral()
    down_read() <- deadlock      smb2_get_dfs_refer()
                                  SMB2_ioctl()
				   cifs_send_recv()
				    compound_send_recv()
				     wait_for_response()

where task A cannot wake up task B because it is blocked on
down_read() due to the exclusive lock held in cache_refresh_path() and
therefore not being able to make progress.

Fixes: c9f7110399 ("cifs: keep referral server sessions alive")
Reviewed-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-01 08:34:24 +01:00
..
9p
adfs
affs affs: initialize fsdata in affs_truncate() 2023-02-01 08:34:08 +01:00
afs afs: Fix lost servers_outstanding count 2022-12-31 13:33:08 +01:00
autofs
befs
bfs
btrfs btrfs: fix race between quota rescan and disable leading to NULL pointer deref 2023-01-24 07:24:36 +01:00
cachefiles
ceph ceph: switch to vfs_inode_has_locks() to fix file lock bug 2023-01-12 12:02:23 +01:00
cifs cifs: fix potential deadlock in cache_refresh_path() 2023-02-01 08:34:24 +01:00
coda
configfs configfs: fix possible memory leak in configfs_create_dir() 2022-12-31 13:32:22 +01:00
cramfs
crypto fscrypt: fix keyring memory leak on mount failure 2022-10-19 20:54:43 -07:00
debugfs debugfs: fix error when writing negative value to atomic_t debugfs file 2022-12-31 13:31:58 +01:00
devpts
dlm fs: dlm: retry accept() until -EAGAIN or error returns 2023-01-07 11:11:44 +01:00
ecryptfs
efivarfs efi: efivars: Fix variable writes without query_variable_store() 2022-10-21 11:09:40 +02:00
efs
erofs erofs: fix kvcalloc() misuse with __GFP_NOFAIL 2023-02-01 08:34:07 +01:00
exfat
exportfs
ext2 ext2: unbugger ext2_empty_dir() 2023-01-07 11:11:40 +01:00
ext4 ext4: allocate extended attribute value in vmalloc area 2023-01-07 11:12:02 +01:00
f2fs f2fs: let's avoid panic if extent_tree is not created 2023-01-24 07:24:32 +01:00
fat
freevxfs
fscache fscache: Fix oops due to race with cookie_lru and use_cookie 2022-12-07 11:49:18 -08:00
fuse fuse: lock inode unconditionally in fuse_fallocate() 2022-11-23 09:10:42 +01:00
gfs2 gfs2: Partially revert gfs2_inode_lookup change 2022-12-31 13:32:45 +01:00
hfs hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling 2023-01-12 12:02:35 +01:00
hfsplus hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount 2023-01-04 11:28:59 +01:00
hostfs
hpfs
hugetlbfs hugetlbfs: fix null-ptr-deref in hugetlbfs_parse_param() 2022-12-31 13:33:05 +01:00
iomap
isofs
jbd2
jffs2
jfs fs: jfs: fix shift-out-of-bounds in dbDiscardAG 2022-12-31 13:32:57 +01:00
kernfs kernfs: Fix spurious lockdep warning in kernfs_find_and_get_node_by_id() 2022-11-10 19:03:42 +01:00
ksmbd ksmbd: check nt_len to be at least CIFS_ENCPWD_SIZE in ksmbd_decode_ntlmssp_auth_blob 2023-01-12 12:02:57 +01:00
lockd lockd: set other missing fields when unlocking files 2022-12-31 13:32:00 +01:00
minix
netfs netfs: Fix dodgy maths 2022-11-15 16:56:07 +00:00
nfs pNFS/filelayout: Fix coalescing test for single DS 2023-01-24 07:24:30 +01:00
nfs_common
nfsd NFSD: fix use-after-free in nfsd4_ssc_setup_dul() 2023-02-01 08:34:09 +01:00
nilfs2 nilfs2: fix general protection fault in nilfs_btree_insert() 2023-01-24 07:24:33 +01:00
nls
notify
ntfs
ntfs3 fs/ntfs3: Fix attr_punch_hole() null pointer derenference 2023-01-24 07:24:41 +01:00
ocfs2 ocfs2: fix memory leak in ocfs2_mount_volume() 2022-12-31 13:31:58 +01:00
omfs
openpromfs
orangefs orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init() 2022-12-31 13:33:06 +01:00
overlayfs ovl: update ->f_iocb_flags when ovl_change_flags() modifies ->f_flags 2023-01-04 11:29:00 +01:00
proc proc/meminfo: fix spacing in SecPageTables 2022-11-22 18:50:44 -08:00
pstore pstore/zone: Use GFP_ATOMIC to allocate zone buffer 2023-01-04 11:28:59 +01:00
qnx4
qnx6
quota ext4: fix bug_on in __es_tree_search caused by bad quota inode 2023-01-07 11:11:59 +01:00
ramfs
reiserfs reiserfs: Add missing calls to reiserfs_security_free() 2022-12-31 13:33:10 +01:00
romfs
smbfs_common
squashfs squashfs: fix buffer release race condition in readahead code 2022-10-28 13:37:21 -07:00
sysfs
sysv fs: sysv: Fix sysv_nblocks() returns wrong value 2022-12-31 13:32:00 +01:00
tracefs
ubifs Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
udf udf: Fix extension of the last extent in the file 2023-01-12 12:02:34 +01:00
ufs
unicode
vboxsf
verity
xfs xfs: rename XFS_REFC_COW_START to _COWFLAG 2022-10-31 08:58:22 -07:00
zonefs zonefs: Detect append writes at invalid locations 2023-01-24 07:24:33 +01:00
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_elf_fdpic.c elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size} 2023-01-18 11:58:12 +01:00
binfmt_elf_test.c
binfmt_elf.c elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size} 2023-01-18 11:58:12 +01:00
binfmt_flat.c
binfmt_misc.c binfmt_misc: fix shift-out-of-bounds in check_special_flags 2022-12-31 13:32:57 +01:00
binfmt_script.c
buffer.c
char_dev.c chardev: fix error handling in cdev_device_add() 2022-12-31 13:32:41 +01:00
compat_binfmt_elf.c
coredump.c
d_path.c
dax.c
dcache.c
direct-io.c
drop_caches.c
eventfd.c eventfd: provide a eventfd_signal_mask() helper 2023-01-04 11:28:48 +01:00
eventpoll.c eventpoll: add EPOLL_URING_WAKE poll wakeup flag 2023-01-04 11:28:47 +01:00
exec.c 23 hotfixes. 2022-10-29 17:49:33 -07:00
fcntl.c
fhandle.c
file_table.c
file.c fs: use acquire ordering in __fget_light() 2022-10-31 15:30:11 -04:00
filesystems.c
fs_context.c
fs_parser.c ext4: journal_path mount options should follow links 2023-01-07 11:11:59 +01:00
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c fs: do not update freeing inode i_io_list 2022-11-22 17:00:00 -05:00
fsopen.c
init.c
inode.c
internal.h
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
libfs.c libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value 2022-12-31 13:31:58 +01:00
locks.c filelock: new helper: vfs_inode_has_locks 2023-01-12 12:02:22 +01:00
Makefile
mbcache.c ext4: fix deadlock due to mbcache entry corruption 2023-01-07 11:12:02 +01:00
mount.h
mpage.c
namei.c vfs: vfs_tmpfile: ensure O_EXCL flag is enforced 2022-11-19 02:22:11 -05:00
namespace.c
no-block.c
nsfs.c
open.c
pipe.c
pnode.c pnode: terminate at peers of source 2023-01-04 11:29:01 +01:00
pnode.h
posix_acl.c
proc_namespace.c
read_write.c vfs: fix copy_file_range() averts filesystem freeze protection 2022-11-25 00:52:28 -05:00
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c fscrypt: fix keyring memory leak on mount failure 2022-10-19 20:54:43 -07:00
sync.c
sysctls.c
timerfd.c
userfaultfd.c mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA 2023-01-24 07:24:36 +01:00
utimes.c
xattr.c fs: don't audit the capability check in simple_xattr_list() 2022-12-31 13:31:55 +01:00