====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc2-next-20230106 #1 Not tainted ------------------------------------------------------ syz-executor.1/143269 is trying to acquire lock: ffff88800feae3f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x460 but task is already holding lock: ffff88800feaa530 (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}: __might_fault+0x103/0x180 iov_iter_zero+0x295/0x14f0 __iomap_dio_rw+0xfca/0x1bf0 iomap_dio_rw+0x40/0xa0 ext4_file_read_iter+0x2f4/0x4a0 vfs_read+0x687/0x940 ksys_read+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.1/143269: #0: ffff88804d4be1d8 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault+0x33b/0x1300 #1: ffff88800feaa530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 stack backtrace: CPU: 1 PID: 143269 Comm: syz-executor.1 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:0x7fc65d2b3673 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:00007ffddfe1a6b8 EFLAGS: 00010287 RAX: 0000001b2c021000 RBX: 00007fc65d08d2c8 RCX: 0000001b2c020000 RDX: 0000001b2c021004 RSI: 00007fc65d094ca0 RDI: 000000008149f04a RBP: 0000000000000373 R08: 0000001b2d020000 R09: 0000001b2c02001c R10: 0000000000000702 R11: 000000003943a706 R12: 00007fc65d08eba0 R13: 00007fc65d094ca0 R14: ffffffff8136956a R15: 00007fc65d428ff0 Process accounting resumed EXT4-fs (sda): re-mounted 7b5d9a40-9011-49ec-8035-27953f97a4d8. Quota mode: none. EXT4-fs (sda): re-mounted 7b5d9a40-9011-49ec-8035-27953f97a4d8. Quota mode: none. EXT4-fs (sda): re-mounted 7b5d9a40-9011-49ec-8035-27953f97a4d8. Quota mode: none. EXT4-fs (sda): re-mounted 7b5d9a40-9011-49ec-8035-27953f97a4d8. Quota mode: none. EXT4-fs (sda): re-mounted 7b5d9a40-9011-49ec-8035-27953f97a4d8. Quota mode: none. device lo left promiscuous mode device lo entered promiscuous mode device lo left promiscuous mode device lo entered promiscuous mode IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready device lo left promiscuous mode device lo entered promiscuous mode device lo left promiscuous mode device lo left promiscuous mode device lo entered promiscuous mode IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready device lo entered promiscuous mode device lo left promiscuous mode device lo entered promiscuous mode IPv6: ADDRCONF(NETDEV_CHANGE): lo: link becomes ready device lo left promiscuous mode device lo entered promiscuous mode netlink: 28 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.7'. audit: type=1326 audit(1673007398.185:46): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=145724 comm="syz-executor.6" exe="/syz-executor.6" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f750b4a7b19 code=0x0 audit: type=1326 audit(1673007398.224:47): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=145724 comm="syz-executor.6" exe="/syz-executor.6" sig=31 arch=c000003e syscall=3 compat=0 ip=0x7f750b45a72b code=0x0 netlink: 28 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 28 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 16 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1326 audit(1673007399.660:48): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=146596 comm="syz-executor.1" exe="/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fc65d315b19 code=0x0 netlink: 16 bytes leftover after parsing attributes in process `syz-executor.3'. audit: type=1326 audit(1673007400.670:49): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=147148 comm="syz-executor.1" exe="/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fc65d315b19 code=0x0 audit: type=1326 audit(1673007401.535:50): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=147375 comm="syz-executor.1" exe="/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fc65d315b19 code=0x0 audit: type=1326 audit(1673007402.448:51): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=147917 comm="syz-executor.1" exe="/syz-executor.1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7fc65d315b19 code=0x0