Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.1.29' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 33.179213] BTRFS: device fsid 24c7a497-3402-47dd-bef8-82358f5f30e0 devid 1 transid 8 /dev/loop0 [ 33.194822] BTRFS info (device loop0): using free space tree [ 33.200711] BTRFS info (device loop0): has skinny extents [ 33.249199] [ 33.250840] ====================================================== [ 33.257148] WARNING: possible circular locking dependency detected [ 33.263462] 4.19.211-syzkaller #0 Not tainted [ 33.267950] ------------------------------------------------------ [ 33.274858] syz-executor702/8107 is trying to acquire lock: [ 33.280552] 0000000052766ee3 (&fs_info->qgroup_ioctl_lock){+.+.}, at: btrfs_remove_qgroup+0xae/0x770 [ 33.289812] [ 33.289812] but task is already holding lock: [ 33.295761] 00000000dfebb84e (sb_internal#2){.+.+}, at: start_transaction+0xa37/0xf90 [ 33.303714] [ 33.303714] which lock already depends on the new lock. [ 33.303714] [ 33.312007] [ 33.312007] the existing dependency chain (in reverse order) is: [ 33.319602] [ 33.319602] -> #1 (sb_internal#2){.+.+}: [ 33.325130] start_transaction+0xa37/0xf90 [ 33.329863] btrfs_quota_enable+0x169/0x10b0 [ 33.334770] btrfs_ioctl+0x622c/0x76d0 [ 33.339155] do_vfs_ioctl+0xcdb/0x12e0 [ 33.343542] ksys_ioctl+0x9b/0xc0 [ 33.347492] __x64_sys_ioctl+0x6f/0xb0 [ 33.351875] do_syscall_64+0xf9/0x620 [ 33.356178] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.361859] [ 33.361859] -> #0 (&fs_info->qgroup_ioctl_lock){+.+.}: [ 33.368596] __mutex_lock+0xd7/0x1190 [ 33.372895] btrfs_remove_qgroup+0xae/0x770 [ 33.377715] btrfs_ioctl+0x661c/0x76d0 [ 33.382101] do_vfs_ioctl+0xcdb/0x12e0 [ 33.386485] ksys_ioctl+0x9b/0xc0 [ 33.390434] __x64_sys_ioctl+0x6f/0xb0 [ 33.394824] do_syscall_64+0xf9/0x620 [ 33.399133] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.404819] [ 33.404819] other info that might help us debug this: [ 33.404819] [ 33.412947] Possible unsafe locking scenario: [ 33.412947] [ 33.418986] CPU0 CPU1 [ 33.423637] ---- ---- [ 33.428276] lock(sb_internal#2); [ 33.431799] lock(&fs_info->qgroup_ioctl_lock); [ 33.439046] lock(sb_internal#2); [ 33.445081] lock(&fs_info->qgroup_ioctl_lock); [ 33.449901] [ 33.449901] *** DEADLOCK *** [ 33.449901] [ 33.455950] 2 locks held by syz-executor702/8107: [ 33.460772] #0: 0000000018394f46 (sb_writers#11){.+.+}, at: mnt_want_write_file+0x63/0x1d0 [ 33.469263] #1: 00000000dfebb84e (sb_internal#2){.+.+}, at: start_transaction+0xa37/0xf90 [ 33.477663] [ 33.477663] stack backtrace: [ 33.482143] CPU: 1 PID: 8107 Comm: syz-executor702 Not tainted 4.19.211-syzkaller #0 [ 33.489999] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 33.499327] Call Trace: [ 33.501897] dump_stack+0x1fc/0x2ef [ 33.505506] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 33.511315] __lock_acquire+0x30c9/0x3ff0 [ 33.515446] ? __pv_queued_spin_lock_slowpath+0x23f/0xae0 [ 33.520972] ? mark_held_locks+0xf0/0xf0 [ 33.525010] ? pv_hash+0xe0/0xe0 [ 33.528356] ? __lock_acquire+0x22f9/0x3ff0 [ 33.532657] lock_acquire+0x170/0x3c0 [ 33.536436] ? btrfs_remove_qgroup+0xae/0x770 [ 33.540910] ? btrfs_remove_qgroup+0xae/0x770 [ 33.545403] __mutex_lock+0xd7/0x1190 [ 33.549181] ? btrfs_remove_qgroup+0xae/0x770 [ 33.553656] ? mark_held_locks+0xf0/0xf0 [ 33.557703] ? btrfs_remove_qgroup+0xae/0x770 [ 33.562174] ? mutex_trylock+0x1a0/0x1a0 [ 33.566212] ? mark_held_locks+0xf0/0xf0 [ 33.570249] ? btrfs_free_path+0x45/0x60 [ 33.574295] ? join_transaction+0x2d9/0xe20 [ 33.578595] ? lock_downgrade+0x720/0x720 [ 33.582720] ? lock_acquire+0x170/0x3c0 [ 33.586671] ? join_transaction+0x28/0xe20 [ 33.590886] btrfs_remove_qgroup+0xae/0x770 [ 33.595272] ? btrfs_record_root_in_trans+0x13c/0x190 [ 33.600438] ? btrfs_create_qgroup+0x270/0x270 [ 33.605000] ? start_transaction+0x239/0xf90 [ 33.609386] btrfs_ioctl+0x661c/0x76d0 [ 33.613254] ? is_bpf_text_address+0xfc/0x1b0 [ 33.617730] ? kernel_text_address+0xbd/0xf0 [ 33.622115] ? btrfs_ioctl_get_supported_features+0x50/0x50 [ 33.627805] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.633145] ? __save_stack_trace+0xaf/0x190 [ 33.637621] ? check_preemption_disabled+0x41/0x280 [ 33.642619] ? trace_hardirqs_off+0x64/0x200 [ 33.647007] ? __kasan_slab_free+0x186/0x1f0 [ 33.651394] ? kmem_cache_free+0x7f/0x260 [ 33.655525] ? putname+0xe1/0x120 [ 33.658955] ? do_sys_open+0x2ba/0x520 [ 33.662819] ? do_syscall_64+0xf9/0x620 [ 33.666791] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.672135] ? mark_held_locks+0xf0/0xf0 [ 33.676174] ? __lock_acquire+0x6de/0x3ff0 [ 33.680386] ? debug_check_no_obj_freed+0x201/0x490 [ 33.685380] ? lock_downgrade+0x720/0x720 [ 33.689506] ? lock_acquire+0x170/0x3c0 [ 33.693472] ? debug_check_no_obj_freed+0xb5/0x490 [ 33.698378] ? btrfs_ioctl_get_supported_features+0x50/0x50 [ 33.704065] do_vfs_ioctl+0xcdb/0x12e0 [ 33.707930] ? _raw_spin_unlock_irqrestore+0x66/0xe0 [ 33.713014] ? debug_check_no_obj_freed+0x201/0x490 [ 33.718007] ? ioctl_preallocate+0x200/0x200 [ 33.722395] ? putname+0xe1/0x120 [ 33.725823] ? putname+0xe1/0x120 [ 33.729252] ? rcu_read_lock_sched_held+0x16c/0x1d0 [ 33.734257] ? kmem_cache_free+0x226/0x260 [ 33.738473] ? putname+0xe1/0x120 [ 33.741927] ? do_sys_open+0x2bf/0x520 [ 33.745797] ? filp_open+0x70/0x70 [ 33.749313] ksys_ioctl+0x9b/0xc0 [ 33.752746] __x64_sys_ioctl+0x6f/0xb0 [ 33.756612] ? lockdep_hardirqs_on+0x3a8/0x5c0 [ 33.761174] do_syscall_64+0xf9/0x620 [ 33.764956] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.770122] RIP: 0033:0x7fe1582717f9 [ 33.773812] Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48 [ 33.792687] RSP: 002b:00007ffc5dd1f3a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.800371] R