syzbot


possible deadlock in page_cache_ra_unbounded

Status: upstream: reported C repro on 2022/12/21 08:15
Subsystems: reiserfs
[Documentation on labels]
Reported-by: syzbot+47c7e14e1bd09234d0ad@syzkaller.appspotmail.com
First crash: 525d, last: 1d21h
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] possible deadlock in page_cache_ra_unbounded 0 (2) 2023/06/26 23:27
Last patch testing requests (6)
Created Duration User Patch Repo Result
2024/03/23 11:52 22m retest repro upstream error OK
2024/02/12 20:16 23m retest repro upstream OK log
2024/01/24 08:15 47m retest repro upstream OK log
2024/01/08 14:36 16m retest repro upstream report log
2023/11/11 03:36 25m retest repro upstream report log
2023/08/30 10:55 22m retest repro upstream report log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/11/30 21:01 1h22m bisect fix upstream job log (0) log
2023/10/07 02:00 1h21m bisect fix upstream job log (0) log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.7.0-rc7-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor128/5233 is trying to acquire lock:
ffff888020dd6090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock_nested+0x69/0xe0 fs/reiserfs/lock.c:78

but task is already holding lock:
ffff8880704a56c0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:857 [inline]
ffff8880704a56c0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x13a/0x5f0 mm/readahead.c:225

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (mapping.invalidate_lock#3){.+.+}-{3:3}:
       down_read+0x9a/0x330 kernel/locking/rwsem.c:1526
       filemap_invalidate_lock_shared include/linux/fs.h:857 [inline]
       page_cache_ra_unbounded+0x13a/0x5f0 mm/readahead.c:225
       do_page_cache_ra mm/readahead.c:299 [inline]
       page_cache_ra_order+0x72b/0xa80 mm/readahead.c:546
       do_sync_mmap_readahead mm/filemap.c:3141 [inline]
       filemap_fault+0x16a8/0x3570 mm/filemap.c:3233
       __do_fault+0x107/0x600 mm/memory.c:4266
       do_shared_fault mm/memory.c:4693 [inline]
       do_fault mm/memory.c:4767 [inline]
       do_pte_missing mm/memory.c:3731 [inline]
       handle_pte_fault mm/memory.c:5039 [inline]
       __handle_mm_fault+0x29a9/0x3d70 mm/memory.c:5180
       handle_mm_fault+0x47a/0xa10 mm/memory.c:5345
       do_user_addr_fault+0x3d1/0x1000 arch/x86/mm/fault.c:1413
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
       __put_user_4+0x11/0x20 arch/x86/lib/putuser.S:86
       reiserfs_ioctl+0x1f6/0x2e0 fs/reiserfs/ioctl.c:96
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:871 [inline]
       __se_sys_ioctl fs/ioctl.c:857 [inline]
       __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

-> #0 (&sbi->lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137
       lock_acquire kernel/locking/lockdep.c:5754 [inline]
       lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747
       reiserfs_write_lock_nested+0x69/0xe0 fs/reiserfs/lock.c:78
       reiserfs_cond_resched fs/reiserfs/reiserfs.h:848 [inline]
       reiserfs_cond_resched fs/reiserfs/reiserfs.h:841 [inline]
       search_by_key+0x26ae/0x3e60 fs/reiserfs/stree.c:712
       search_for_position_by_key+0xe4/0xd50 fs/reiserfs/stree.c:874
       _get_block_create_0+0x2b9/0x1ba0 fs/reiserfs/inode.c:305
       reiserfs_get_block+0x2c7e/0x4570 fs/reiserfs/inode.c:695
       do_mpage_readpage+0x6f8/0x1a90 fs/mpage.c:233
       mpage_readahead+0x34d/0x590 fs/mpage.c:381
       read_pages+0x1d1/0xdc0 mm/readahead.c:160
       page_cache_ra_unbounded+0x457/0x5f0 mm/readahead.c:269
       do_page_cache_ra mm/readahead.c:299 [inline]
       page_cache_ra_order+0x72b/0xa80 mm/readahead.c:546
       do_sync_mmap_readahead mm/filemap.c:3141 [inline]
       filemap_fault+0x16a8/0x3570 mm/filemap.c:3233
       __do_fault+0x107/0x600 mm/memory.c:4266
       do_shared_fault mm/memory.c:4693 [inline]
       do_fault mm/memory.c:4767 [inline]
       do_pte_missing mm/memory.c:3731 [inline]
       handle_pte_fault mm/memory.c:5039 [inline]
       __handle_mm_fault+0x29a9/0x3d70 mm/memory.c:5180
       handle_mm_fault+0x47a/0xa10 mm/memory.c:5345
       do_user_addr_fault+0x3d1/0x1000 arch/x86/mm/fault.c:1413
       handle_page_fault arch/x86/mm/fault.c:1505 [inline]
       exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
       __put_user_4+0x11/0x20 arch/x86/lib/putuser.S:86
       reiserfs_ioctl+0x1f6/0x2e0 fs/reiserfs/ioctl.c:96
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:871 [inline]
       __se_sys_ioctl fs/ioctl.c:857 [inline]
       __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(mapping.invalidate_lock#3);
                               lock(&sbi->lock);
                               lock(mapping.invalidate_lock#3);
  lock(&sbi->lock);

 *** DEADLOCK ***

1 lock held by syz-executor128/5233:
 #0: ffff8880704a56c0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:857 [inline]
 #0: ffff8880704a56c0 (mapping.invalidate_lock#3){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x13a/0x5f0 mm/readahead.c:225

stack backtrace:
CPU: 0 PID: 5233 Comm: syz-executor128 Not tainted 6.7.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 check_noncircular+0x317/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747
 reiserfs_write_lock_nested+0x69/0xe0 fs/reiserfs/lock.c:78
 reiserfs_cond_resched fs/reiserfs/reiserfs.h:848 [inline]
 reiserfs_cond_resched fs/reiserfs/reiserfs.h:841 [inline]
 search_by_key+0x26ae/0x3e60 fs/reiserfs/stree.c:712
 search_for_position_by_key+0xe4/0xd50 fs/reiserfs/stree.c:874
 _get_block_create_0+0x2b9/0x1ba0 fs/reiserfs/inode.c:305
 reiserfs_get_block+0x2c7e/0x4570 fs/reiserfs/inode.c:695
 do_mpage_readpage+0x6f8/0x1a90 fs/mpage.c:233
 mpage_readahead+0x34d/0x590 fs/mpage.c:381
 read_pages+0x1d1/0xdc0 mm/readahead.c:160
 page_cache_ra_unbounded+0x457/0x5f0 mm/readahead.c:269
 do_page_cache_ra mm/readahead.c:299 [inline]
 page_cache_ra_order+0x72b/0xa80 mm/readahead.c:546
 do_sync_mmap_readahead mm/filemap.c:3141 [inline]
 filemap_fault+0x16a8/0x3570 mm/filemap.c:3233
 __do_fault+0x107/0x600 mm/memory.c:4266
 do_shared_fault mm/memory.c:4693 [inline]
 do_fault mm/memory.c:4767 [inline]
 do_pte_missing mm/memory.c:3731 [inline]
 handle_pte_fault mm/memory.c:5039 [inline]
 __handle_mm_fault+0x29a9/0x3d70 mm/memory.c:5180
 handle_mm_fault+0x47a/0xa10 mm/memory.c:5345
 do_user_addr_fault+0x3d1/0x1000 arch/x86/mm/fault.c:1413
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0010:__put_user_4+0x11/0x20 arch/x86/lib/putuser.S:88
Code: 01 ca c3 66 0f 1f 44 00 00 f3 0f 1e fa 0f 01 cb 66 89 01 31 c9 0f 01 ca c3 f3 0f 1e fa 48 89 cb 48 c1 fb 3f 48 09 d9 0f 01 cb <89> 01 31 c9 0f 01 ca c3 0f 1f 80 00 00 00 00 f3 0f 1e fa 0f 01 cb
RSP: 0018:ffffc90002fdfec0 EFLAGS: 00050206
RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000020000000
RDX: 1ffff1100e094b07 RSI: ffffffff822acf84 RDI: ffff8880704a5838
RBP: ffff8880704a53d0 R08: 0000000000000000 R09: fffffbfff1e30e0a
R10: ffffffff8f187057 R11: 0000000000000001 R12: ffff888019716a40
R13: 0000000020000000 R14: ffff8880704a53f8 R15: 0000000000000005
 reiserfs_ioctl+0x1f6/0x2e0 fs/reiserfs/ioctl.c:96
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl fs/ioctl.c:857 [inline]
 __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f7a063751a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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:00007ffcc51660e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7a063751a9
RDX: 0000000020000000 RSI: 0000000080087601 RDI: 0000000000000005
RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcc5166140
R13: 00007ffcc5166180 R14: 0000000000400000 R15: 0000000000000003
 </TASK>
----------------
Code disassembly (best guess):
   0:	01 ca                	add    %ecx,%edx
   2:	c3                   	ret
   3:	66 0f 1f 44 00 00    	nopw   0x0(%rax,%rax,1)
   9:	f3 0f 1e fa          	endbr64
   d:	0f 01 cb             	stac
  10:	66 89 01             	mov    %ax,(%rcx)
  13:	31 c9                	xor    %ecx,%ecx
  15:	0f 01 ca             	clac
  18:	c3                   	ret
  19:	f3 0f 1e fa          	endbr64
  1d:	48 89 cb             	mov    %rcx,%rbx
  20:	48 c1 fb 3f          	sar    $0x3f,%rbx
  24:	48 09 d9             	or     %rbx,%rcx
  27:	0f 01 cb             	stac
* 2a:	89 01                	mov    %eax,(%rcx) <-- trapping instruction
  2c:	31 c9                	xor    %ecx,%ecx
  2e:	0f 01 ca             	clac
  31:	c3                   	ret
  32:	0f 1f 80 00 00 00 00 	nopl   0x0(%rax)
  39:	f3 0f 1e fa          	endbr64
  3d:	0f 01 cb             	stac

Crashes (43):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/25 14:00 upstream 861deac3b092 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-selinux-root possible deadlock in page_cache_ra_unbounded
2023/10/11 09:46 upstream 1c8b86a3799f 83165b57 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2023/06/26 23:25 upstream c0a572d9d32f 4cd5bb25 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root possible deadlock in page_cache_ra_unbounded
2024/05/04 01:24 upstream 3d25a941ea50 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in page_cache_ra_unbounded
2024/05/03 23:05 upstream 3d25a941ea50 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2024/05/03 10:24 upstream f03359bca01b 375d4445 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2024/05/03 10:06 upstream f03359bca01b 375d4445 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2024/05/02 20:42 upstream 49a73b1652c5 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in page_cache_ra_unbounded
2024/05/02 20:42 upstream 49a73b1652c5 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in page_cache_ra_unbounded
2024/05/02 20:27 upstream 49a73b1652c5 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2024/05/02 00:31 upstream 0106679839f7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2024/04/24 18:00 upstream 9d1ddab261f3 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in page_cache_ra_unbounded
2024/04/24 18:00 upstream 9d1ddab261f3 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in page_cache_ra_unbounded
2024/04/23 10:27 upstream 4d2008430ce8 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in page_cache_ra_unbounded
2024/02/19 07:05 upstream b401b621758e 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2024/01/29 11:35 upstream 41bccc98fb79 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/10/28 02:57 upstream 750b95887e56 3c418d72 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/10/16 05:25 upstream fbe1bf1e5ff1 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/10/14 05:31 upstream 8cb1f10d8c4b f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/10/12 23:03 upstream 401644852d0b fc170927 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in page_cache_ra_unbounded
2024/05/27 17:30 upstream 2bfcfd584ff5 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2024/05/16 12:45 upstream 3c999d1ae3c7 ef5d53ed .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2024/05/15 10:34 upstream 1b294a1f3561 7e8e0c0f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2024/05/12 19:03 upstream ba16c1cf11c9 9026e142 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2024/05/11 13:30 upstream cf87f46fd34d 9026e142 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2024/05/02 18:52 upstream 49a73b1652c5 22ee48a2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2023/10/22 17:14 upstream 1acfd2bd3f0d 361b23dc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in page_cache_ra_unbounded
2024/04/24 19:20 upstream e88c4cfcb7b8 a604cf37 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in page_cache_ra_unbounded
2024/04/24 03:22 upstream 9d1ddab261f3 21339d7b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in page_cache_ra_unbounded
2023/08/08 22:36 upstream 14f9643dc90a 9552ae77 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/07/04 03:46 upstream a901a3568fd2 6e553898 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/06/24 18:38 upstream a92b7d26c743 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in page_cache_ra_unbounded
2023/06/22 10:25 upstream dad9774deaf1 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2023/04/19 05:09 upstream af67688dca57 d931e9f0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2022/12/27 13:13 upstream 1b929c02afd3 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2022/12/23 10:23 upstream 8395ae05cb5a 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2022/12/20 22:39 upstream 6feb57c2fd7c d3e76707 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in page_cache_ra_unbounded
2024/05/09 09:49 linux-next 704ba27ac555 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in page_cache_ra_unbounded
2024/04/28 18:41 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6a71d2909427 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in page_cache_ra_unbounded
2024/04/26 23:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6a71d2909427 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in page_cache_ra_unbounded
2024/04/26 23:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6a71d2909427 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in page_cache_ra_unbounded
2024/04/26 23:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6a71d2909427 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in page_cache_ra_unbounded
* Struck through repros no longer work on HEAD.