====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/4702 is trying to acquire lock: 000000005c49b59d (&tree->tree_lock#2/1){+.+.}, at: hfs_find_init+0x17e/0x230 fs/hfs/bfind.c:33 but task is already holding lock: 0000000028bb6102 (&HFS_I(tree->inode)->extents_lock){+.+.}, at: hfs_get_block+0x532/0x7e0 fs/hfs/extent.c:365 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFS_I(tree->inode)->extents_lock){+.+.}: hfs_extend_file+0x93/0xac0 fs/hfs/extent.c:397 hfs_bmap_reserve+0x241/0x390 fs/hfs/btree.c:231 __hfs_ext_write_extent+0x3c1/0x510 fs/hfs/extent.c:121 __hfs_ext_cache_extent fs/hfs/extent.c:174 [inline] hfs_ext_read_extent+0x810/0xa20 fs/hfs/extent.c:202 hfs_extend_file+0x4a0/0xac0 fs/hfs/extent.c:401 hfs_get_block+0x17b/0x7e0 fs/hfs/extent.c:353 __block_write_begin_int+0x46c/0x17b0 fs/buffer.c:1978 __block_write_begin fs/buffer.c:2028 [inline] block_write_begin+0x58/0x2e0 fs/buffer.c:2087 cont_write_begin+0x55a/0x820 fs/buffer.c:2440 hfs_write_begin+0x87/0x150 fs/hfs/inode.c:58 generic_perform_write+0x1f8/0x4d0 mm/filemap.c:3170 __generic_file_write_iter+0x24b/0x610 mm/filemap.c:3295 generic_file_write_iter+0x3f8/0x730 mm/filemap.c:3323 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&tree->tree_lock#2/1){+.+.}: __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 hfs_find_init+0x17e/0x230 fs/hfs/bfind.c:33 hfs_ext_read_extent+0x191/0xa20 fs/hfs/extent.c:200 hfs_get_block+0x53d/0x7e0 fs/hfs/extent.c:366 block_read_full_page+0x288/0xd10 fs/buffer.c:2259 do_read_cache_page+0x533/0x1170 mm/filemap.c:2828 read_mapping_page include/linux/pagemap.h:402 [inline] hfs_btree_open+0x6ae/0x1430 fs/hfs/btree.c:78 hfs_mdb_get+0x148c/0x1cf0 fs/hfs/mdb.c:198 hfs_fill_super+0xd6a/0x1310 fs/hfs/super.c:413 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock#2/1); lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock#2/1); *** DEADLOCK *** 2 locks held by syz-executor.4/4702: #0: 000000001c269210 (&type->s_umount_key#83/1){+.+.}, at: alloc_super fs/super.c:226 [inline] #0: 000000001c269210 (&type->s_umount_key#83/1){+.+.}, at: sget_userns+0x20b/0xcd0 fs/super.c:519 #1: 0000000028bb6102 (&HFS_I(tree->inode)->extents_lock){+.+.}, at: hfs_get_block+0x532/0x7e0 fs/hfs/extent.c:365 kauditd_printk_skb: 2 callbacks suppressed audit: type=1804 audit(1678052752.034:759): pid=4659 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/776/bus" dev="sda1" ino=15363 res=1 stack backtrace: CPU: 0 PID: 4702 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: audit: type=1800 audit(1678052752.044:760): pid=4659 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=15363 res=0 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 audit: type=1804 audit(1678052752.154:761): pid=4708 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/776/bus" dev="sda1" ino=15363 res=1 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+0x17e/0x230 fs/hfs/bfind.c:33 hfs_ext_read_extent+0x191/0xa20 fs/hfs/extent.c:200 hfs_get_block+0x53d/0x7e0 fs/hfs/extent.c:366 block_read_full_page+0x288/0xd10 fs/buffer.c:2259 do_read_cache_page+0x533/0x1170 mm/filemap.c:2828 read_mapping_page include/linux/pagemap.h:402 [inline] hfs_btree_open+0x6ae/0x1430 fs/hfs/btree.c:78 hfs_mdb_get+0x148c/0x1cf0 fs/hfs/mdb.c:198 hfs_fill_super+0xd6a/0x1310 fs/hfs/super.c:413 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 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 RIP: 0033:0x7fc427ee562a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc426455f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000000002a2 RCX: 00007fc427ee562a RDX: 0000000020000080 RSI: 0000000020000280 RDI: 00007fc426455fe0 RBP: 00007fc426456020 R08: 00007fc426456020 R09: 0000000000204100 R10: 0000000000204100 R11: 0000000000000202 R12: 0000000020000080 R13: 0000000020000280 R14: 00007fc426455fe0 R15: 0000000020000040 hfs: unable to open catalog tree hfs: can't find a HFS filesystem on dev loop4 audit: type=1804 audit(1678052752.704:762): pid=4728 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/777/bus" dev="sda1" ino=15268 res=1 hfs: unable to open catalog tree hfs: can't find a HFS filesystem on dev loop4 audit: type=1800 audit(1678052752.704:763): pid=4728 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=15268 res=0 audit: type=1804 audit(1678052752.734:764): pid=4734 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/777/bus" dev="sda1" ino=15268 res=1 hfs: unable to open catalog tree hfs: can't find a HFS filesystem on dev loop4 audit: type=1804 audit(1678052753.084:765): pid=4768 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/778/bus" dev="sda1" ino=15523 res=1 audit: type=1800 audit(1678052753.104:766): pid=4768 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=15523 res=0 audit: type=1804 audit(1678052753.154:767): pid=4768 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/778/bus" dev="sda1" ino=15523 res=1 audit: type=1804 audit(1678052753.184:768): pid=4768 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.2" name="/root/syzkaller-testdir2452794471/syzkaller.KiWQhe/778/bus" dev="sda1" ino=15523 res=1 hfs: unable to parse mount options validate_nla: 9 callbacks suppressed netlink: 'syz-executor.1': attribute type 1 has an invalid length. 8021q: adding VLAN 0 to HW filter on device batadv1 bond1: Enslaving batadv1 as a backup interface with an up link IPv6: ADDRCONF(NETDEV_UP): bond1: link is not ready bond1: Warning: No 802.3ad response from the link partner for any adapters in the bond 8021q: adding VLAN 0 to HW filter on device bond1 IPv6: ADDRCONF(NETDEV_CHANGE): bond1: link becomes ready netlink: 'syz-executor.1': attribute type 1 has an invalid length. bond1: Warning: No 802.3ad response from the link partner for any adapters in the bond 8021q: adding VLAN 0 to HW filter on device batadv2 bond2: Enslaving batadv2 as a backup interface with an up link 8021q: adding VLAN 0 to HW filter on device batadv3 bond2: Enslaving batadv3 as a backup interface with an up link IPv6: ADDRCONF(NETDEV_UP): bond2: link is not ready bond2: Warning: No 802.3ad response from the link partner for any adapters in the bond 8021q: adding VLAN 0 to HW filter on device bond2 IPv6: ADDRCONF(NETDEV_CHANGE): bond2: link becomes ready netlink: 'syz-executor.1': attribute type 1 has an invalid length. bond2: Warning: No 802.3ad response from the link partner for any adapters in the bond 8021q: adding VLAN 0 to HW filter on device batadv4 bond3: Enslaving batadv4 as a backup interface with an up link bond3: Warning: No 802.3ad response from the link partner for any adapters in the bond 8021q: adding VLAN 0 to HW filter on device bond3 overlayfs: failed to resolve './file0': -2 bond3: Warning: No 802.3ad response from the link partner for any adapters in the bond bridge0: port 3(team0) entered blocking state bridge0: port 3(team0) entered disabled state device team0 entered promiscuous mode device team_slave_0 entered promiscuous mode device team_slave_1 entered promiscuous mode bridge0: port 3(team0) entered blocking state bridge0: port 3(team0) entered forwarding state overlayfs: failed to resolve './file0': -2 overlayfs: failed to resolve './file0': -2 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 overlayfs: failed to resolve './file0': -2 CPU: 0 PID: 5403 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0xf lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0x10 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x2ab/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] hci_mgmt_cmd net/bluetooth/hci_sock.c:1502 [inline] hci_sock_sendmsg+0xa04/0x20f0 net/bluetooth/hci_sock.c:1730 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 sock_write_iter+0x287/0x3c0 net/socket.c:966 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fc427ee40f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc426456168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fc428003f80 RCX: 00007fc427ee40f9 RDX: 000000000000000d RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007fc4264561d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffee24552ff R14: 00007fc426456300 R15: 0000000000022000 Bluetooth: hci1: command 0x0406 tx timeout XFS (loop1): Mounting V4 Filesystem XFS (loop1): Ending clean mount overlayfs: failed to resolve './file1': -2 XFS (loop1): Unmounting Filesystem XFS (loop1): Mounting V4 Filesystem XFS (loop1): Ending clean mount overlayfs: failed to resolve './file1': -2 XFS (loop1): Unmounting Filesystem XFS (loop1): Mounting V4 Filesystem XFS (loop1): Ending clean mount overlayfs: failed to resolve './file1': -2 XFS (loop1): Unmounting Filesystem