Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.1.84' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 32.653731] BTRFS: device fsid 24c7a497-3402-47dd-bef8-82358f5f30e0 devid 1 transid 8 /dev/loop0 [ 32.670948] BTRFS info (device loop0): using free space tree [ 32.676880] BTRFS info (device loop0): has skinny extents [ 32.732621] [ 32.734259] ====================================================== [ 32.740558] WARNING: possible circular locking dependency detected [ 32.746852] 4.19.211-syzkaller #0 Not tainted [ 32.751316] ------------------------------------------------------ [ 32.757605] syz-executor173/8103 is trying to acquire lock: [ 32.763284] 000000008176a9e6 (&fs_info->qgroup_ioctl_lock){+.+.}, at: btrfs_create_qgroup+0x5a/0x270 [ 32.772540] [ 32.772540] but task is already holding lock: [ 32.778481] 00000000e6397e76 (sb_internal#2){.+.+}, at: start_transaction+0xa37/0xf90 [ 32.786431] [ 32.786431] which lock already depends on the new lock. [ 32.786431] [ 32.794722] [ 32.794722] the existing dependency chain (in reverse order) is: [ 32.802318] [ 32.802318] -> #1 (sb_internal#2){.+.+}: [ 32.807838] start_transaction+0xa37/0xf90 [ 32.812568] btrfs_quota_enable+0x169/0x10b0 [ 32.817471] btrfs_ioctl+0x622c/0x76d0 [ 32.821852] do_vfs_ioctl+0xcdb/0x12e0 [ 32.826233] ksys_ioctl+0x9b/0xc0 [ 32.830181] __x64_sys_ioctl+0x6f/0xb0 [ 32.834567] do_syscall_64+0xf9/0x620 [ 32.838866] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.844545] [ 32.844545] -> #0 (&fs_info->qgroup_ioctl_lock){+.+.}: [ 32.851282] __mutex_lock+0xd7/0x1190 [ 32.855579] btrfs_create_qgroup+0x5a/0x270 [ 32.860395] btrfs_ioctl+0xcce/0x76d0 [ 32.864692] do_vfs_ioctl+0xcdb/0x12e0 [ 32.869085] ksys_ioctl+0x9b/0xc0 [ 32.873043] __x64_sys_ioctl+0x6f/0xb0 [ 32.877434] do_syscall_64+0xf9/0x620 [ 32.881732] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 32.887415] [ 32.887415] other info that might help us debug this: [ 32.887415] [ 32.895531] Possible unsafe locking scenario: [ 32.895531] [ 32.901561] CPU0 CPU1 [ 32.906200] ---- ---- [ 32.910841] lock(sb_internal#2); [ 32.914356] lock(&fs_info->qgroup_ioctl_lock); [ 32.921608] lock(sb_internal#2); [ 32.927645] lock(&fs_info->qgroup_ioctl_lock); [ 32.932372] [ 32.932372] *** DEADLOCK *** [ 32.932372] [ 32.938409] 2 locks held by syz-executor173/8103: [ 32.943220] #0: 00000000bf42d339 (sb_writers#11){.+.+}, at: mnt_want_write_file+0x63/0x1d0 [ 32.951703] #1: 00000000e6397e76 (sb_internal#2){.+.+}, at: start_transaction+0xa37/0xf90 [ 32.960092] [ 32.960092] stack backtrace: [ 32.964568] CPU: 0 PID: 8103 Comm: syz-executor173 Not tainted 4.19.211-syzkaller #0 [ 32.972418] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 [ 32.981747] Call Trace: [ 32.984313] dump_stack+0x1fc/0x2ef [ 32.987920] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 32.993698] __lock_acquire+0x30c9/0x3ff0 [ 32.997827] ? mark_held_locks+0xf0/0xf0 [ 33.001868] ? btrfs_record_root_in_trans+0x122/0x190 [ 33.007034] lock_acquire+0x170/0x3c0 [ 33.010813] ? btrfs_create_qgroup+0x5a/0x270 [ 33.015282] ? btrfs_create_qgroup+0x5a/0x270 [ 33.019755] __mutex_lock+0xd7/0x1190 [ 33.023530] ? btrfs_create_qgroup+0x5a/0x270 [ 33.028010] ? btrfs_create_qgroup+0x5a/0x270 [ 33.032484] ? mutex_trylock+0x1a0/0x1a0 [ 33.036520] ? wait_for_completion_io+0x10/0x10 [ 33.041180] ? record_root_in_trans.isra.0+0x327/0x400 [ 33.046434] ? btrfs_record_root_in_trans+0x13c/0x190 [ 33.051602] btrfs_create_qgroup+0x5a/0x270 [ 33.055902] btrfs_ioctl+0xcce/0x76d0 [ 33.059688] ? is_bpf_text_address+0xfc/0x1b0 [ 33.064166] ? kernel_text_address+0xbd/0xf0 [ 33.068553] ? btrfs_ioctl_get_supported_features+0x50/0x50 [ 33.074241] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.079581] ? __save_stack_trace+0xaf/0x190 [ 33.083972] ? check_preemption_disabled+0x41/0x280 [ 33.088970] ? trace_hardirqs_off+0x64/0x200 [ 33.093356] ? __kasan_slab_free+0x186/0x1f0 [ 33.097743] ? kmem_cache_free+0x7f/0x260 [ 33.101871] ? putname+0xe1/0x120 [ 33.105300] ? do_sys_open+0x2ba/0x520 [ 33.109165] ? do_syscall_64+0xf9/0x620 [ 33.113115] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.118458] ? mark_held_locks+0xf0/0xf0 [ 33.122494] ? __lock_acquire+0x6de/0x3ff0 [ 33.126707] ? debug_check_no_obj_freed+0x201/0x490 [ 33.131711] ? lock_downgrade+0x720/0x720 [ 33.135834] ? lock_acquire+0x170/0x3c0 [ 33.139788] ? debug_check_no_obj_freed+0xb5/0x490 [ 33.144693] ? btrfs_ioctl_get_supported_features+0x50/0x50 [ 33.150385] do_vfs_ioctl+0xcdb/0x12e0 [ 33.154249] ? _raw_spin_unlock_irqrestore+0x66/0xe0 [ 33.159326] ? debug_check_no_obj_freed+0x201/0x490 [ 33.164316] ? ioctl_preallocate+0x200/0x200 [ 33.168702] ? putname+0xe1/0x120 [ 33.172132] ? putname+0xe1/0x120 [ 33.175562] ? rcu_read_lock_sched_held+0x16c/0x1d0 [ 33.180553] ? kmem_cache_free+0x226/0x260 [ 33.184762] ? putname+0xe1/0x120 [ 33.188198] ? do_sys_open+0x2bf/0x520 [ 33.192060] ? filp_open+0x70/0x70 [ 33.195574] ksys_ioctl+0x9b/0xc0 [ 33.199002] __x64_sys_ioctl+0x6f/0xb0 [ 33.202870] ? lockdep_hardirqs_on+0x3a8/0x5c0 [ 33.207426] do_syscall_64+0xf9/0x620 [ 33.211207] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 33.216374] RIP: 0033:0x7f7ddceb47f9 [ 33.220062] 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.238939] RSP: 002b:00007ffe352c24f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 33.246620] RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f7ddceb47f9 [ 33.253867] RDX: 00000000200011c0 RSI: 000000004010942a RDI: 0000000000000004 [ 33.261110] RBP: 00007f7ddce74090 R08: 0000000000000000 R09: 0000000000000000 [ 33.268359] R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7ddce74120 [ 33.275603] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [