syzbot


possible deadlock in reiserfs_get_block

Status: auto-obsoleted due to no activity on 2023/10/05 20:29
Subsystems: reiserfs
[Documentation on labels]
Reported-by: syzbot+8a4c84020c63609f15ec@syzkaller.appspotmail.com
First crash: 527d, last: 337d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [reiserfs?] possible deadlock in reiserfs_get_block 0 (1) 2022/12/23 16:13
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in reiserfs_get_block (2) reiserfs 5 146d 169d 0/26 auto-obsoleted due to no activity on 2024/04/13 20:35

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.4.0-syzkaller-01312-gb19edac5992d #0 Not tainted
------------------------------------------------------
syz-executor.4/25206 is trying to acquire lock:
ffff88802d012e68 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x93/0x120 mm/memory.c:5731

but task is already holding lock:
ffff888064b4d090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/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+0x1e3/0x520 kernel/locking/lockdep.c:5705
       __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799
       reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27
       reiserfs_get_block+0x280/0x5130 fs/reiserfs/inode.c:680
       do_mpage_readpage+0x911/0x1fa0 fs/mpage.c:234
       mpage_readahead+0x454/0x930 fs/mpage.c:382
       read_pages+0x183/0x830 mm/readahead.c:161
       page_cache_ra_unbounded+0x697/0x7c0 mm/readahead.c:270
       page_cache_sync_readahead include/linux/pagemap.h:1211 [inline]
       filemap_get_pages+0x49c/0x20c0 mm/filemap.c:2601
       filemap_splice_read+0x4ce/0xcd0 mm/filemap.c:2930
       splice_direct_to_actor+0x2a8/0x9a0 fs/splice.c:961
       do_splice_direct+0x286/0x3d0 fs/splice.c:1070
       do_sendfile+0x623/0x1070 fs/read_write.c:1254
       __do_sys_sendfile64 fs/read_write.c:1322 [inline]
       __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1308
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #1 (mapping.invalidate_lock#17){.+.+}-{3:3}:
       lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705
       down_read+0x47/0x2f0 kernel/locking/rwsem.c:1520
       filemap_invalidate_lock_shared include/linux/fs.h:826 [inline]
       filemap_fault+0x647/0x1810 mm/filemap.c:3294
       __do_fault+0x136/0x500 mm/memory.c:4176
       do_shared_fault mm/memory.c:4585 [inline]
       do_fault mm/memory.c:4663 [inline]
       do_pte_missing mm/memory.c:3647 [inline]
       handle_pte_fault mm/memory.c:4947 [inline]
       __handle_mm_fault mm/memory.c:5089 [inline]
       handle_mm_fault+0x2098/0x5860 mm/memory.c:5243
       do_user_addr_fault arch/x86/mm/fault.c:1440 [inline]
       handle_page_fault arch/x86/mm/fault.c:1534 [inline]
       exc_page_fault+0x7d2/0x910 arch/x86/mm/fault.c:1590
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

-> #0 (&mm->mmap_lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3113 [inline]
       check_prevs_add kernel/locking/lockdep.c:3232 [inline]
       validate_chain+0x166b/0x58f0 kernel/locking/lockdep.c:3847
       __lock_acquire+0x1316/0x2070 kernel/locking/lockdep.c:5088
       lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705
       __might_fault+0xba/0x120 mm/memory.c:5732
       reiserfs_ioctl+0x124/0x350 fs/reiserfs/ioctl.c:96
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x41/0xc0 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 --> mapping.invalidate_lock#17 --> &sbi->lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&sbi->lock);
                               lock(mapping.invalidate_lock#17);
                               lock(&sbi->lock);
  rlock(&mm->mmap_lock);

 *** DEADLOCK ***

1 lock held by syz-executor.4/25206:
 #0: ffff888064b4d090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7a/0xd0 fs/reiserfs/lock.c:27

stack backtrace:
CPU: 1 PID: 25206 Comm: syz-executor.4 Not tainted 6.4.0-syzkaller-01312-gb19edac5992d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2188
 check_prev_add kernel/locking/lockdep.c:3113 [inline]
 check_prevs_add kernel/locking/lockdep.c:3232 [inline]
 validate_chain+0x166b/0x58f0 kernel/locking/lockdep.c:3847
 __lock_acquire+0x1316/0x2070 kernel/locking/lockdep.c:5088
 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5705
 __might_fault+0xba/0x120 mm/memory.c:5732
 reiserfs_ioctl+0x124/0x350 fs/reiserfs/ioctl.c:96
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f136d88c389
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f136e5e7168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f136d9abf80 RCX: 00007f136d88c389
RDX: 0001000000000000 RSI: 0000000080087601 RDI: 0000000000000004
RBP: 00007f136d8d7493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffef831f58f R14: 00007f136e5e7300 R15: 0000000000022000
 </TASK>

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/27 20:28 upstream b19edac5992d 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/25 20:08 upstream 547cc9be86f4 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/21 10:48 upstream 99ec1ed7c2ed 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/20 01:50 upstream 692b7dc87ca6 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/19 08:47 upstream 45a3e24f65e9 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/18 18:51 upstream 8c1f0c38b310 f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/18 10:27 upstream 1b29d271614a f3921d4d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/15 03:46 upstream b6dad5178cea 76decb82 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/06/11 19:47 upstream 4c605260bc60 49519f06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/05/20 02:18 upstream cbd6ac3837cd 96689200 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/04/27 22:58 upstream 6e98b09da931 6f3d6fa7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2023/01/22 14:58 upstream 2241ab53cbb5 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
2022/12/19 16:07 upstream f9ff5644bcc0 05494336 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in reiserfs_get_block
* Struck through repros no longer work on HEAD.