audit: type=1804 audit(1620277860.137:169): pid=21749 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.2" name="/root/syzkaller-testdir987587569/syzkaller.I05MXt/173/file0" dev="sda1" ino=14468 res=1 ====================================================== WARNING: possible circular locking dependency detected 4.14.232-syzkaller #0 Not tainted ------------------------------------------------------ kworker/1:3/8675 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: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 kernel/workqueue.c:2092 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 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:2624 drain_workqueue+0x177/0x3e0 kernel/workqueue.c:2789 destroy_workqueue+0x71/0x710 kernel/workqueue.c:4109 __alloc_workqueue_key+0xd50/0x1080 kernel/workqueue.c:4086 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 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+0x7c5/0xd20 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1778 [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:2682 [inline] dio_complete+0x561/0x8d0 fs/direct-io.c:330 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 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:3/8675: #0: ("dio/%s"sb->s_id){+.+.}, at: [] process_one_work+0x6b0/0x14a0 kernel/workqueue.c:2087 #1: ((&dio->complete_work)){+.+.}, at: [] process_one_work+0x6e6/0x14a0 kernel/workqueue.c:2091 stack backtrace: CPU: 1 PID: 8675 Comm: kworker/1:3 Not tainted 4.14.232-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:2682 [inline] dio_complete+0x561/0x8d0 fs/direct-io.c:330 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 IPVS: ftp: loaded support on port[0] = 21 netlink: 28 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.5'. EXT4-fs (loop5): Unrecognized mount option "" or missing value EXT4-fs (loop5): Unrecognized mount option "" or missing value overlayfs: workdir and upperdir must reside under the same mount netlink: 14 bytes leftover after parsing attributes in process `syz-executor.0'. bridge0: port 2(bridge_slave_1) entered disabled state bridge0: port 1(bridge_slave_0) entered disabled state device bridge0 entered promiscuous mode netlink: 14 bytes leftover after parsing attributes in process `syz-executor.0'. bridge0: port 2(bridge_slave_1) entered blocking state bridge0: port 2(bridge_slave_1) entered forwarding state bridge0: port 1(bridge_slave_0) entered blocking state bridge0: port 1(bridge_slave_0) entered forwarding state device bridge0 left promiscuous mode IPv6: ADDRCONF(NETDEV_UP): bridge0: link is not ready netlink: 14 bytes leftover after parsing attributes in process `syz-executor.0'. bridge0: port 2(bridge_slave_1) entered disabled state bridge0: port 1(bridge_slave_0) entered disabled state ptrace attach of "/root/syz-executor.2"[21984] was attempted by "/root/syz-executor.2"[21987] device bridge0 entered promiscuous mode (syz-executor.0,22136,1):ocfs2_parse_options:1484 ERROR: Unrecognized mount option "" or missing value (syz-executor.0,22136,1):ocfs2_fill_super:1217 ERROR: status = -22 overlayfs: failed to resolve './file1': -2 tmpfs: No value for mount option '00000000000000060928' (syz-executor.0,22154,1):ocfs2_parse_options:1484 ERROR: Unrecognized mount option "" or missing value overlayfs: 'file0' not a directory audit: type=1804 audit(1620277866.437:170): pid=22137 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir213422236/syzkaller.255UdG/151/file0/file0" dev="ramfs" ino=57919 res=1 (syz-executor.0,22154,1):ocfs2_fill_super:1217 ERROR: status = -22 overlayfs: failed to resolve './file1': -2 tmpfs: No value for mount option '00000000000000060928' EXT4-fs (loop5): VFS: Can't find ext4 filesystem EXT4-fs (loop5): VFS: Can't find ext4 filesystem vivid-002: ================= START STATUS ================= vivid-002: Radio HW Seek Mode: Bounded vivid-002: Radio Programmable HW Seek: false vivid-002: RDS Rx I/O Mode: Block I/O vivid-002: Generate RBDS Instead of RDS: false vivid-002: RDS Reception: true vivid-002: RDS Program Type: 0 inactive vivid-002: RDS PS Name: inactive vivid-002: RDS Radio Text: inactive vivid-002: RDS Traffic Announcement: false inactive vivid-002: RDS Traffic Program: false inactive vivid-002: RDS Music: false inactive vivid-002: ================== END STATUS ================== overlayfs: unrecognized mount option "nfs_export=off" or missing value overlayfs: unrecognized mount option "nfs_export=off" or missing value vivid-002: ================= START STATUS ================= vivid-002: Radio HW Seek Mode: Bounded vivid-002: Radio Programmable HW Seek: false vivid-002: RDS Rx I/O Mode: Block I/O vivid-002: Generate RBDS Instead of RDS: false vivid-002: RDS Reception: true vivid-002: RDS Program Type: 0 inactive vivid-002: RDS PS Name: inactive vivid-002: RDS Radio Text: inactive vivid-002: RDS Traffic Announcement: false inactive vivid-002: RDS Traffic Program: false inactive vivid-002: RDS Music: false inactive vivid-002: ================== END STATUS ================== overlayfs: unrecognized mount option "nfs_export=off" or missing value IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready 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 overlayfs: unrecognized mount option "nfs_export=off" or missing value audit: type=1804 audit(1620277868.117:171): pid=22350 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir987587569/syzkaller.I05MXt/187/bus" dev="sda1" ino=14144 res=1 overlayfs: unrecognized mount option "nfs_export=off" or missing value audit: type=1804 audit(1620277869.177:172): pid=22437 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.2" name="/root/syzkaller-testdir987587569/syzkaller.I05MXt/188/bus" dev="sda1" ino=14213 res=1 overlayfs: unrecognized mount option "nfs_export=off" or missing value overlayfs: unrecognized mount option "nfs_export=off" or missing value overlayfs: unrecognized mount option "nfs_export=off" or missing value overlayfs: unrecognized mount option "nfs_export=off" or missing value