====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u4:6/9390 is trying to acquire lock: 000000008ac421c2 (&tree->tree_lock#2){+.+.}, at: hfs_find_init+0x1c5/0x230 fs/hfs/bfind.c:30 but task is already holding lock: 0000000037213ab9 ((work_completion)(&(&wb->dwork)->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: -> #8 ((work_completion)(&(&wb->dwork)->work)){+.+.}: wb_shutdown+0x172/0x210 mm/backing-dev.c:374 bdi_unregister+0x169/0x610 mm/backing-dev.c:946 del_gendisk+0x7f6/0xa80 block/genhd.c:788 loop_remove drivers/block/loop.c:2066 [inline] loop_control_ioctl drivers/block/loop.c:2165 [inline] loop_control_ioctl+0x3b1/0x480 drivers/block/loop.c:2131 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #7 (loop_ctl_mutex){+.+.}: lo_open+0x19/0xd0 drivers/block/loop.c:1771 __blkdev_get+0x372/0x1480 fs/block_dev.c:1494 blkdev_get+0xb0/0x940 fs/block_dev.c:1627 blkdev_open+0x202/0x290 fs/block_dev.c:1788 do_dentry_open+0x4aa/0x1160 fs/open.c:796 do_last fs/namei.c:3421 [inline] path_openat+0x793/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #6 (&bdev->bd_mutex){+.+.}: blkdev_put+0x30/0x520 fs/block_dev.c:1839 btrfs_close_bdev fs/btrfs/volumes.c:1033 [inline] btrfs_close_one_device fs/btrfs/volumes.c:1057 [inline] close_fs_devices.part.0+0x24d/0x8e0 fs/btrfs/volumes.c:1085 close_fs_devices fs/btrfs/volumes.c:1117 [inline] btrfs_close_devices+0x95/0x1f0 fs/btrfs/volumes.c:1103 open_ctree+0x26b/0x61e0 fs/btrfs/disk-io.c:3326 btrfs_fill_super fs/btrfs/super.c:1209 [inline] btrfs_mount_root+0x12e5/0x1830 fs/btrfs/super.c:1613 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount+0x3c/0x60 fs/namespace.c:951 btrfs_mount+0x23a/0xaa0 fs/btrfs/super.c:1681 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #5 (&fs_devs->device_list_mutex){+.+.}: btrfs_run_dev_stats+0xbb/0xa80 fs/btrfs/volumes.c:7111 commit_cowonly_roots+0x1ce/0xc30 fs/btrfs/transaction.c:1172 btrfs_commit_transaction+0x94a/0x2480 fs/btrfs/transaction.c:2218 transaction_kthread+0x385/0x490 fs/btrfs/disk-io.c:1794 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 -> #4 (&fs_info->tree_log_mutex){+.+.}: btrfs_commit_transaction+0x8c2/0x2480 fs/btrfs/transaction.c:2176 transaction_kthread+0x385/0x490 fs/btrfs/disk-io.c:1794 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 -> #3 (&fs_info->reloc_mutex){+.+.}: btrfs_record_root_in_trans+0x122/0x190 fs/btrfs/transaction.c:394 start_transaction+0x234/0xf90 fs/btrfs/transaction.c:586 btrfs_create+0x105/0x670 fs/btrfs/inode.c:6683 lookup_open+0x893/0x1a20 fs/namei.c:3235 do_last fs/namei.c:3327 [inline] path_openat+0x1094/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #2 (sb_internal#2){.+.+}: sb_start_intwrite include/linux/fs.h:1626 [inline] start_transaction+0xa37/0xf90 fs/btrfs/transaction.c:528 btrfs_dirty_inode+0xe3/0x210 fs/btrfs/inode.c:6165 btrfs_update_time+0x33b/0x3d0 fs/btrfs/inode.c:6207 update_time fs/inode.c:1675 [inline] touch_atime+0x23c/0x2a0 fs/inode.c:1746 file_accessed include/linux/fs.h:2123 [inline] btrfs_file_mmap+0x11b/0x160 fs/btrfs/file.c:2274 call_mmap include/linux/fs.h:1826 [inline] mmap_region+0xc94/0x16b0 mm/mmap.c:1757 do_mmap+0x8e8/0x1080 mm/mmap.c:1530 do_mmap_pgoff include/linux/mm.h:2329 [inline] vm_mmap_pgoff+0x197/0x200 mm/util.c:357 ksys_mmap_pgoff+0x298/0x5a0 mm/mmap.c:1580 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&mm->mmap_sem){++++}: _copy_to_user+0x29/0x100 lib/usercopy.c:25 copy_to_user include/linux/uaccess.h:155 [inline] filldir64+0x26e/0x430 fs/readdir.c:324 dir_emit_dot include/linux/fs.h:3432 [inline] hfs_readdir+0x352/0xc50 fs/hfs/dir.c:72 iterate_dir+0x473/0x5c0 fs/readdir.c:51 ksys_getdents64+0x175/0x2b0 fs/readdir.c:357 __do_sys_getdents64 fs/readdir.c:376 [inline] __se_sys_getdents64 fs/readdir.c:373 [inline] __x64_sys_getdents64+0x6f/0xb0 fs/readdir.c:373 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&tree->tree_lock#2){+.+.}: __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 hfs_find_init+0x1c5/0x230 fs/hfs/bfind.c:30 hfs_write_inode+0x221/0x930 fs/hfs/inode.c:452 write_inode fs/fs-writeback.c:1244 [inline] __writeback_single_inode+0x733/0x11d0 fs/fs-writeback.c:1442 writeback_sb_inodes+0x537/0xef0 fs/fs-writeback.c:1647 wb_writeback+0x28d/0xcc0 fs/fs-writeback.c:1820 wb_do_writeback fs/fs-writeback.c:1965 [inline] wb_workfn+0x29b/0x1250 fs/fs-writeback.c:2006 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: &tree->tree_lock#2 --> loop_ctl_mutex --> (work_completion)(&(&wb->dwork)->work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&(&wb->dwork)->work)); lock(loop_ctl_mutex); lock((work_completion)(&(&wb->dwork)->work)); lock(&tree->tree_lock#2); *** DEADLOCK *** 2 locks held by kworker/u4:6/9390: #0: 00000000b97fd26e ((wq_completion)"writeback"){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124 #1: 0000000037213ab9 ((work_completion)(&(&wb->dwork)->work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128 stack backtrace: CPU: 0 PID: 9390 Comm: kworker/u4:6 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: writeback wb_workfn (flush-7:0) 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 __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 hfs_find_init+0x1c5/0x230 fs/hfs/bfind.c:30 hfs_write_inode+0x221/0x930 fs/hfs/inode.c:452 write_inode fs/fs-writeback.c:1244 [inline] __writeback_single_inode+0x733/0x11d0 fs/fs-writeback.c:1442 writeback_sb_inodes+0x537/0xef0 fs/fs-writeback.c:1647 wb_writeback+0x28d/0xcc0 fs/fs-writeback.c:1820 wb_do_writeback fs/fs-writeback.c:1965 [inline] wb_workfn+0x29b/0x1250 fs/fs-writeback.c:2006 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 kauditd_printk_skb: 32 callbacks suppressed audit: type=1800 audit(1673170370.102:10): pid=11498 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name=".pending_reads" dev="sda1" ino=14022 res=0 caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170371.033:11): pid=11594 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=13972 res=0 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170371.403:12): pid=11594 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=13972 res=0 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect F2FS-fs (loop3): Unrecognized mount option "noinline_dentˆŠíry" or missing value caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect F2FS-fs (loop3): Unrecognized mount option "noinline_dentˆŠíry" or missing value caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170371.533:13): pid=11550 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name=".pending_reads" dev="sda1" ino=13972 res=0 caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170371.533:14): pid=11618 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=13979 res=0 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170371.723:15): pid=11630 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14041 res=0 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170371.793:16): pid=11632 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14041 res=0 caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1673170372.093:17): pid=11700 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14064 res=0 caif:caif_disconnect_client(): nothing to disconnect wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 UDF-fs: bad mount option "volume=p0000p0000000undelete" or missing value UDF-fs: bad mount option "volume=p0000p0000000undelete" or missing value audit: type=1800 audit(1673170373.433:18): pid=11743 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.1" name="bus" dev="sda1" ino=13978 res=0 netlink: 'syz-executor.2': attribute type 1 has an invalid length. UDF-fs: bad mount option "volume=p0000p0000000undelete" or missing value IPv6: ADDRCONF(NETDEV_UP): bond1: link is not ready 8021q: adding VLAN 0 to HW filter on device bond1 bond1: making interface bridge4 the new active one bond1: Enslaving bridge4 as an active interface with an up link netlink: 4 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 15 bytes leftover after parsing attributes in process `syz-executor.2'. IPVS: ftp: loaded support on port[0] = 21 bond1: Enslaving veth3 as an active interface with a down link IPv6: ADDRCONF(NETDEV_CHANGE): bond1: link becomes ready bond1: the hw address of slave vlan2 is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened) netlink: 'syz-executor.2': attribute type 1 has an invalid length. IPv6: ADDRCONF(NETDEV_UP): bond2: link is not ready 8021q: adding VLAN 0 to HW filter on device bond2 bond2: making interface bridge5 the new active one bond2: Enslaving bridge5 as an active interface with an up link netlink: 4 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 15 bytes leftover after parsing attributes in process `syz-executor.2'. bond2: Enslaving veth5 as an active interface with a down link IPv6: ADDRCONF(NETDEV_CHANGE): bond2: link becomes ready audit: type=1800 audit(1673170374.763:19): pid=11879 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.1" name="bus" dev="sda1" ino=13978 res=0 ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 audit: type=1800 audit(1673170375.573:20): pid=12053 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.1" name="bus" dev="sda1" ino=14074 res=0 wlan1: Trigger new scan to find an IBSS to join IPVS: ftp: loaded support on port[0] = 21 netlink: 'syz-executor.2': attribute type 1 has an invalid length. IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_UP): bond3: link is not ready 8021q: adding VLAN 0 to HW filter on device bond3 overlayfs: workdir and upperdir must reside under the same mount bond3: making interface bridge6 the new active one bond3: Enslaving bridge6 as an active interface with an up link bond3: Enslaving bridge7 as an active interface with a down link overlayfs: workdir and upperdir must reside under the same mount netlink: 4 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 15 bytes leftover after parsing attributes in process `syz-executor.2'. bond3: Enslaving veth7 as an active interface with a down link bond3: the hw address of slave vlan2 is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened) overlayfs: workdir and upperdir must reside under the same mount overlayfs: workdir and upperdir must reside under the same mount IPv6: ADDRCONF(NETDEV_CHANGE): bond3: link becomes ready overlayfs: workdir and upperdir must reside under the same mount bond3: Enslaving bridge8 as an active interface with a down link netlink: 4 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 15 bytes leftover after parsing attributes in process `syz-executor.2'. bond3: Enslaving veth9 as an active interface with a down link bond3: Enslaving bridge9 as an active interface with a down link netlink: 4 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 15 bytes leftover after parsing attributes in process `syz-executor.2'. bond3: Enslaving veth11 as an active interface with a down link bond3: Enslaving veth13 as an active interface with a down link bridge0: port 1(bridge_slave_0) entered disabled state bridge0: port 2(bridge_slave_1) entered disabled state bond3: Enslaving bridge10 as an active interface with a down link IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready bridge0: port 1(bridge_slave_0) entered blocking state bridge0: port 1(bridge_slave_0) entered forwarding state bridge0: port 2(bridge_slave_1) entered blocking state bridge0: port 2(bridge_slave_1) entered forwarding state bond3: Enslaving veth15 as an active interface with a down link bond3: Enslaving bridge11 as an active interface with a down link IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 bridge0: port 1(bridge_slave_0) entered disabled state bridge0: port 2(bridge_slave_1) entered disabled state wlan1: Trigger new scan to find an IBSS to join IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready bridge0: port 1(bridge_slave_0) entered blocking state bridge0: port 1(bridge_slave_0) entered forwarding state 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 disabled state bridge0: port 2(bridge_slave_1) entered disabled state