====================================================== WARNING: possible circular locking dependency detected 4.14.262-syzkaller #0 Not tainted ------------------------------------------------------ kworker/1:2/3511 is trying to acquire lock: (&sb->s_type->i_mutex_key#10){++++}, at: [] inode_lock include/linux/fs.h:719 [inline] (&sb->s_type->i_mutex_key#10){++++}, at: [] __generic_file_fsync+0x9e/0x190 fs/libfs.c:989 but task is already holding lock: ((&dio->complete_work)){+.+.}, at: [] process_one_work+0x6e6/0x14a0 kernel/workqueue.c:2092 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ((&dio->complete_work)){+.+.}: process_one_work+0x736/0x14a0 kernel/workqueue.c:2093 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #1 ("dio/%s"sb->s_id){+.+.}: flush_workqueue+0xfa/0x1310 kernel/workqueue.c:2625 drain_workqueue+0x177/0x3e0 kernel/workqueue.c:2790 destroy_workqueue+0x71/0x710 kernel/workqueue.c:4116 __alloc_workqueue_key+0xd50/0x1080 kernel/workqueue.c:4093 sb_init_dio_done_wq+0x34/0x80 fs/direct-io.c:624 dio_set_defer_completion fs/direct-io.c:647 [inline] get_more_blocks fs/direct-io.c:725 [inline] do_direct_IO fs/direct-io.c:1004 [inline] do_blockdev_direct_IO fs/direct-io.c:1337 [inline] __blockdev_direct_IO+0x7832/0xdcb0 fs/direct-io.c:1423 ext4_direct_IO_write fs/ext4/inode.c:3724 [inline] ext4_direct_IO+0x888/0x1b80 fs/ext4/inode.c:3865 generic_file_direct_write+0x1df/0x420 mm/filemap.c:2958 __generic_file_write_iter+0x2a2/0x590 mm/filemap.c:3137 ext4_file_write_iter+0x276/0xd20 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1780 [inline] aio_write+0x2ed/0x560 fs/aio.c:1553 io_submit_one fs/aio.c:1641 [inline] do_io_submit+0x847/0x1570 fs/aio.c:1709 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb -> #0 (&sb->s_type->i_mutex_key#10){++++}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 down_write+0x34/0x90 kernel/locking/rwsem.c:54 inode_lock include/linux/fs.h:719 [inline] __generic_file_fsync+0x9e/0x190 fs/libfs.c:989 ext4_sync_file+0x8ed/0x12c0 fs/ext4/fsync.c:118 vfs_fsync_range+0x103/0x260 fs/sync.c:196 generic_write_sync include/linux/fs.h:2684 [inline] dio_complete+0x561/0x8d0 fs/direct-io.c:330 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#10 --> "dio/%s"sb->s_id --> (&dio->complete_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((&dio->complete_work)); lock("dio/%s"sb->s_id); lock((&dio->complete_work)); lock(&sb->s_type->i_mutex_key#10); *** DEADLOCK *** 2 locks held by kworker/1:2/3511: #0: ("dio/%s"sb->s_id){+.+.}, at: [] process_one_work+0x6b0/0x14a0 kernel/workqueue.c:2088 #1: ((&dio->complete_work)){+.+.}, at: [] process_one_work+0x6e6/0x14a0 kernel/workqueue.c:2092 stack backtrace: CPU: 1 PID: 3511 Comm: kworker/1:2 Not tainted 4.14.262-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: dio/sda1 dio_aio_complete_work Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 down_write+0x34/0x90 kernel/locking/rwsem.c:54 inode_lock include/linux/fs.h:719 [inline] __generic_file_fsync+0x9e/0x190 fs/libfs.c:989 ext4_sync_file+0x8ed/0x12c0 fs/ext4/fsync.c:118 vfs_fsync_range+0x103/0x260 fs/sync.c:196 generic_write_sync include/linux/fs.h:2684 [inline] dio_complete+0x561/0x8d0 fs/direct-io.c:330 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 audit: type=1804 audit(1642562174.570:332): pid=23128 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir118320161/syzkaller.McKSTV/250/bus" dev="sda1" ino=14917 res=1 audit: type=1800 audit(1642562174.720:333): pid=23145 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14914 res=0 audit: type=1804 audit(1642562174.720:334): pid=23139 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir393482653/syzkaller.WzK3Zy/223/bus" dev="sda1" ino=14919 res=1 FAT-fs (loop1): Unrecognized mount option "1844674407370955161501777777777777777777777" or missing value audit: type=1804 audit(1642562174.910:335): pid=23145 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir258837942/syzkaller.y88upx/388/file0" dev="sda1" ino=14914 res=1 FAT-fs (loop1): Unrecognized mount option "1844674407370955161501777777777777777777777" or missing value audit: type=1800 audit(1642562175.090:336): pid=23204 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14884 res=0 audit: type=1804 audit(1642562175.090:337): pid=23204 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir258837942/syzkaller.y88upx/389/file0" dev="sda1" ino=14884 res=1 input: syz0 as /devices/virtual/input/input134 print_req_error: I/O error, dev loop0, sector 1 Buffer I/O error on dev loop0, logical block 1, async page read print_req_error: I/O error, dev loop0, sector 2 Buffer I/O error on dev loop0, logical block 2, async page read print_req_error: I/O error, dev loop0, sector 7 Buffer I/O error on dev loop0, logical block 7, async page read input: syz0 as /devices/virtual/input/input135 audit: type=1804 audit(1642562175.460:338): pid=23250 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir118320161/syzkaller.McKSTV/251/bus" dev="sda1" ino=14915 res=1 audit: type=1800 audit(1642562175.640:339): pid=23255 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="file0" dev="sda1" ino=14884 res=0 audit: type=1804 audit(1642562175.640:340): pid=23254 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir258837942/syzkaller.y88upx/390/file0" dev="sda1" ino=14884 res=1 print_req_error: I/O error, dev loop0, sector 1 Buffer I/O error on dev loop0, logical block 1, async page read print_req_error: I/O error, dev loop0, sector 2 Buffer I/O error on dev loop0, logical block 2, async page read print_req_error: I/O error, dev loop0, sector 7 Buffer I/O error on dev loop0, logical block 7, async page read input: syz0 as /devices/virtual/input/input136 EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs error (device loop5): ext4_mb_generate_buddy:754: group 0, block bitmap and bg descriptor inconsistent: 50 vs 25 free clusters input: syz0 as /devices/virtual/input/input137 EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue ISO 9660 Extensions: Microsoft Joliet Level 3 IPVS: ftp: loaded support on port[0] = 21 EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue overlayfs: fs on 'file0' does not support file handles, falling back to index=off. EXT4-fs error (device loop5): ext4_mb_generate_buddy:754: group 0, block bitmap and bg descriptor inconsistent: 50 vs 25 free clusters overlayfs: fs on './file0' does not support file handles, falling back to index=off. overlayfs: fs on 'file0' does not support file handles, falling back to index=off. overlayfs: fs on './file0' does not support file handles, falling back to index=off. ISO 9660 Extensions: Microsoft Joliet Level 3 input: syz0 as /devices/virtual/input/input138 ISO 9660 Extensions: Microsoft Joliet Level 3 overlayfs: fs on 'file0' does not support file handles, falling back to index=off. overlayfs: fs on './file0' does not support file handles, falling back to index=off. overlayfs: fs on 'file0' does not support file handles, falling back to index=off. overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory input: syz0 as /devices/virtual/input/input139 overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory kvm: emulating exchange as write overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory overlayfs: 'file0' not a directory input: syz0 as /devices/virtual/input/input140 ISO 9660 Extensions: Microsoft Joliet Level 3 ISO 9660 Extensions: Microsoft Joliet Level 3 ip_tables: iptables: counters copy to user failed while replacing table input: syz0 as /devices/virtual/input/input141 input: syz0 as /devices/virtual/input/input142 ip_tables: iptables: counters copy to user failed while replacing table ISO 9660 Extensions: Microsoft Joliet Level 3 input: syz0 as /devices/virtual/input/input143 ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table FAT-fs (loop0): Unrecognized mount option "allow_utime=00000000nO¶¼Å(è·<Í…$000000000000377" or missing value FAT-fs (loop0): Unrecognized mount option "allow_utime=00000000nO¶¼Å(è·<Í…$000000000000377" or missing value print_req_error: I/O error, dev loop1, sector 0 print_req_error: I/O error, dev loop1, sector 24 BFS-fs: bfs_fill_super(): No BFS filesystem on loop1 (magic=adface00) ISO 9660 Extensions: Microsoft Joliet Level 3 input: syz0 as /devices/virtual/input/input144 FAT-fs (loop0): Unrecognized mount option "allow_utime=00000000nO¶¼Å(è·<Í…$000000000000377" or missing value input: syz0 as /devices/virtual/input/input145 print_req_error: I/O error, dev loop1, sector 0 BFS-fs: bfs_fill_super(): No BFS filesystem on loop1 (magic=adface00) ISO 9660 Extensions: Microsoft Joliet Level 3 F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x20100000) F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop0): Unable to read 2th superblock F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x20100000) F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock print_req_error: I/O error, dev loop1, sector 0 F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x20100000) F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop0): Unable to read 2th superblock input: syz0 as /devices/virtual/input/input146 print_req_error: I/O error, dev loop0, sector 8 Buffer I/O error on dev loop0, logical block 1, async page read IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready ISO 9660 Extensions: Microsoft Joliet Level 3 input: syz0 as /devices/virtual/input/input147 IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready ISO 9660 Extensions: Microsoft Joliet Level 3 IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready input: syz0 as /devices/virtual/input/input148 ISO 9660 Extensions: Microsoft Joliet Level 3 IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready input: syz0 as /devices/virtual/input/input149 EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue kauditd_printk_skb: 1 callbacks suppressed audit: type=1804 audit(1642562181.931:342): pid=24106 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir258837942/syzkaller.y88upx/412/file0/file1" dev="loop0" ino=17 res=1 EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue input: syz0 as /devices/virtual/input/input150 input: syz0 as /devices/virtual/input/input151 EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue input: syz0 as /devices/virtual/input/input152 audit: type=1800 audit(1642562183.381:343): pid=24347 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="bus" dev="sda1" ino=14065 res=0 audit: type=1804 audit(1642562183.411:344): pid=24347 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir258837942/syzkaller.y88upx/415/bus" dev="sda1" ino=14065 res=1 audit: type=1804 audit(1642562184.181:345): pid=24367 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir393482653/syzkaller.WzK3Zy/241/file0/file1" dev="loop5" ino=17 res=1 audit: type=1800 audit(1642562184.321:346): pid=24389 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.0" name="bus" dev="sda1" ino=14952 res=0 input: syz0 as /devices/virtual/input/input153 input: syz0 as /devices/virtual/input/input154 audit: type=1804 audit(1642562184.341:347): pid=24379 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir258837942/syzkaller.y88upx/416/bus" dev="sda1" ino=14952 res=1