====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc5-next-20230123 #1 Not tainted ------------------------------------------------------ syz-executor.6/18045 is trying to acquire lock: ffff88800b508400 (&sb->s_type->i_mutex_key#6){++++}-{3:3}, at: ext4_bmap+0x52/0x470 but task is already holding lock: ffff88800fe303f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: jbd2_journal_flush+0x48f/0xc10 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: mutex_lock_io_nested+0x14c/0x1300 jbd2_journal_flush+0x19e/0xc10 ext4_change_inode_journal_flag+0x39d/0x550 ext4_fileattr_set+0x14fa/0x19f0 vfs_fileattr_set+0x7a2/0xbd0 do_vfs_ioctl+0xfc1/0x1610 __x64_sys_ioctl+0x110/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #2 (&journal->j_barrier){+.+.}-{3:3}: __mutex_lock+0x136/0x14c0 jbd2_journal_lock_updates+0x162/0x310 ext4_change_inode_journal_flag+0x187/0x550 ext4_fileattr_set+0x14fa/0x19f0 vfs_fileattr_set+0x7a2/0xbd0 do_vfs_ioctl+0xfc1/0x1610 __x64_sys_ioctl+0x110/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #1 (&sbi->s_writepages_rwsem){++++}-{0:0}: percpu_down_write+0x51/0x350 ext4_ind_migrate+0x23b/0x840 ext4_fileattr_set+0x1521/0x19f0 vfs_fileattr_set+0x7a2/0xbd0 do_vfs_ioctl+0xfc1/0x1610 __x64_sys_ioctl+0x110/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #0 (&sb->s_type->i_mutex_key#6){++++}-{3:3}: __lock_acquire+0x2a52/0x5e90 lock_acquire.part.0+0x120/0x340 down_read+0x9c/0x450 ext4_bmap+0x52/0x470 bmap+0xb0/0x130 jbd2_journal_bmap+0xac/0x190 jbd2_journal_flush+0x860/0xc10 __ext4_ioctl+0x9fd/0x42a0 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#6 --> &journal->j_barrier --> &journal->j_checkpoint_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&journal->j_checkpoint_mutex); lock(&journal->j_barrier); lock(&journal->j_checkpoint_mutex); rlock(&sb->s_type->i_mutex_key#6); *** DEADLOCK *** 2 locks held by syz-executor.6/18045: #0: ffff88800fe30170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x162/0x310 #1: ffff88800fe303f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: jbd2_journal_flush+0x48f/0xc10 stack backtrace: CPU: 0 PID: 18045 Comm: syz-executor.6 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 check_noncircular+0x263/0x2e0 __lock_acquire+0x2a52/0x5e90 lock_acquire.part.0+0x120/0x340 down_read+0x9c/0x450 ext4_bmap+0x52/0x470 bmap+0xb0/0x130 jbd2_journal_bmap+0xac/0x190 jbd2_journal_flush+0x860/0xc10 __ext4_ioctl+0x9fd/0x42a0 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7feb7dbd3b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007feb7b149188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007feb7dce6f60 RCX: 00007feb7dbd3b19 RDX: 0000000020000340 RSI: 000000004004662b RDI: 0000000000000006 RBP: 00007feb7dc2df6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffee993aedf R14: 00007feb7b149300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 18062 Comm: syz-executor.1 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 should_fail_ex.cold+0x5/0xa should_failslab+0x9/0x20 kmem_cache_alloc+0x5a/0x300 __kernfs_new_node+0xd4/0x8c0 kernfs_new_node+0x97/0x120 __kernfs_create_file+0x55/0x350 sysfs_add_file_mode_ns+0x21c/0x440 sysfs_create_file_ns+0x12f/0x1d0 driver_create_file+0x4c/0x70 bus_add_driver+0x4bb/0x5c0 driver_register+0x224/0x3a0 usb_gadget_register_driver_owner+0xff/0x1e0 raw_ioctl+0x194b/0x1f00 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f00fbe188d7 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 a4 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f00f938c0b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f00f938d130 RCX: 00007f00fbe188d7 RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000004 RBP: 0000000000000004 R08: 000000000000ffff R09: 000000000000000b R10: 00007f00f938c180 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000020000000 R15: 0000000000000000 loop0: detected capacity change from 0 to 129 bus_add_driver: add_bind_files(raw-gadget.0) failed UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 Bluetooth: hci5: unknown advertising packet type: 0x06 Bluetooth: hci5: unknown advertising packet type: 0x06 loop0: detected capacity change from 0 to 129 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 0 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 0 loop0: detected capacity change from 0 to 129 UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 loop0: detected capacity change from 0 to 130 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 18135 Comm: syz-executor.1 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 should_fail_ex.cold+0x5/0xa should_failslab+0x9/0x20 kmem_cache_alloc+0x5a/0x300 __kernfs_new_node+0xd4/0x8c0 kernfs_new_node+0x97/0x120 __kernfs_create_file+0x55/0x350 sysfs_add_file_mode_ns+0x21c/0x440 sysfs_create_file_ns+0x12f/0x1d0 driver_create_file+0x4c/0x70 bus_add_driver+0x4bb/0x5c0 driver_register+0x224/0x3a0 usb_gadget_register_driver_owner+0xff/0x1e0 raw_ioctl+0x194b/0x1f00 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f00fbe188d7 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 a4 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f00f938c0b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f00f938d130 RCX: 00007f00fbe188d7 RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000004 RBP: 0000000000000004 R08: 000000000000ffff R09: 000000000000000b loop0: detected capacity change from 0 to 130 R10: 00007f00f938c180 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000020000000 R15: 0000000000000000 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 bus_add_driver: add_bind_files(raw-gadget.0) failed UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 Bluetooth: hci5: ACL packet for unknown connection handle 200 loop0: detected capacity change from 0 to 130 UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 loop0: detected capacity change from 0 to 130 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 0 PID: 18221 Comm: syz-executor.1 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 should_fail_ex.cold+0x5/0xa should_failslab+0x9/0x20 __kmem_cache_alloc_node+0x5b/0x2f0 __kmalloc+0x46/0xc0 loop0: detected capacity change from 0 to 130 kobject_get_path+0xc9/0x200 kobject_uevent_env+0x260/0xfa0 driver_register+0x2e3/0x3a0 usb_gadget_register_driver_owner+0xff/0x1e0 raw_ioctl+0x194b/0x1f00 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f00fbe188d7 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 a4 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f00f938c0b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f00f938d130 RCX: 00007f00fbe188d7 RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000004 RBP: 0000000000000004 R08: 000000000000ffff R09: 000000000000000b R10: 00007f00f938c180 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000020000000 R15: 0000000000000000 UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 loop0: detected capacity change from 0 to 131 loop0: detected capacity change from 0 to 131 UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 loop0: detected capacity change from 0 to 131 loop0: detected capacity change from 0 to 131 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 18295 Comm: syz-executor.1 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: loop0: detected capacity change from 0 to 131 dump_stack_lvl+0x8f/0xb7 should_fail_ex.cold+0x5/0xa should_failslab+0x9/0x20 kmem_cache_alloc_node+0x5d/0x310 __alloc_skb+0x21a/0x310 alloc_uevent_skb+0x7b/0x210 kobject_uevent_env+0xaa1/0xfa0 driver_register+0x2e3/0x3a0 usb_gadget_register_driver_owner+0xff/0x1e0 raw_ioctl+0x194b/0x1f00 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f00fbe188d7 Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 a4 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f00f938c0b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f00f938d130 RCX: 00007f00fbe188d7 RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000004 RBP: 0000000000000004 R08: 000000000000ffff R09: 000000000000000b R10: 00007f00f938c180 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000020000000 R15: 0000000000000000 UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 loop0: detected capacity change from 0 to 131 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.6'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.6'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.6'. UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy 9pnet_virtio: no channels available for device ./file0 misc raw-gadget: fail, usb_gadget_register_driver returned -16 9pnet_fd: Insufficient options for proto=fd 9pnet_virtio: no channels available for device ./file0 9pnet_fd: Insufficient options for proto=fd netlink: 24 bytes leftover after parsing attributes in process `syz-executor.6'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.6'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 24 bytes leftover after parsing attributes in process `syz-executor.2'. UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16 UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy misc raw-gadget: fail, usb_gadget_register_driver returned -16