BTRFS warning (device loop1): excessive commit interval 622039222 BTRFS info (device loop1): force zlib compression, level 3 BTRFS info (device loop1): using free space tree BTRFS info (device loop1): has skinny extents ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/17323 is trying to acquire lock: 0000000049bb5c1c (sb_internal#3){.+.+}, at: sb_start_intwrite include/linux/fs.h:1626 [inline] 0000000049bb5c1c (sb_internal#3){.+.+}, at: start_transaction+0xa37/0xf90 fs/btrfs/transaction.c:528 but task is already holding lock: 000000003257aa72 (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x152/0x200 mm/util.c:355 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (&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 -> #5 (&tree->tree_lock){+.+.}: 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 -> #4 ((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 -> #3 (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 -> #2 (&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 close_ctree+0x3c8/0x850 fs/btrfs/disk-io.c:4047 generic_shutdown_super+0x144/0x370 fs/super.c:456 kill_anon_super+0x36/0x60 fs/super.c:1032 btrfs_kill_super+0x49/0x550 fs/btrfs/super.c:2221 deactivate_locked_super+0x94/0x160 fs/super.c:329 deactivate_super+0x174/0x1a0 fs/super.c:360 cleanup_mnt+0x1a8/0x290 fs/namespace.c:1098 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&fs_devs->device_list_mutex){+.+.}: btrfs_finish_chunk_alloc+0x27b/0xf90 fs/btrfs/volumes.c:4938 btrfs_create_pending_block_groups+0x242/0x590 fs/btrfs/extent-tree.c:10134 __btrfs_end_transaction+0x21a/0xb00 fs/btrfs/transaction.c:855 flush_space+0xa41/0xee0 fs/btrfs/extent-tree.c:4861 btrfs_async_reclaim_metadata_space+0x466/0x1050 fs/btrfs/extent-tree.c:4977 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 -> #0 (sb_internal#3){.+.+}: percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x6e/0x2a0 fs/super.c:1366 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 other info that might help us debug this: Chain exists of: sb_internal#3 --> &tree->tree_lock --> &mm->mmap_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_sem); lock(&tree->tree_lock); lock(&mm->mmap_sem); lock(sb_internal#3); *** DEADLOCK *** 2 locks held by syz-executor.1/17323: #0: 000000003257aa72 (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x152/0x200 mm/util.c:355 #1: 0000000071b2d4a6 (sb_writers#15){.+.+}, at: sb_start_write_trylock include/linux/fs.h:1584 [inline] #1: 0000000071b2d4a6 (sb_writers#15){.+.+}, at: touch_atime+0x152/0x2a0 fs/inode.c:1731 stack backtrace: CPU: 0 PID: 17323 Comm: syz-executor.1 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 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 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x6e/0x2a0 fs/super.c:1366 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 RIP: 0033:0x7f23c014b0f9 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:00007f23b729c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007f23c026b050 RCX: 00007f23c014b0f9 RDX: 000000000200000b RSI: 0000000000b36000 RDI: 0000000020000000 RBP: 00007f23c01a6ae9 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000028011 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdbca97c9f R14: 00007f23b729c300 R15: 0000000000022000 nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based firewall rule not found. Use the iptables CT target to attach helpers instead. nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based firewall rule not found. Use the iptables CT target to attach helpers instead. netlink: 16 bytes leftover after parsing attributes in process `syz-executor.5'. BTRFS info (device loop1): enabling inode map caching BTRFS warning (device loop1): excessive commit interval 622039222 BTRFS info (device loop1): force zlib compression, level 3 BTRFS info (device loop1): using free space tree BTRFS info (device loop1): has skinny extents audit: type=1804 audit(1678009927.735:253): pid=17374 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/153/bus" dev="sda1" ino=14066 res=1 audit: type=1804 audit(1678009927.825:254): pid=17383 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/153/bus" dev="sda1" ino=14066 res=1 audit: type=1804 audit(1678009928.415:255): pid=17438 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/154/bus" dev="sda1" ino=13957 res=1 audit: type=1804 audit(1678009928.485:256): pid=17458 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/154/bus" dev="sda1" ino=13957 res=1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor.5'. audit: type=1804 audit(1678009928.635:257): pid=17496 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/155/bus" dev="sda1" ino=14001 res=1 audit: type=1804 audit(1678009928.705:258): pid=17488 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/155/bus" dev="sda1" ino=14001 res=1 BTRFS info (device loop1): enabling inode map caching audit: type=1804 audit(1678009928.915:259): pid=17503 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir4117684245/syzkaller.IXZWpH/130/file0" dev="sda1" ino=13875 res=1 BTRFS warning (device loop1): excessive commit interval 622039222 BTRFS info (device loop1): force zlib compression, level 3 audit: type=1804 audit(1678009929.245:260): pid=17507 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/156/bus" dev="sda1" ino=14194 res=1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1804 audit(1678009929.315:261): pid=17513 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/156/bus" dev="sda1" ino=14194 res=1 BTRFS info (device loop1): using free space tree BTRFS info (device loop1): has skinny extents audit: type=1804 audit(1678009929.815:262): pid=17562 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/157/bus" dev="sda1" ino=14067 res=1 netlink: 16 bytes leftover after parsing attributes in process `syz-executor.5'. EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue IPVS: ftp: loaded support on port[0] = 21 EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue device lo left promiscuous mode IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19 caif:caif_disconnect_client(): nothing to disconnect chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT chnl_net:chnl_net_open(): state disconnected A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check. sch_tbf: burst 1024 is lower than device syz_tun mtu (1514) ! sch_tbf: burst 1024 is lower than device syz_tun mtu (1514) ! IPVS: ftp: loaded support on port[0] = 21 IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready kauditd_printk_skb: 12 callbacks suppressed audit: type=1804 audit(1678009933.015:275): pid=17760 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/163/bus" dev="sda1" ino=14550 res=1 chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19 caif:caif_disconnect_client(): nothing to disconnect audit: type=1804 audit(1678009933.095:276): pid=17761 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/163/bus" dev="sda1" ino=14550 res=1 audit: type=1804 audit(1678009933.125:277): pid=17726 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir148456097/syzkaller.kjMYWq/121/file0/bus" dev="loop1" ino=18 res=1 chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT chnl_net:chnl_net_open(): state disconnected A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check. IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready audit: type=1804 audit(1678009933.165:278): pid=17746 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/163/bus" dev="sda1" ino=14550 res=1 audit: type=1804 audit(1678009933.215:279): pid=17769 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.1" name="/root/syzkaller-testdir148456097/syzkaller.kjMYWq/121/file0/bus" dev="loop1" ino=18 res=1 IPv6: ADDRCONF(NETDEV_CHANGE): vcan0: link becomes ready chnl_net:chnl_net_open(): err: Unable to register and open device, Err:-19 caif:caif_disconnect_client(): nothing to disconnect chnl_net:chnl_flowctrl_cb(): NET flowctrl func called flow: CLOSE/DEINIT chnl_net:chnl_net_open(): state disconnected A link change request failed with some changes committed already. Interface caif0 may have been left with an inconsistent configuration, please check. Enabling of bearer rejected, failed to enable media sch_tbf: burst 1024 is lower than device syz_tun mtu (1514) ! BTRFS info (device loop4): allowing degraded mounts audit: type=1804 audit(1678009933.765:280): pid=17832 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/164/bus" dev="sda1" ino=13971 res=1 BTRFS info (device loop4): metadata ratio 2146 IPVS: ftp: loaded support on port[0] = 21 BTRFS error (device loop4): support for check_integrity* not compiled in! BTRFS error (device loop4): open_ctree failed audit: type=1804 audit(1678009933.795:281): pid=17774 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/164/bus" dev="sda1" ino=13971 res=1 audit: type=1804 audit(1678009933.835:282): pid=17774 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/164/bus" dev="sda1" ino=13971 res=1 audit: type=1804 audit(1678009933.845:283): pid=17774 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/164/bus" dev="sda1" ino=13971 res=1 BTRFS info (device loop4): allowing degraded mounts BTRFS info (device loop4): metadata ratio 2146 BTRFS error (device loop4): support for check_integrity* not compiled in! BTRFS error (device loop4): open_ctree failed audit: type=1804 audit(1678009935.115:284): pid=17968 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2370888573/syzkaller.6Tpxff/168/cgroup.controllers" dev="sda1" ino=14560 res=1 hfs: unable to parse mount options netlink: zone id is out of range xt_limit: Overflow, try lower: 0/0 netlink: zone id is out of range hfs: unable to parse mount options hfs: unable to parse mount options BTRFS info (device loop4): allowing degraded mounts BTRFS info (device loop4): metadata ratio 2146 BTRFS error (device loop4): support for check_integrity* not compiled in! BTRFS error (device loop4): open_ctree failed netlink: zone id is out of range netlink: zone id is out of range netlink: zone id is out of range netlink: zone id is out of range xt_limit: Overflow, try lower: 0/0 Bluetooth: hci0: command 0x0406 tx timeout Bluetooth: hci1: command 0x0406 tx timeout Bluetooth: hci2: command 0x0406 tx timeout Bluetooth: hci3: command 0x0406 tx timeout Bluetooth: hci4: command 0x0406 tx timeout Bluetooth: hci5: command 0x0406 tx timeout