====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ kworker/1:3/4719 is trying to acquire lock: 00000000ea2c710e (&sb->s_type->i_mutex_key#28){++++}, at: inode_lock include/linux/fs.h:748 [inline] 00000000ea2c710e (&sb->s_type->i_mutex_key#28){++++}, at: __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 but task is already holding lock: 000000003f4df92d ((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 do_blockdev_direct_IO fs/direct-io.c:1285 [inline] __blockdev_direct_IO+0x5f55/0xef40 fs/direct-io.c:1419 blockdev_direct_IO include/linux/fs.h:3059 [inline] fat_direct_IO+0x1d1/0x370 fs/fat/inode.c:282 generic_file_direct_write+0x208/0x4a0 mm/filemap.c:3073 __generic_file_write_iter+0x2d0/0x610 mm/filemap.c:3252 generic_file_write_iter+0x3f8/0x730 mm/filemap.c:3323 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#28){++++}: 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 fat_file_fsync+0x73/0x200 fs/fat/file.c:198 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#28 --> (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#28); *** DEADLOCK *** 2 locks held by kworker/1:3/4719: #0: 00000000153f6240 ((wq_completion)"dio/%s"sb->s_id){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124 #1: 000000003f4df92d ((work_completion)(&dio->complete_work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128 stack backtrace: CPU: 1 PID: 4719 Comm: kworker/1:3 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: dio/loop1 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 fat_file_fsync+0x73/0x200 fs/fat/file.c:198 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 new mount options do not match the existing superblock, will be ignored BFS-fs: bfs_fill_super(): No BFS filesystem on loop4 (magic=00000000) IPVS: ftp: loaded support on port[0] = 21 BFS-fs: bfs_fill_super(): No BFS filesystem on loop4 (magic=00000000) mmap: syz-executor.5 (17199) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst. Started in network mode Own node identity 9, cluster identity 4711 32-bit node address hash set to 9 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 Started in network mode Own node identity 9, cluster identity 4711 32-bit node address hash set to 9 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 batman_adv: Cannot find parent device Left network mode batman_adv: Cannot find parent device MINIX-fs: mounting unchecked file system, running fsck is recommended batman_adv: Cannot find parent device IPVS: ftp: loaded support on port[0] = 21 MINIX-fs: mounting unchecked file system, running fsck is recommended IPVS: ftp: loaded support on port[0] = 21 MINIX-fs: mounting unchecked file system, running fsck is recommended attempt to access beyond end of device IPVS: ftp: loaded support on port[0] = 21 loop3: rw=0, want=22, limit=20 Buffer I/O error on dev loop3, logical block 10, async page read attempt to access beyond end of device loop3: rw=0, want=22, limit=20 Buffer I/O error on dev loop3, logical block 10, async page read audit: type=1800 audit(1663575491.021:33): pid=17602 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.3" name="file1" dev="loop3" ino=5 res=0 IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_UP): bridge1: link is not ready IPv6: ADDRCONF(NETDEV_UP): bridge1: link is not ready IPv6: ADDRCONF(NETDEV_UP): bridge1: link is not ready IPv6: ADDRCONF(NETDEV_UP): bridge2: link is not ready IPv6: ADDRCONF(NETDEV_UP): bridge2: link is not ready IPv6: ADDRCONF(NETDEV_UP): bridge2: link is not ready EXT4-fs (loop3): Unrecognized mount option "journal_cheÀ¾ j¨íS" or missing value IPv6: ADDRCONF(NETDEV_UP): bridge3: link is not ready MTD: Attempt to mount non-MTD device "/dev/loop0" romfs: Mounting image 'rom 5f663c08' through the block layer netlink: 28 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 'syz-executor.2': attribute type 10 has an invalid length. EXT4-fs (loop3): Unrecognized mount option "journal_cheÀ¾ j¨íS" or missing value device team0 entered promiscuous mode device team_slave_0 entered promiscuous mode device team_slave_1 entered promiscuous mode MTD: Attempt to mount non-MTD device "/dev/loop0" romfs: Mounting image 'rom 5f663c08' through the block layer batman_adv: batadv0: Adding interface: team0 EXT4-fs (loop3): Unrecognized mount option "journal_cheÀ¾ j¨íS" or missing value batman_adv: batadv0: The MTU of interface team0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Interface activated: team0 netlink: 'syz-executor.2': attribute type 10 has an invalid length. batman_adv: batadv0: Interface deactivated: team0 batman_adv: batadv0: Removing interface: team0 bridge0: port 3(team0) entered blocking state bridge0: port 3(team0) entered disabled state bridge0: port 3(team0) entered blocking state bridge0: port 3(team0) entered forwarding state netlink: 28 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 'syz-executor.2': attribute type 10 has an invalid length. bridge0: port 3(team0) entered disabled state batman_adv: batadv0: Adding interface: team0 batman_adv: batadv0: The MTU of interface team0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Interface activated: team0 MTD: Attempt to mount non-MTD device "/dev/loop0" romfs: Mounting image 'rom 5f663c08' through the block layer netlink: 28 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 'syz-executor.2': attribute type 10 has an invalid length. nbd: couldn't find device at index -1577385984 audit: type=1800 audit(1663575493.772:34): pid=18231 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.5" name="file0" dev="sda1" ino=14662 res=0 netlink: 48 bytes leftover after parsing attributes in process `syz-executor.2'. nbd: couldn't find device at index -1577385984 netlink: 48 bytes leftover after parsing attributes in process `syz-executor.2'. nbd: couldn't find device at index -1577385984 nbd: couldn't find device at index -1577385984 netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'. audit: type=1800 audit(1663575494.672:35): pid=18350 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="file0" dev="sda1" ino=14668 res=0 netlink: 48 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1800 audit(1663575495.172:36): pid=18358 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0" dev="loop0" ino=22 res=0 audit: type=1800 audit(1663575495.962:37): pid=18399 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.5" name="file0" dev="sda1" ino=14681 res=0 audit: type=1800 audit(1663575496.102:38): pid=18400 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="file0" dev="sda1" ino=14682 res=0