====================================================== WARNING: possible circular locking dependency detected 4.14.218-syzkaller #0 Not tainted ------------------------------------------------------ kworker/1:1/23 is trying to acquire lock: (&sb->s_type->i_mutex_key#10){+.+.}, at: [] inode_lock syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:719 [inline] (&sb->s_type->i_mutex_key#10){+.+.}, at: [] __generic_file_fsync+0x9e/0x190 syzkaller/managers/linux-4-14/kernel/fs/libfs.c:989 but task is already holding lock: ((&dio->complete_work)){+.+.}, at: [] process_one_work+0x6e6/0x14a0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2091 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 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2092 worker_thread+0x5cc/0xff0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2250 kthread+0x30d/0x420 syzkaller/managers/linux-4-14/kernel/kernel/kthread.c:232 ret_from_fork+0x24/0x30 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/entry_64.S:404 -> #1 ("dio/%s"sb->s_id){+.+.}: flush_workqueue+0xfa/0x1310 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2624 drain_workqueue+0x177/0x3e0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2789 destroy_workqueue+0x71/0x710 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:4109 sb_init_dio_done_wq+0x61/0x80 syzkaller/managers/linux-4-14/kernel/fs/direct-io.c:635 do_blockdev_direct_IO syzkaller/managers/linux-4-14/kernel/fs/direct-io.c:1286 [inline] __blockdev_direct_IO+0x3dea/0xdc60 syzkaller/managers/linux-4-14/kernel/fs/direct-io.c:1422 ext4_direct_IO_write syzkaller/managers/linux-4-14/kernel/fs/ext4/inode.c:3725 [inline] ext4_direct_IO+0x888/0x1b80 syzkaller/managers/linux-4-14/kernel/fs/ext4/inode.c:3866 generic_file_direct_write+0x1df/0x420 syzkaller/managers/linux-4-14/kernel/mm/filemap.c:2958 __generic_file_write_iter+0x2a2/0x590 syzkaller/managers/linux-4-14/kernel/mm/filemap.c:3137 ext4_file_write_iter+0x276/0xd20 syzkaller/managers/linux-4-14/kernel/fs/ext4/file.c:270 call_write_iter syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:1778 [inline] aio_write+0x2ed/0x560 syzkaller/managers/linux-4-14/kernel/fs/aio.c:1553 io_submit_one syzkaller/managers/linux-4-14/kernel/fs/aio.c:1641 [inline] do_io_submit+0x847/0x1570 syzkaller/managers/linux-4-14/kernel/fs/aio.c:1709 do_syscall_64+0x1d5/0x640 syzkaller/managers/linux-4-14/kernel/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 syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:3998 down_write+0x34/0x90 syzkaller/managers/linux-4-14/kernel/kernel/locking/rwsem.c:54 inode_lock syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:719 [inline] __generic_file_fsync+0x9e/0x190 syzkaller/managers/linux-4-14/kernel/fs/libfs.c:989 ext4_sync_file+0x8ed/0x12c0 syzkaller/managers/linux-4-14/kernel/fs/ext4/fsync.c:118 vfs_fsync_range+0x103/0x260 syzkaller/managers/linux-4-14/kernel/fs/sync.c:196 generic_write_sync syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:2682 [inline] dio_complete+0x561/0x8d0 syzkaller/managers/linux-4-14/kernel/fs/direct-io.c:330 process_one_work+0x793/0x14a0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2250 kthread+0x30d/0x420 syzkaller/managers/linux-4-14/kernel/kernel/kthread.c:232 ret_from_fork+0x24/0x30 syzkaller/managers/linux-4-14/kernel/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:1/23: #0: ("dio/%s"sb->s_id){+.+.}, at: [] process_one_work+0x6b0/0x14a0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2087 #1: ((&dio->complete_work)){+.+.}, at: [] process_one_work+0x6e6/0x14a0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2091 stack backtrace: CPU: 1 PID: 23 Comm: kworker/1:1 Not tainted 4.14.218-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 syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:1258 check_prev_add syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:1905 [inline] check_prevs_add syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:2022 [inline] validate_chain syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:3998 down_write+0x34/0x90 syzkaller/managers/linux-4-14/kernel/kernel/locking/rwsem.c:54 inode_lock syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:719 [inline] __generic_file_fsync+0x9e/0x190 syzkaller/managers/linux-4-14/kernel/fs/libfs.c:989 ext4_sync_file+0x8ed/0x12c0 syzkaller/managers/linux-4-14/kernel/fs/ext4/fsync.c:118 vfs_fsync_range+0x103/0x260 syzkaller/managers/linux-4-14/kernel/fs/sync.c:196 generic_write_sync syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:2682 [inline] dio_complete+0x561/0x8d0 syzkaller/managers/linux-4-14/kernel/fs/direct-io.c:330 process_one_work+0x793/0x14a0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 syzkaller/managers/linux-4-14/kernel/kernel/workqueue.c:2250 kthread+0x30d/0x420 syzkaller/managers/linux-4-14/kernel/kernel/kthread.c:232 ret_from_fork+0x24/0x30 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/entry_64.S:404 tmpfs: Bad value '00000000000000060928' for mount option 'uid' ntfs: (device loop1): map_mft_record_page(): Mft record 0x1 is corrupt. Run chkdsk. overlayfs: fs on '.' does not support file handles, falling back to index=off. overlayfs: filesystem on './bus' not supported as upperdir tmpfs: Bad value '00000000000000060928' for mount option 'uid' ntfs: volume version 3.1. overlayfs: 'file0' not a directory L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details. ntfs: volume version 3.1. ip6_tables: ip6tables: counters copy to user failed while replacing table ip6_tables: ip6tables: counters copy to user failed while replacing table syz-executor.0 (10089) used greatest stack depth: 24248 bytes left __ntfs_error: 26 callbacks suppressed ntfs: (device loop1): map_mft_record_page(): Mft record 0x1 is corrupt. Run chkdsk. ntfs: (device loop1): map_mft_record(): Failed with error code 5. ntfs: (device loop1): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x1 as bad. Run chkdsk. ntfs: (device loop1): load_system_files(): Failed to load $MFTMirr. Mounting read-only. Run ntfsfix and/or chkdsk. ntfs: volume version 3.1. ntfs: (device loop1): map_mft_record_page(): Mft record 0x2 is corrupt. Run chkdsk. ntfs: (device loop1): map_mft_record(): Failed with error code 5. ntfs: (device loop1): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x2 as bad. Run chkdsk. ntfs: (device loop1): load_system_files(): Failed to load $LogFile. Will not be able to remount read-write. Mount in Windows. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.4'. gfs2: invalid mount option: onõYGÆ%9Á.ɸÌÏüš†úýsÑ·Ã#jÊ™×éü gfs2: can't parse mount arguments ntfs: (device loop1): map_mft_record_page(): Mft record 0x1 is corrupt. Run chkdsk. ntfs: (device loop1): map_mft_record(): Failed with error code 5. gfs2: invalid mount option: onõYGÆ%9Á.ɸÌÏüš†úýsÑ·Ã#jÊ™×éü gfs2: can't parse mount arguments ntfs: volume version 3.1. EXT4-fs (loop3): mounted filesystem without journal. Opts: ,errors=continue ntfs: volume version 3.1. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.3'. REISERFS (device loop3): found reiserfs format "3.5" with standard journal REISERFS (device loop3): using ordered data mode reiserfs: using flush barriers REISERFS (device loop3): journal params: device loop3, size 0, journal first block 19, max trans len 1024, max batch 900, max commit age 30, max trans age 30 REISERFS warning (device loop3): journal-2004 journal_init: Journal cnode memory allocation failed (0 bytes). Journal is too large for available memory. Usually this is due to a journal that is too large. REISERFS warning (device loop3): sh-2022 reiserfs_fill_super: unable to initialize journal space netlink: 32 bytes leftover after parsing attributes in process `syz-executor.0'. 9pnet: p9_fd_create_tcp (10271): problem connecting socket to 127.0.0.1 ntfs: volume version 3.1. dccp_v6_rcv: dropped packet with invalid checksum dccp_v6_rcv: dropped packet with invalid checksum REISERFS (device loop3): found reiserfs format "3.5" with standard journal REISERFS (device loop3): using ordered data mode reiserfs: using flush barriers 9pnet: p9_fd_create_tcp (10271): problem connecting socket to 127.0.0.1 REISERFS (device loop3): journal params: device loop3, size 0, journal first block 19, max trans len 1024, max batch 900, max commit age 30, max trans age 30 dccp_v6_rcv: dropped packet with invalid checksum REISERFS warning (device loop3): journal-2004 journal_init: Journal cnode memory allocation failed (0 bytes). Journal is too large for available memory. Usually this is due to a journal that is too large. REISERFS warning (device loop3): sh-2022 reiserfs_fill_super: unable to initialize journal space tmpfs: Bad mount option hugêw 8U¿  tmpfs: Bad mount option hugêw 8U¿  ntfs: volume version 3.1. MINIX-fs: mounting unchecked file system, running fsck is recommended minix_free_inode: bit 5 already cleared ntfs: volume version 3.1. netlink: 32 bytes leftover after parsing attributes in process `syz-executor.0'. MINIX-fs: mounting unchecked file system, running fsck is recommended minix_free_inode: bit 5 already cleared MINIX-fs: mounting unchecked file system, running fsck is recommended netlink: 24 bytes leftover after parsing attributes in process `syz-executor.5'. MINIX-fs: mounting unchecked file system, running fsck is recommended minix_free_inode: bit 5 already cleared MINIX-fs: mounting unchecked file system, running fsck is recommended minix_free_inode: bit 5 already cleared EXT4-fs error (device sda1): mb_free_blocks:1464: group 6, inode 15840: block 227328:freeing already freed block (bit 30720); block bitmap corrupt. EXT4-fs error (device sda1): ext4_mb_generate_buddy:754: group 6, block bitmap and bg descriptor inconsistent: 31552 vs 31553 free clusters EXT4-fs (sda1): pa ffff888094f41dc0: logic 0, phys. 227328, len 32 EXT4-fs error (device sda1): ext4_mb_release_inode_pa:3891: group 6, free 16, pa_free 15 MINIX-fs: mounting unchecked file system, running fsck is recommended minix_free_inode: bit 5 already cleared MINIX-fs: mounting unchecked file system, running fsck is recommended minix_free_inode: bit 5 already cleared ntfs: volume version 3.1. EXT4-fs error (device sda1): mb_free_blocks:1464: group 8, inode 15832: block 268288:freeing already freed block (bit 6144); block bitmap corrupt. EXT4-fs error (device sda1): ext4_mb_generate_buddy:754: group 8, block bitmap and bg descriptor inconsistent: 32736 vs 32737 free clusters EXT4-fs (sda1): pa ffff88804ff82000: logic 0, phys. 268288, len 32 EXT4-fs error (device sda1): ext4_mb_release_inode_pa:3891: group 8, free 16, pa_free 15 MINIX-fs: mounting unchecked file system, running fsck is recommended MINIX-fs: mounting unchecked file system, running fsck is recommended ntfs: volume version 3.1. print_req_error: I/O error, dev loop3, sector 0 MINIX-fs: mounting unchecked file system, running fsck is recommended hfsplus: unable to parse mount options ntfs: volume version 3.1. hfsplus: unable to parse mount options MINIX-fs: mounting unchecked file system, running fsck is recommended hfsplus: unable to parse mount options minix_free_inode: bit 5 already cleared __ntfs_error: 66 callbacks suppressed ntfs: (device loop1): map_mft_record_page(): Mft record 0x1 is corrupt. Run chkdsk. ntfs: (device loop1): map_mft_record(): Failed with error code 5. ntfs: (device loop1): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x1 as bad. Run chkdsk. hfsplus: unable to parse mount options MINIX-fs: mounting unchecked file system, running fsck is recommended ntfs: (device loop1): load_system_files(): Failed to load $MFTMirr. Mounting read-only. Run ntfsfix and/or chkdsk. hfsplus: unable to parse mount options ntfs: volume version 3.1. ntfs: (device loop1): map_mft_record_page(): Mft record 0x2 is corrupt. Run chkdsk. ntfs: (device loop1): map_mft_record(): Failed with error code 5. audit: type=1804 audit(1613503335.662:26): pid=10646 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir861339859/syzkaller.Mw8xoZ/21/file1/bus" dev="sda1" ino=15850 res=1 ntfs: (device loop1): ntfs_read_locked_inode(): Failed with error code -5. Marking corrupt inode 0x2 as bad. Run chkdsk. audit: type=1804 audit(1613503335.692:27): pid=10645 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir861339859/syzkaller.Mw8xoZ/21/file1/bus" dev="sda1" ino=15850 res=1 ntfs: (device loop1): load_system_files(): Failed to load $LogFile. Will not be able to remount read-write. Mount in Windows. hfsplus: unable to parse mount options MINIX-fs: mounting unchecked file system, running fsck is recommended netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. hfsplus: unable to parse mount options netlink: 72 bytes leftover after parsing attributes in process `syz-executor.4'. block nbd2: Receive control failed (result -107) ntfs: volume version 3.1. block nbd2: shutting down sockets netlink: 64 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 64 bytes leftover after parsing attributes in process `syz-executor.4'. hfsplus: unable to parse mount options netlink: 72 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 72 bytes leftover after parsing attributes in process `syz-executor.4'. hfsplus: unable to parse mount options EXT4-fs (loop2): mounted filesystem without journal. Opts: ,errors=continue MINIX-fs: mounting unchecked file system, running fsck is recommended EXT4-fs (loop2): re-mounted. Opts: (null) ntfs: volume version 3.1. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. EXT4-fs (loop2): mounted filesystem without journal. Opts: ,errors=continue netlink: 72 bytes leftover after parsing attributes in process `syz-executor.4'. EXT4-fs (loop2): re-mounted. Opts: (null) ntfs: volume version 3.1. netlink: 64 bytes leftover after parsing attributes in process `syz-executor.4'. ntfs: volume version 3.1. ntfs: volume version 3.1. hfsplus: unable to parse mount options hfsplus: unable to parse mount options print_req_error: I/O error, dev loop3, sector 0 hfsplus: unable to parse mount options ntfs: volume version 3.1. print_req_error: I/O error, dev loop3, sector 0 ntfs: volume version 3.1. ntfs: volume version 3.1. hfsplus: unable to find HFS+ superblock hfsplus: unable to find HFS+ superblock hfsplus: unable to find HFS+ superblock ntfs: volume version 3.1. Unable to read inode block MINIX-fs: get root inode failed hfsplus: unable to find HFS+ superblock