syzbot


possible deadlock in reiserfs_dirty_inode

Status: upstream: reported C repro on 2023/04/06 01:23
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+8686c078f78a397d8fcc@syzkaller.appspotmail.com
First crash: 438d, last: 52d
Fix bisection: failed (error log, bisect log)
  
Bug presence (1)
Date Name Commit Repro Result
2023/08/25 upstream (ToT) 4f9e7fabf864 C [report] UBSAN: array-index-out-of-bounds in direntry_create_vi
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in reiserfs_dirty_inode origin:upstream C 28 32d 455d 0/3 upstream: reported C repro on 2023/03/19 20:48
linux-4.19 possible deadlock in reiserfs_dirty_inode reiserfs 2 488d 569d 0/1 upstream: reported on 2022/11/25 09:22
upstream possible deadlock in reiserfs_dirty_inode reiserfs C done done 519 138d 566d 26/27 fixed on 2024/03/20 11:33
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/05/30 17:16 13m bisect fix linux-6.1.y error job log (0)
2024/04/11 10:18 2h49m bisect fix linux-6.1.y job log (0) log
2024/03/10 04:38 1h38m bisect fix linux-6.1.y job log (0) log

Sample crash report:
REISERFS warning (device loop0): super-6502 reiserfs_getopt: unknown mount option "’’’’’’’’ī§<< G4š¶mRŸ±ā½ĘuĘĢėź0ŗ‰w/™^£ąķł†¶Žę"
======================================================
WARNING: possible circular locking dependency detected
6.1.46-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor305/3511 is trying to acquire lock:
ffff88807e8e53d8 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x8f/0x110 mm/memory.c:5800

but task is already holding lock:
ffff888017ee5090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x76/0xd0 fs/reiserfs/lock.c:27

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->lock){+.+.}-{3:3}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
       __mutex_lock_common+0x1d4/0x2520 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
       reiserfs_write_lock+0x76/0xd0 fs/reiserfs/lock.c:27
       reiserfs_dirty_inode+0xee/0x240 fs/reiserfs/super.c:704
       __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2411
       generic_update_time fs/inode.c:1901 [inline]
       inode_update_time fs/inode.c:1914 [inline]
       __file_update_time+0x221/0x240 fs/inode.c:2102
       file_update_time+0x34c/0x3c0 fs/inode.c:2133
       filemap_page_mkwrite+0x275/0x630 mm/filemap.c:3422
       do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:2982
       wp_page_shared+0x164/0x380 mm/memory.c:3331
       handle_pte_fault mm/memory.c:5001 [inline]
       __handle_mm_fault mm/memory.c:5125 [inline]
       handle_mm_fault+0x2522/0x5330 mm/memory.c:5246
       do_user_addr_fault arch/x86/mm/fault.c:1380 [inline]
       handle_page_fault arch/x86/mm/fault.c:1471 [inline]
       exc_page_fault+0x26f/0x660 arch/x86/mm/fault.c:1527
       asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570

-> #1 (sb_pagefaults){.+.+}-{0:0}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1832 [inline]
       sb_start_pagefault include/linux/fs.h:1936 [inline]
       filemap_page_mkwrite+0x16a/0x630 mm/filemap.c:3421
       do_page_mkwrite+0x1a1/0x5f0 mm/memory.c:2982
       do_shared_fault mm/memory.c:4647 [inline]
       do_fault mm/memory.c:4715 [inline]
       handle_pte_fault mm/memory.c:4983 [inline]
       __handle_mm_fault mm/memory.c:5125 [inline]
       handle_mm_fault+0x22e8/0x5330 mm/memory.c:5246
       do_user_addr_fault arch/x86/mm/fault.c:1380 [inline]
       handle_page_fault arch/x86/mm/fault.c:1471 [inline]
       exc_page_fault+0x26f/0x660 arch/x86/mm/fault.c:1527
       asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570

