====================================================== WARNING: possible circular locking dependency detected 4.14.277-syzkaller #0 Not tainted ------------------------------------------------------ kworker/0:0/3 is trying to acquire lock: (&sb->s_type->i_mutex_key#21){+.+.}, at: [] inode_lock include/linux/fs.h:719 [inline] (&sb->s_type->i_mutex_key#21){+.+.}, 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 do_blockdev_direct_IO fs/direct-io.c:1287 [inline] __blockdev_direct_IO+0x3df1/0xdcb0 fs/direct-io.c:1423 blockdev_direct_IO include/linux/fs.h:2994 [inline] fat_direct_IO+0x19b/0x320 fs/fat/inode.c:275 generic_file_direct_write+0x1df/0x420 mm/filemap.c:2958 __generic_file_write_iter+0x2a2/0x590 mm/filemap.c:3137 generic_file_write_iter+0x36f/0x650 mm/filemap.c:3208 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#21){+.+.}: 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 fat_file_fsync+0x73/0x1f0 fs/fat/file.c:165 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#21 --> "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#21); *** DEADLOCK *** 2 locks held by kworker/0:0/3: #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: 0 PID: 3 Comm: kworker/0:0 Not tainted 4.14.277-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: dio/loop5 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 fat_file_fsync+0x73/0x1f0 fs/fat/file.c:165 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 kvm: vcpu 0: requested 128 ns lapic timer period limited to 500000 ns kvm: vcpu 0: requested 128 ns lapic timer period limited to 500000 ns mmap: syz-executor.0 (11898): VmData 37515264 exceed data ulimit 8. Update limits or use boot option ignore_rlimit_data. overlayfs: fs on 'file0' does not support file handles, falling back to index=off. Zero length message leads to an empty skb 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: 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. UDF-fs: error (device loop3): udf_process_sequence: Block 99 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop3): udf_process_sequence: Block 1984 of volume descriptor sequence is corrupted or we could not read it kauditd_printk_skb: 14 callbacks suppressed audit: type=1800 audit(1651458315.311:75): pid=12052 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="bus" dev="sda1" ino=14177 res=0 UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop3): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: warning (device loop3): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed print_req_error: I/O error, dev loop0, sector 0 UDF-fs: warning (device loop3): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 4096 failed UDF-fs: error (device loop3): udf_process_sequence: Block 99 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop3): udf_process_sequence: Block 1984 of volume descriptor sequence is corrupted or we could not read it UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop3): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: warning (device loop3): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: warning (device loop3): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 4096 failed audit: type=1800 audit(1651458316.062:76): pid=12112 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="bus" dev="sda1" ino=14120 res=0 audit: type=1800 audit(1651458316.242:77): pid=12133 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="bus" dev="sda1" ino=14203 res=0 UDF-fs: error (device loop3): udf_process_sequence: Block 99 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop3): udf_process_sequence: Block 1984 of volume descriptor sequence is corrupted or we could not read it audit: type=1800 audit(1651458316.382:78): pid=12148 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="bus" dev="sda1" ino=14201 res=0 UDF-fs: Scanning with blocksize 512 failed UDF-fs: warning (device loop3): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed audit: type=1800 audit(1651458316.412:79): pid=12172 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="bus" dev="sda1" ino=14208 res=0 UDF-fs: warning (device loop3): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: warning (device loop3): udf_load_vrs: No VRS found UDF-fs: Scanning with blocksize 4096 failed audit: type=1800 audit(1651458316.982:80): pid=12263 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.1" name="bus" dev="sda1" ino=14203 res=0 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: fs on './file0' does not support file handles, falling back to index=off. ADFS-fs: unrecognised mount option "uid=" or missing value 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: failed to clone lowerpath VPS: Can't find an adfs filesystem on dev loop5. overlayfs: failed to clone lowerpath FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 12506 Comm: syz-executor.3 Not tainted 4.14.277-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0x10a/0x149 lib/fault-inject.c:149 should_failslab+0xd6/0x130 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3376 [inline] __do_kmalloc mm/slab.c:3718 [inline] __kmalloc+0x2c1/0x400 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] SYSC_memfd_create mm/shmem.c:3754 [inline] SyS_memfd_create+0xbc/0x3c0 mm/shmem.c:3724 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f4fca3340e9 RSP: 002b:00007f4fc8ca8f28 EFLAGS: 00000246 ORIG_RAX: 000000000000013f RAX: ffffffffffffffda RBX: 0000000020001140 RCX: 00007f4fca3340e9 RDX: 00007f4fc8ca8fe0 RSI: 0000000000000000 RDI: 00007f4fca38d1ee RBP: 0000000000000000 R08: 00007f4fc8ca8fd8 R09: 00007f4fc8ca91d0 R10: 00007f4fc8ca8fdc R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000040 R14: 0000000000000000 R15: 0000000020000080 audit: type=1804 audit(1651458319.902:81): pid=12571 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir306553143/syzkaller.J1zEYZ/51/bus" dev="sda1" ino=14199 res=1 audit: type=1800 audit(1651458319.932:82): pid=12571 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14199 res=0 EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue ADFS-fs: unrecognised mount option "00000000000000000003" or missing value EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue audit: type=1804 audit(1651458320.822:83): pid=12646 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir306553143/syzkaller.J1zEYZ/52/bus" dev="sda1" ino=14199 res=1 ADFS-fs: unrecognised mount option "00000000000000000003" or missing value audit: type=1800 audit(1651458320.822:84): pid=12646 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14199 res=0 ADFS-fs: unrecognised mount option "00000000000000000003" or missing value audit: type=1804 audit(1651458320.822:85): pid=12646 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir306553143/syzkaller.J1zEYZ/52/bus" dev="sda1" ino=14199 res=1 VPS: Can't find an adfs filesystem on dev loop3. audit: type=1800 audit(1651458320.822:86): pid=12646 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14199 res=0 VPS: Can't find an adfs filesystem on dev loop3. audit: type=1804 audit(1651458320.822:87): pid=12646 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir306553143/syzkaller.J1zEYZ/52/bus" dev="sda1" ino=14199 res=1 audit: type=1800 audit(1651458320.822:88): pid=12646 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.2" name="bus" dev="sda1" ino=14199 res=0 VPS: Can't find an adfs filesystem on dev loop3.