====================================================== WARNING: possible circular locking dependency detected 6.0.0-next-20221013 #1 Not tainted ------------------------------------------------------ syz-executor.3/157369 is trying to acquire lock: ffff88800ffdc3f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x234/0x460 but task is already holding lock: ffff88800ffd8530 (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+0x1f8/0x1a70 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x35e0 handle_mm_fault+0x2e6/0xa20 do_user_addr_fault+0x536/0x1300 exc_page_fault+0x98/0x1a0 asm_exc_page_fault+0x22/0x30 -> #2 (&mm->mmap_lock#2){++++}-{3:3}: __might_fault+0xfb/0x170 iov_iter_zero+0x738/0x14d0 __iomap_dio_rw+0xecc/0x1bd0 iomap_dio_rw+0x3c/0xa0 ext4_file_read_iter+0x2f0/0x490 do_iter_readv_writev+0x2f0/0x3c0 do_iter_read+0x2fb/0x750 vfs_readv+0xe5/0x160 do_readv+0x133/0x300 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&sb->s_type->i_mutex_key#6){++++}-{3:3}: down_read+0x98/0x450 ext4_bmap+0x4e/0x470 bmap+0xac/0x120 jbd2_journal_bmap+0xa8/0x180 jbd2_journal_flush+0x853/0xc00 __ext4_ioctl+0x9e9/0x40a0 __x64_sys_ioctl+0x19a/0x210 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: __lock_acquire+0x2a02/0x5e70 lock_acquire+0x1a2/0x530 mutex_lock_io_nested+0x148/0x1310 __jbd2_log_wait_for_space+0x234/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x390/0x8d0 __ext4_journal_start_sb+0x391/0x470 ext4_dirty_inode+0x9d/0x110 __mark_inode_dirty+0x1a6/0xe60 generic_update_time+0x217/0x2b0 file_update_time+0x22b/0x280 ext4_page_mkwrite+0x2ea/0x1a70 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x35e0 handle_mm_fault+0x2e6/0xa20 do_user_addr_fault+0x536/0x1300 exc_page_fault+0x98/0x1a0 asm_exc_page_fault+0x22/0x30 other info that might help us debug this: Chain exists of: &journal->j_checkpoint_mutex --> &mm->mmap_lock#2 --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_pagefaults); lock(&mm->mmap_lock#2); lock(sb_pagefaults); lock(&journal->j_checkpoint_mutex); *** DEADLOCK *** 2 locks held by syz-executor.3/157369: #0: ffff8880442f6358 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x337/0x1300 #1: ffff88800ffd8530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 stack backtrace: CPU: 1 PID: 157369 Comm: syz-executor.3 Not tainted 6.0.0-next-20221013 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8b/0xb3 check_noncircular+0x263/0x2e0 __lock_acquire+0x2a02/0x5e70 lock_acquire+0x1a2/0x530 mutex_lock_io_nested+0x148/0x1310 __jbd2_log_wait_for_space+0x234/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x390/0x8d0 __ext4_journal_start_sb+0x391/0x470 ext4_dirty_inode+0x9d/0x110 __mark_inode_dirty+0x1a6/0xe60 generic_update_time+0x217/0x2b0 file_update_time+0x22b/0x280 ext4_page_mkwrite+0x2ea/0x1a70 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x35e0 handle_mm_fault+0x2e6/0xa20 do_user_addr_fault+0x536/0x1300 exc_page_fault+0x98/0x1a0 asm_exc_page_fault+0x22/0x30 RIP: 0033:0x7feaf0cf8673 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:00007ffc00802e58 EFLAGS: 00010287 RAX: 0000001b2ee25000 RBX: 00007feaf0ad2008 RCX: 0000001b2ee20000 RDX: 0000001b2ee25004 RSI: ffffffff836e525e RDI: 00000000e6140a5e RBP: 0000000000000001 R08: 0000001b2fe20000 R09: 0000001b2ee2472c R10: 0000000000000a5e R11: 00000000e6140a62 R12: 0000000000000636 R13: 00007feaf0e62000 R14: ffffffff836e525e R15: 00007feaf0e6dff0 EXT4-fs warning (device sda): ext4_group_extend:1850: can't shrink FS - resize aborted EXT4-fs warning (device sda): ext4_group_extend:1850: can't shrink FS - resize aborted EXT4-fs warning (device sda): ext4_group_extend:1850: can't shrink FS - resize aborted EXT4-fs warning (device sda): ext4_group_extend:1850: can't shrink FS - resize aborted __nla_validate_parse: 2 callbacks suppressed netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. audit: type=1326 audit(2000000405.857:75): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=159878 comm="syz-executor.6" exe="/syz-executor.6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f10ea3e5b19 code=0x0 audit: type=1326 audit(2000000406.042:76): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=160103 comm="syz-executor.6" exe="/syz-executor.6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f10ea3e5b19 code=0x0 audit: type=1326 audit(2000000406.184:77): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=160305 comm="syz-executor.6" exe="/syz-executor.6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f10ea3e5b19 code=0x0 audit: type=1326 audit(2000000406.373:78): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=160315 comm="syz-executor.6" exe="/syz-executor.6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f10ea3e5b19 code=0x0 device lo left promiscuous mode device lo left promiscuous mode