-> #0 (&mm->mmap_lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3098 [inline]
       check_prevs_add kernel/locking/lockdep.c:3217 [inline]
       validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
       __might_fault+0xb2/0x110 mm/memory.c:5801
       reiserfs_ioctl+0x11d/0x340 fs/reiserfs/ioctl.c:96
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
  &mm->mmap_lock --> sb_pagefaults --> &sbi->lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->lock);
                               lock(sb_pagefaults);
                               lock(&sbi->lock);
  lock(&mm->mmap_lock);

 *** DEADLOCK ***

1 lock held by syz-executor305/3511:
 #0: ffff888017ee5090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x76/0xd0 fs/reiserfs/lock.c:27

stack backtrace:
CPU: 0 PID: 3511 Comm: syz-executor305 Not tainted 6.1.46-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3098 [inline]
 check_prevs_add kernel/locking/lockdep.c:3217 [inline]
 validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
 __might_fault+0xb2/0x110 mm/memory.c:5801
 reiserfs_ioctl+0x11d/0x340 fs/reiserfs/ioctl.c:96
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff6b3b91689
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 1a 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffeaaa746d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff6b3b91689
RDX: 0000000020000000 RSI: 0000000080087601 RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 00e68eb686f904ed R11: 0000000000000246 R12: 00007ffeaaa747e0
R13: 00007ffeaaa748c0 R14: 431bde82d7b634db R15: 00007ff6b3bd301d
 </TASK>

Crashes (36):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/08/23 16:13 linux-6.1.y 6c44e13dc284 b81ca3f6 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/12/13 16:13 linux-6.1.y e7cddbb41b63 ebcad15c .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/09/27 00:06 linux-6.1.y d23900f974e0 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/09/23 03:51 linux-6.1.y a356197db198 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2024/04/25 20:47 linux-6.1.y 6741e066ec76 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2024/02/01 01:30 linux-6.1.y e5c3b988b827 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2024/01/31 13:14 linux-6.1.y 883d1a956208 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2024/01/08 20:54 linux-6.1.y 38fb82ecd144 4c0fd4bb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/12/11 03:20 linux-6.1.y 6c6a6c7e211c 28b24332 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/11/23 18:07 linux-6.1.y 69e434a1cb21 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/11/23 09:39 linux-6.1.y 69e434a1cb21 fc59b78e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/11/22 19:04 linux-6.1.y 69e434a1cb21 03e12510 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/11/09 18:26 linux-6.1.y fb2635ac69ab 56230772 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/11/08 17:29 linux-6.1.y fb2635ac69ab b93f63e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/10/24 04:18 linux-6.1.y 7d24402875c7 af8d2e46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/09/04 16:59 linux-6.1.y c2cbfe5f5122 db3306a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/06/29 04:01 linux-6.1.y a1c449d00ff8 ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/06/05 18:53 linux-6.1.y 76ba310227d2 a4ae4f42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/05/05 02:05 linux-6.1.y ca48fc16c493 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/05/04 01:11 linux-6.1.y ca48fc16c493 b5918830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/05/03 17:00 linux-6.1.y ca48fc16c493 b5918830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/04/24 18:55 linux-6.1.y f17b0ab65d17 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in reiserfs_dirty_inode
2023/08/21 06:16 linux-6.1.y 6c44e13dc284 d216d8a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/07/25 14:23 linux-6.1.y 5302e81aa209 3b91ad04 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/07/13 02:52 linux-6.1.y 61fd484b2cf6 86081196 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/06/21 02:01 linux-6.1.y ca87e77a2ef8 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/06/16 08:19 linux-6.1.y ca87e77a2ef8 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/06/15 02:15 linux-6.1.y ca87e77a2ef8 76decb82 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/06/12 19:59 linux-6.1.y 2f3918bc53fb aaed0183 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/05/16 06:23 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/05/15 05:14 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/04/23 19:41 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/04/18 00:47 linux-6.1.y 0102425ac76b 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/04/10 02:02 linux-6.1.y 543aff194ab6 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/04/06 13:57 linux-6.1.y 543aff194ab6 08707520 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
2023/04/06 01:22 linux-6.1.y 3b29299e5f60 8b834965 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in reiserfs_dirty_inode
* Struck through repros no longer work on HEAD.