====================================================== WARNING: possible circular locking dependency detected 6.0.0-next-20221014 #1 Not tainted ------------------------------------------------------ syz-executor.2/82329 is trying to acquire lock: ffff8880101203f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x234/0x460 but task is already holding lock: ffff8880100b4530 (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}: down_read+0x98/0x450 do_user_addr_fault+0xb00/0x1300 exc_page_fault+0x98/0x1a0 asm_exc_page_fault+0x22/0x30 fault_in_readable+0x143/0x250 fault_in_iov_iter_readable+0x252/0x2c0 generic_perform_write+0x1b0/0x580 ext4_buffered_write_iter+0x164/0x460 ext4_file_write_iter+0x3fb/0x1900 vfs_write+0x9c3/0xd90 ksys_write+0x127/0x250 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.2/82329: #0: ffff88803da98158 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x337/0x1300 #1: ffff8880100b4530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 stack backtrace: CPU: 1 PID: 82329 Comm: syz-executor.2 Not tainted 6.0.0-next-20221014 #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:0x7fc158ca5673 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:00007ffe7050cd58 EFLAGS: 00010287 RAX: 0000001b30941000 RBX: 00007fc158a82358 RCX: 0000001b30920000 RDX: 0000001b30941004 RSI: 00007fc158c7f000 RDI: 00000000818e6585 RBP: 0000000000001391 R08: 0000001b31920000 R09: 0000001b30935af4 R10: 000000000000058b R11: 00000000c608e58f R12: 00007fc158a88c90 R13: 00007fc158c7f000 R14: ffffffff815aed09 R15: 00007fc158e1aff0 proc: Unknown parameter '}#' cgroup: Need name or subsystem set cgroup: Need name or subsystem set cgroup: Need name or subsystem set platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 cgroup: Need name or subsystem set platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 netlink: 4 bytes leftover after parsing attributes in process `syz-executor.1'. tmpfs: Bad value for 'mpol' tmpfs: Bad value for 'mpol' rfkill: input handler disabled rfkill: input handler enabled rfkill: input handler disabled rfkill: input handler enabled rfkill: input handler disabled rfkill: input handler enabled warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow rfkill: input handler disabled rfkill: input handler enabled warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow rfkill: input handler disabled warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow rfkill: input handler enabled warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow