syzbot


WARNING: suspicious RCU usage in bch2_fs_quota_read

Status: fixed on 2024/06/05 13:52
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+a3a9a61224ed3b7f0010@syzkaller.appspotmail.com
Fix commit: 8060bf1d83f7 bcachefs: Fix snapshot_t() usage in bch2_fs_quota_read_inode()
First crash: 72d, last: 41d
Cause bisection: introduced by (bisect log) :
commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Sat Sep 23 22:41:51 2023 +0000

  bcachefs: Ignore unknown mount options

Crash: WARNING: suspicious RCU usage in bch2_fs_quota_read (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] [ext4?] WARNING: suspicious RCU usage in bch2_fs_quota_read 0 (2) 2024/05/05 20:59

Sample crash report:
bcachefs (loop0): mounting version 1.7: mi_btree_bitmap opts=compression=lz4,prjquota,nodiscard,norecovery,nojournal_transaction_names
bcachefs (loop0): recovering from clean shutdown, journal seq 7
bcachefs (loop0): alloc_read... done
bcachefs (loop0): stripes_read... done
bcachefs (loop0): snapshots_read... done
bcachefs (loop0): reading quotas
=============================
WARNING: suspicious RCU usage
6.9.0-rc6-syzkaller-00234-g7367539ad4b0 #0 Not tainted
-----------------------------
fs/bcachefs/snapshot.h:45 suspicious rcu_dereference_check() usage!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
4 locks held by syz-executor879/5077:
 #0: ffff888074000278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_start+0x45/0x5b0 fs/bcachefs/super.c:1013
 #1: ffff888074004250 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:116 [inline]
 #1: ffff888074004250 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:215 [inline]
 #1: ffff888074004250 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x8c8/0xc90 fs/bcachefs/btree_iter.c:3069
 #2: ffff88802c42d070 (&dev->mutex){....}-{3:3}, at: six_trylock_type fs/bcachefs/six.h:207 [inline]
 #2: ffff88802c42d070 (&dev->mutex){....}-{3:3}, at: btree_node_lock fs/bcachefs/btree_locking.h:266 [inline]
 #2: ffff88802c42d070 (&dev->mutex){....}-{3:3}, at: btree_path_lock_root fs/bcachefs/btree_iter.c:760 [inline]
 #2: ffff88802c42d070 (&dev->mutex){....}-{3:3}, at: bch2_btree_path_traverse_one+0xa85/0x3250 fs/bcachefs/btree_iter.c:1178
 #3: ffff88801bef8870 (&dev->mutex){....}-{3:3}, at: six_trylock_type fs/bcachefs/six.h:207 [inline]
 #3: ffff88801bef8870 (&dev->mutex){....}-{3:3}, at: btree_node_lock fs/bcachefs/btree_locking.h:266 [inline]
 #3: ffff88801bef8870 (&dev->mutex){....}-{3:3}, at: btree_path_lock_root fs/bcachefs/btree_iter.c:760 [inline]
 #3: ffff88801bef8870 (&dev->mutex){....}-{3:3}, at: bch2_btree_path_traverse_one+0xa85/0x3250 fs/bcachefs/btree_iter.c:1178

stack backtrace:
CPU: 0 PID: 5077 Comm: syz-executor879 Not tainted 6.9.0-rc6-syzkaller-00234-g7367539ad4b0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 lockdep_rcu_suspicious+0x221/0x340 kernel/locking/lockdep.c:6712
 snapshot_t fs/bcachefs/snapshot.h:45 [inline]
 bch2_fs_quota_read_inode fs/bcachefs/quota.c:567 [inline]
 bch2_fs_quota_read+0x195e/0x2770 fs/bcachefs/quota.c:613
 bch2_fs_recovery+0x4b25/0x6390 fs/bcachefs/recovery.c:828
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1043
 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2102
 bch2_mount+0x71d/0x1320 fs/bcachefs/fs.c:1903
 legacy_get_tree+0xee/0x190 fs/fs_context.c:662
 vfs_get_tree+0x90/0x2a0 fs/super.c:1779
 do_new_mount+0x2be/0xb40 fs/namespace.c:3352
 do_mount fs/namespace.c:3692 [inline]
 __do_sys_mount fs/namespace.c:3898 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdf4fef3dba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffdd442cdd8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffdd442ce20 RCX: 00007fdf4fef3dba
RDX: 0000000020005d80 RSI: 0000000020005dc0 RDI: 00007ffdd442ce20
RBP: 0000000020005dc0 R08: 00007ffdd442ce60 R09: 0000000000005d58
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000020005d80
R13: 0000000000005d5e R14: 00007ffdd442ce60 R15: 0000000000000004
 </TASK>
bcachefs (loop0): bch2_fs_quota_read_inode: snapshot tree 0 not found
bcachefs (loop0): inconsistency detected - emergency read only at journal seq 7
bcachefs (loop0): bch2_fs_quota_read(): error ENOENT_snapshot_tree
bcachefs (loop0): bch2_fs_recovery(): error ENOENT_snapshot_tree
bcachefs (loop0): bch2_fs_start(): error starting filesystem ENOENT_snapshot_tree
bcachefs (loop0): shutting down
bcachefs (loop0): shutdown complete

Crashes (24):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/05 11:05 upstream 7367539ad4b0 610f2a54 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-upstream-fs WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/04 23:49 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 78186bd77b47 610f2a54 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/07 17:16 upstream dccb07f2914c cb2dcc0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/05 11:12 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/06/04 17:04 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/06/03 03:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/31 08:16 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/31 08:16 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/31 03:24 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/31 03:24 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/31 03:05 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/31 03:05 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/28 12:01 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/28 10:38 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/28 10:38 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/14 09:27 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/14 08:41 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/13 22:19 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/13 06:29 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/12 09:55 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fda5695d692c 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/07 22:57 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 1c9135d29e9e cb2dcc0e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/06 04:16 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 78186bd77b47 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/06 01:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 78186bd77b47 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
2024/05/04 23:35 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 78186bd77b47 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: suspicious RCU usage in bch2_fs_quota_read
* Struck through repros no longer work on HEAD.