====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc2-next-20230106 #1 Not tainted ------------------------------------------------------ syz-executor.3/15443 is trying to acquire lock: ffff88800fedc3f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x460 but task is already holding lock: ffff88800f526530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (sb_pagefaults){.+.+}-{0:0}: ext4_page_mkwrite+0x1fc/0x1ab0 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x3640 handle_mm_fault+0x1b8/0x860 do_user_addr_fault+0x53a/0x1300 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 -> #2 (&mm->mmap_lock){++++}-{3:3}: internal_get_user_pages_fast+0x138a/0x2d60 get_user_pages_fast+0x6a/0xa0 __iov_iter_get_pages_alloc+0x39f/0x2310 iov_iter_get_pages+0xb0/0x110 bio_iov_iter_get_pages+0x2a1/0x1070 iomap_dio_bio_iter+0xa8b/0x14a0 __iomap_dio_rw+0xe10/0x1bf0 iomap_dio_rw+0x40/0xa0 ext4_file_write_iter+0xb5d/0x1930 vfs_write+0x9c7/0xdd0 ksys_write+0x12b/0x260 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #1 (&sb->s_type->i_mutex_key#6){++++}-{3:3}: down_read+0x9c/0x450 ext4_bmap+0x52/0x470 bmap+0xb0/0x130 jbd2_journal_bmap+0xac/0x190 jbd2_journal_flush+0x857/0xc10 __ext4_ioctl+0x9db/0x43d0 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #0 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: __lock_acquire+0x2a02/0x5e70 lock_acquire.part.0+0x11e/0x340 mutex_lock_io_nested+0x14c/0x1330 __jbd2_log_wait_for_space+0x238/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x394/0x6b0 __ext4_journal_start_sb+0x4c2/0x6f0 ext4_dirty_inode+0xa5/0x130 __mark_inode_dirty+0x1aa/0xee0 generic_update_time+0x21b/0x2b0 file_update_time+0x22f/0x280 ext4_page_mkwrite+0x2ee/0x1ab0 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x3640 handle_mm_fault+0x1b8/0x860 do_user_addr_fault+0x53a/0x1300 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 other info that might help us debug this: Chain exists of: &journal->j_checkpoint_mutex --> &mm->mmap_lock --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_pagefaults); lock(&mm->mmap_lock); lock(sb_pagefaults); lock(&journal->j_checkpoint_mutex); *** DEADLOCK *** 2 locks held by syz-executor.3/15443: #0: ffff88801584bed8 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault+0x33b/0x1300 #1: ffff88800f526530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 stack backtrace: CPU: 1 PID: 15443 Comm: syz-executor.3 Not tainted 6.2.0-rc2-next-20230106 #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+0x2a02/0x5e70 lock_acquire.part.0+0x11e/0x340 mutex_lock_io_nested+0x14c/0x1330 __jbd2_log_wait_for_space+0x238/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x394/0x6b0 __ext4_journal_start_sb+0x4c2/0x6f0 ext4_dirty_inode+0xa5/0x130 __mark_inode_dirty+0x1aa/0xee0 generic_update_time+0x21b/0x2b0 file_update_time+0x22f/0x280 ext4_page_mkwrite+0x2ee/0x1ab0 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x3640 handle_mm_fault+0x1b8/0x860 do_user_addr_fault+0x53a/0x1300 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 RIP: 0033:0x7f24a2f82673 Code: 5d c3 0f 1f 44 00 00 48 8b 0d 59 ed 0a 01 48 8b 05 4a ed 0a 01 4c 8d 81 00 00 00 01 48 39 c8 72 13 4c 39 c0 73 0e 48 8d 50 04 <89> 38 48 89 15 2c ed 0a 01 c3 52 48 8d 35 77 b7 0b 00 48 89 c2 48 RSP: 002b:00007ffc40e14e08 EFLAGS: 00010287 RAX: 0000001b33a21000 RBX: 00007f24a2d5c008 RCX: 0000001b33a20000 RDX: 0000001b33a21004 RSI: ffffffff8212e0eb RDI: 00000000886c7d9f RBP: 0000000000000001 R08: 0000001b34a20000 R09: 0000001b33a2001c R10: 0000000000001d9f R11: 00000000886c7da3 R12: 0000000000001693 R13: 00007f24a30ec000 R14: ffffffff8212e0eb R15: 00007f24a30f7ff0 cgroup: Unknown subsys name 'rlimit' cgroup: Unknown subsys name 'rlimit' cgroup: Unknown subsys name 'rlimit' cgroup: Unknown subsys name 'rlimit' Bluetooth: hci1: ACL packet for unknown connection handle 0 Bluetooth: hci1: ACL packet for unknown connection handle 0 Bluetooth: hci1: ACL packet for unknown connection handle 0 Bluetooth: hci1: ACL packet for unknown connection handle 0 Bluetooth: hci1: ACL packet for unknown connection handle 0 device lo left promiscuous mode Bluetooth: hci4: Controller not accepting commands anymore: ncmd = 0 Bluetooth: hci4: Injecting HCI hardware error event Bluetooth: hci4: hardware error 0x00 device lo left promiscuous mode blktrace: Concurrent blktraces are not allowed on sg0 device lo left promiscuous mode device lo left promiscuous mode Bluetooth: hci4: Opcode 0x c03 failed: -110