====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc3-syzkaller-00032-g933174ae28ba #0 Not tainted ------------------------------------------------------ syz-executor.3/28586 is trying to acquire lock: ffff88802a880090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 but task is already holding lock: ffff888023ec8558 (sb_pagefaults#6){.+.+}-{0:0}, at: do_page_mkwrite+0x1a1/0x690 mm/memory.c:2931 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#6){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1494 [inline] sb_start_pagefault include/linux/fs.h:1598 [inline] filemap_page_mkwrite+0x174/0x790 mm/filemap.c:3566 do_page_mkwrite+0x1a1/0x690 mm/memory.c:2931 wp_page_shared mm/memory.c:3280 [inline] do_wp_page+0x356/0x33c0 mm/memory.c:3362 handle_pte_fault mm/memory.c:4964 [inline] __handle_mm_fault+0x1635/0x41c0 mm/memory.c:5089 handle_mm_fault+0x2af/0x9f0 mm/memory.c:5243 do_user_addr_fault+0x51a/0x1210 arch/x86/mm/fault.c:1440 handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault mm/memory.c:5732 [inline] __might_fault+0x115/0x190 mm/memory.c:5725 reiserfs_ioctl+0x1d2/0x330 fs/reiserfs/ioctl.c:96 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xd2/0x260 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2424 generic_update_time+0x21b/0x2b0 fs/inode.c:1859 inode_update_time fs/inode.c:1872 [inline] __file_update_time fs/inode.c:2057 [inline] file_update_time+0x224/0x270 fs/inode.c:2088 filemap_page_mkwrite+0x28c/0x790 mm/filemap.c:3567 do_page_mkwrite+0x1a1/0x690 mm/memory.c:2931 wp_page_shared mm/memory.c:3280 [inline] do_wp_page+0x356/0x33c0 mm/memory.c:3362 handle_pte_fault mm/memory.c:4964 [inline] __handle_mm_fault+0x1635/0x41c0 mm/memory.c:5089 handle_mm_fault+0x2af/0x9f0 mm/memory.c:5243 do_user_addr_fault+0x51a/0x1210 arch/x86/mm/fault.c:1440 handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 other info that might help us debug this: Chain exists of: &sbi->lock --> &mm->mmap_lock --> sb_pagefaults#6 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#6); lock(&mm->mmap_lock); lock(sb_pagefaults#6); lock(&sbi->lock); *** DEADLOCK *** 2 locks held by syz-executor.3/28586: #0: ffff88801ba30ea8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:161 [inline] #0: ffff88801ba30ea8 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault+0x448/0x1210 arch/x86/mm/fault.c:1381 #1: ffff888023ec8558 (sb_pagefaults#6){.+.+}-{0:0}, at: do_page_mkwrite+0x1a1/0x690 mm/memory.c:2931 stack backtrace: CPU: 2 PID: 28586 Comm: syz-executor.3 Not tainted 6.4.0-rc3-syzkaller-00032-g933174ae28ba #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xd2/0x260 fs/reiserfs/super.c:704 __mark_inode_dirty+0x1e0/0xd60 fs/fs-writeback.c:2424 generic_update_time+0x21b/0x2b0 fs/inode.c:1859 inode_update_time fs/inode.c:1872 [inline] __file_update_time fs/inode.c:2057 [inline] file_update_time+0x224/0x270 fs/inode.c:2088 filemap_page_mkwrite+0x28c/0x790 mm/filemap.c:3567 do_page_mkwrite+0x1a1/0x690 mm/memory.c:2931 wp_page_shared mm/memory.c:3280 [inline] do_wp_page+0x356/0x33c0 mm/memory.c:3362 handle_pte_fault mm/memory.c:4964 [inline] __handle_mm_fault+0x1635/0x41c0 mm/memory.c:5089 handle_mm_fault+0x2af/0x9f0 mm/memory.c:5243 do_user_addr_fault+0x51a/0x1210 arch/x86/mm/fault.c:1440 handle_page_fault arch/x86/mm/fault.c:1534 [inline] exc_page_fault+0x98/0x170 arch/x86/mm/fault.c:1590 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fe573286cc5 Code: 12 80 fa 04 73 1e 80 fa 01 77 26 72 05 0f b6 0e 88 0f c3 48 8b 4c 16 f8 48 8b 36 48 89 4c 17 f8 48 89 37 c3 8b 4c 16 fc 8b 36 <89> 4c 17 fc 89 37 c3 0f b7 4c 16 fe 0f b7 36 66 89 4c 17 fe 66 89 RSP: 002b:00007ffd16528358 EFLAGS: 00010202 RAX: 0000000020000000 RBX: 0000000000000000 RCX: 0000000000737562 RDX: 0000000000000006 RSI: 0000000075622f2e RDI: 0000000020000000 RBP: 00007ffd16528418 R08: 00007fe573200000 R09: 00007fe572e00000 R10: 00007fe572e01560 R11: 0000000000000246 R12: 00000000000d325b R13: 00007ffd16528440 R14: 00007fe5733ac050 R15: 0000000000000032