====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc4-syzkaller-g526116b79e8c #0 Not tainted ------------------------------------------------------ syz.3.396/8037 is trying to acquire lock: ffff0000f0b93120 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_page_mkwrite+0x368/0xdd8 fs/ocfs2/mmap.c:142 but task is already holding lock: ffff0000f6384518 (sb_pagefaults#5){.+.+}-{0:0}, at: do_page_mkwrite+0x140/0x2dc mm/memory.c:3162 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#5){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1716 [inline] sb_start_pagefault include/linux/fs.h:1881 [inline] ocfs2_page_mkwrite+0x1bc/0xdd8 fs/ocfs2/mmap.c:122 do_page_mkwrite+0x140/0x2dc mm/memory.c:3162 wp_page_shared mm/memory.c:3563 [inline] do_wp_page+0x1fc8/0x3a54 mm/memory.c:3713 handle_pte_fault mm/memory.c:5771 [inline] __handle_mm_fault+0x1338/0x66c0 mm/memory.c:5898 handle_mm_fault+0x29c/0x8b4 mm/memory.c:6066 do_page_fault+0x570/0x10a8 arch/arm64/mm/fault.c:690 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:919 el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:432 el1h_64_sync_handler+0x60/0xcc arch/arm64/kernel/entry-common.c:510 el1h_64_sync+0x6c/0x70 arch/arm64/kernel/entry.S:595 __uaccess_mask_ptr arch/arm64/include/asm/uaccess.h:169 [inline] mISDN_ioctl+0x7d4/0x9d4 drivers/isdn/mISDN/timerdev.c:241 access_ok arch/arm64/include/asm/uaccess.h:45 [inline] mISDN_ioctl+0x790/0x9d4 drivers/isdn/mISDN/timerdev.c:241 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:893 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0xc4/0x124 mm/memory.c:6705 _inline_copy_to_user include/linux/uaccess.h:183 [inline] copy_to_user include/linux/uaccess.h:214 [inline] fiemap_fill_next_extent+0x1b4/0x424 fs/ioctl.c:145 ocfs2_fiemap+0x7b8/0xc78 fs/ocfs2/extent_map.c:796 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1d70/0x2a90 fs/ioctl.c:841 __do_sys_ioctl fs/ioctl.c:905 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:893 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 -> #0 (&oi->ip_alloc_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 down_write+0x50/0xc0 kernel/locking/rwsem.c:1577 ocfs2_page_mkwrite+0x368/0xdd8 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x140/0x2dc mm/memory.c:3162 wp_page_shared mm/memory.c:3563 [inline] do_wp_page+0x1fc8/0x3a54 mm/memory.c:3713 handle_pte_fault mm/memory.c:5771 [inline] __handle_mm_fault+0x1338/0x66c0 mm/memory.c:5898 handle_mm_fault+0x29c/0x8b4 mm/memory.c:6066 do_page_fault+0x570/0x10a8 arch/arm64/mm/fault.c:690 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:919 el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:432 el1h_64_sync_handler+0x60/0xcc arch/arm64/kernel/entry-common.c:510 el1h_64_sync+0x6c/0x70 arch/arm64/kernel/entry.S:595 __uaccess_mask_ptr arch/arm64/include/asm/uaccess.h:169 [inline] mISDN_ioctl+0x7d4/0x9d4 drivers/isdn/mISDN/timerdev.c:241 access_ok arch/arm64/include/asm/uaccess.h:45 [inline] mISDN_ioctl+0x790/0x9d4 drivers/isdn/mISDN/timerdev.c:241 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:893 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> &mm->mmap_lock --> sb_pagefaults#5 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#5); lock(&mm->mmap_lock); lock(sb_pagefaults#5); lock(&oi->ip_alloc_sem); *** DEADLOCK *** 3 locks held by syz.3.396/8037: #0: ffff800091e49208 (mISDN_mutex){+.+.}-{3:3}, at: mISDN_ioctl+0xa4/0x9d4 drivers/isdn/mISDN/timerdev.c:226 #1: ffff0000d8fdf188 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #1: ffff0000d8fdf188 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:6103 [inline] #1: ffff0000d8fdf188 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x38/0x2d8 mm/memory.c:6163 #2: ffff0000f6384518 (sb_pagefaults#5){.+.+}-{0:0}, at: do_page_mkwrite+0x140/0x2dc mm/memory.c:3162 stack backtrace: CPU: 1 UID: 0 PID: 8037 Comm: syz.3.396 Not tainted 6.12.0-rc4-syzkaller-g526116b79e8c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x154/0x1c0 kernel/locking/lockdep.c:2074 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 down_write+0x50/0xc0 kernel/locking/rwsem.c:1577 ocfs2_page_mkwrite+0x368/0xdd8 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x140/0x2dc mm/memory.c:3162 wp_page_shared mm/memory.c:3563 [inline] do_wp_page+0x1fc8/0x3a54 mm/memory.c:3713 handle_pte_fault mm/memory.c:5771 [inline] __handle_mm_fault+0x1338/0x66c0 mm/memory.c:5898 handle_mm_fault+0x29c/0x8b4 mm/memory.c:6066 do_page_fault+0x570/0x10a8 arch/arm64/mm/fault.c:690 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:919 el1_abort+0x3c/0x5c arch/arm64/kernel/entry-common.c:432 el1h_64_sync_handler+0x60/0xcc arch/arm64/kernel/entry-common.c:510 el1h_64_sync+0x6c/0x70 arch/arm64/kernel/entry.S:595 __uaccess_mask_ptr arch/arm64/include/asm/uaccess.h:169 [inline] (P) mISDN_ioctl+0x7d4/0x9d4 drivers/isdn/mISDN/timerdev.c:241 (P) access_ok arch/arm64/include/asm/uaccess.h:45 [inline] (L) mISDN_ioctl+0x790/0x9d4 drivers/isdn/mISDN/timerdev.c:241 (L) vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:893 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600