====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ kworker/0:5/22207 is trying to acquire lock: 0000000025b9faf3 (&sb->s_type->i_mutex_key#10){++++}, at: inode_lock include/linux/fs.h:748 [inline] 0000000025b9faf3 (&sb->s_type->i_mutex_key#10){++++}, at: __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 but task is already holding lock: 000000002ca5ecae ((work_completion)(&dio->complete_work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ((work_completion)(&dio->complete_work)){+.+.}: worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 -> #1 ((wq_completion)"dio/%s"sb->s_id){+.+.}: drain_workqueue+0x1a5/0x460 kernel/workqueue.c:2826 destroy_workqueue+0x75/0x790 kernel/workqueue.c:4183 __alloc_workqueue_key+0xb76/0xed0 kernel/workqueue.c:4160 sb_init_dio_done_wq+0x34/0x90 fs/direct-io.c:623 dio_set_defer_completion fs/direct-io.c:646 [inline] get_more_blocks fs/direct-io.c:724 [inline] do_direct_IO fs/direct-io.c:1003 [inline] do_blockdev_direct_IO fs/direct-io.c:1333 [inline] __blockdev_direct_IO+0x83a8/0xef40 fs/direct-io.c:1419 ext4_direct_IO_write fs/ext4/inode.c:3777 [inline] ext4_direct_IO+0xae4/0x1c50 fs/ext4/inode.c:3915 generic_file_direct_write+0x208/0x4a0 mm/filemap.c:3073 __generic_file_write_iter+0x2d0/0x610 mm/filemap.c:3252 ext4_file_write_iter+0x2fe/0xf20 fs/ext4/file.c:272 call_write_iter include/linux/fs.h:1821 [inline] aio_write+0x37f/0x5c0 fs/aio.c:1574 __io_submit_one fs/aio.c:1858 [inline] io_submit_one+0xecd/0x20c0 fs/aio.c:1909 __do_sys_io_submit fs/aio.c:1953 [inline] __se_sys_io_submit+0x11b/0x4a0 fs/aio.c:1924 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&sb->s_type->i_mutex_key#10){++++}: down_write+0x34/0x90 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:748 [inline] __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 ext4_sync_file+0xa35/0x1420 fs/ext4/fsync.c:118 vfs_fsync_range+0x13a/0x220 fs/sync.c:197 generic_write_sync include/linux/fs.h:2750 [inline] dio_complete+0x763/0xac0 fs/direct-io.c:329 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#10 --> (wq_completion)"dio/%s"sb->s_id --> (work_completion)(&dio->complete_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&dio->complete_work)); lock((wq_completion)"dio/%s"sb->s_id); lock((work_completion)(&dio->complete_work)); lock(&sb->s_type->i_mutex_key#10); *** DEADLOCK *** 2 locks held by kworker/0:5/22207: #0: 0000000071c39c90 ((wq_completion)"dio/%s"sb->s_id){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124 #1: 000000002ca5ecae ((work_completion)(&dio->complete_work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128 stack backtrace: CPU: 0 PID: 22207 Comm: kworker/0:5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: dio/sda1 dio_aio_complete_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1866 [inline] check_prevs_add kernel/locking/lockdep.c:1979 [inline] validate_chain kernel/locking/lockdep.c:2420 [inline] __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 down_write+0x34/0x90 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:748 [inline] __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 ext4_sync_file+0xa35/0x1420 fs/ext4/fsync.c:118 vfs_fsync_range+0x13a/0x220 fs/sync.c:197 generic_write_sync include/linux/fs.h:2750 [inline] dio_complete+0x763/0xac0 fs/direct-io.c:329 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 audit: type=1804 audit(1664117024.941:26917): pid=31522 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/693/bus" dev="sda1" ino=15606 res=1 audit: type=1804 audit(1664117025.001:26918): pid=31532 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/693/bus" dev="sda1" ino=15606 res=1 IPVS: ftp: loaded support on port[0] = 21 EXT4-fs warning (device sda1): ext4_ioctl:814: Setting inode version is not supported with metadata_csum enabled. audit: type=1804 audit(1664117025.201:26919): pid=31545 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/693/bus" dev="sda1" ino=15606 res=1 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 netlink: 84 bytes leftover after parsing attributes in process `syz-executor.4'. audit: type=1804 audit(1664117026.101:26920): pid=31663 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/694/bus" dev="sda1" ino=15663 res=1 EXT4-fs warning (device sda1): ext4_ioctl:814: Setting inode version is not supported with metadata_csum enabled. IPVS: ftp: loaded support on port[0] = 21 audit: type=1804 audit(1664117026.141:26921): pid=31664 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/694/bus" dev="sda1" ino=15663 res=1 audit: type=1804 audit(1664117026.311:26922): pid=31723 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/695/bus" dev="sda1" ino=15659 res=1 EXT4-fs warning (device sda1): ext4_ioctl:814: Setting inode version is not supported with metadata_csum enabled. audit: type=1804 audit(1664117026.341:26923): pid=31719 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir1530350834/syzkaller.2WpKyt/695/bus" dev="sda1" ino=15659 res=1 netlink: 84 bytes leftover after parsing attributes in process `syz-executor.4'. audit: type=1326 audit(1664117027.371:26924): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=31834 comm="syz-executor.2" exe="/root/syz-executor.2" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7f31c4ab2669 code=0x0 audit: type=1326 audit(1664117027.951:26925): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=31966 comm="syz-executor.2" exe="/root/syz-executor.2" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7f31c4ab2669 code=0x0 audit: type=1326 audit(1664117028.011:26926): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=31981 comm="syz-executor.1" exe="/root/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7f8bf7aad669 code=0x0 overlayfs: failed to resolve './bus': -2 batman_adv: batadv0: Interface deactivated: batadv_slave_1 batman_adv: batadv0: Removing interface: batadv_slave_1 A link change request failed with some changes committed already. Interface batadv_slave_1 may have been left with an inconsistent configuration, please check. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. A link change request failed with some changes committed already. Interface batadv_slave_1 may have been left with an inconsistent configuration, please check. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. A link change request failed with some changes committed already. Interface batadv_slave_1 may have been left with an inconsistent configuration, please check. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. overlayfs: failed to resolve './Pile0': -2 overlayfs: failed to resolve './Pile0': -2 kauditd_printk_skb: 2 callbacks suppressed audit: type=1326 audit(1664117029.942:26929): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=32167 comm="syz-executor.1" exe="/root/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7f8bf7aad669 code=0x0 overlayfs: failed to resolve './Pile0ï‹­Ô': -2 overlayfs: failed to resolve './Pile0': -2 overlayfs: failed to resolve './Pile0ï‹­Ô': -2 audit: type=1326 audit(1664117030.762:26930): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=32280 comm="syz-executor.1" exe="/root/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7f8bf7aad669 code=0x0 audit: type=1326 audit(1664117033.102:26931): auid=4294967295 uid=0 gid=0 ses=4294967295 subj==unconfined pid=32352 comm="syz-executor.1" exe="/root/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7f8bf7aad669 code=0x0