syzbot


WARNING: kmalloc bug in __snapshot_t_mut

Status: fixed on 2024/07/09 19:14
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+770e99b65e26fa023ab1@syzkaller.appspotmail.com
Fix commit: 64cd7de998f3 bcachefs: Fix kmalloc bug in __snapshot_t_mut
First crash: 134d, last: 99d
Cause bisection: introduced by (bisect log) :
commit f7643bc9749f270d487c32dc35b578575bf1adb0
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Wed Apr 17 05:26:02 2024 +0000

  bcachefs: make btree read errors silent during scan

Crash: WARNING: kmalloc bug in __snapshot_t_mut (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] bcachefs: Fix kmalloc bug in __snapshot_t_mut 2 (2) 2024/06/26 00:51
[syzbot] [bcachefs?] WARNING: kmalloc bug in __snapshot_t_mut 0 (2) 2024/06/25 22:35
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/06/25 22:35 19m peili.dev@gmail.com patch upstream OK log

Sample crash report:
bcachefs (loop0): mounting version 1.7: mi_btree_bitmap opts=metadata_checksum=crc64,data_checksum=xxhash,compression=gzip,str_hash=crc64,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...
------------[ cut here ]------------
WARNING: CPU: 1 PID: 5078 at mm/util.c:649 kvmalloc_node_noprof+0x17a/0x190 mm/util.c:649
Modules linked in:
CPU: 1 PID: 5078 Comm: syz-executor347 Not tainted 6.9.0-syzkaller-12398-gc13320499ba0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:kvmalloc_node_noprof+0x17a/0x190 mm/util.c:649
Code: cc 44 89 fe 81 e6 00 20 00 00 31 ff e8 6f 48 be ff 41 81 e7 00 20 00 00 74 0a e8 21 44 be ff e9 3b ff ff ff e8 17 44 be ff 90 <0f> 0b 90 e9 2d ff ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00
RSP: 0018:ffffc90004116c68 EFLAGS: 00010293
RAX: ffffffff81d7d179 RBX: 00000037ffc7c850 RCX: ffff88802d0d9e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff81d7d161 R09: 00000000ffffffff
R10: ffffc90004116b00 R11: fffff52000822d65 R12: ffffc90004116fef
R13: 00000000000100ff R14: 00000000ffffffff R15: 0000000000000000
FS:  000055557a8d2380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005582515a4208 CR3: 0000000011274000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __snapshot_t_mut+0x3c/0x220 fs/bcachefs/snapshot.c:171
 __bch2_mark_snapshot+0x130/0xac0 fs/bcachefs/snapshot.c:310
 bch2_snapshots_read+0x596/0x1680 fs/bcachefs/snapshot.c:1845
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:182
 bch2_run_recovery_passes+0x19e/0x820 fs/bcachefs/recovery_passes.c:225
 bch2_fs_recovery+0x2370/0x3720 fs/bcachefs/recovery.c:807
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1031
 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2123
 bch2_mount+0x71d/0x1310 fs/bcachefs/fs.c:1917
 legacy_get_tree+0xee/0x190 fs/fs_context.c:662
 vfs_get_tree+0x90/0x2a0 fs/super.c:1780
 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+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9cfdd8adea
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:00007ffdd812fab8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffdd812fad0 RCX: 00007f9cfdd8adea
RDX: 0000000020005d80 RSI: 0000000020005dc0 RDI: 00007ffdd812fad0
RBP: 0000000000000004 R08: 00007ffdd812fb10 R09: 0000000000005d64
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000000000000
R13: 00007ffdd812fb10 R14: 0000000000000003 R15: 0000000001000000
 </TASK>

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/26 23:59 upstream c13320499ba0 a10a183e .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs WARNING: kmalloc bug in __snapshot_t_mut
2024/06/08 09:24 upstream 96e09b8f8166 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: kmalloc bug in __snapshot_t_mut
2024/06/06 08:56 upstream 71d7b52cc33b 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: kmalloc bug in __snapshot_t_mut
2024/05/26 23:30 upstream c13320499ba0 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: kmalloc bug in __snapshot_t_mut
2024/05/25 19:26 upstream 56fb6f92854f a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: kmalloc bug in __snapshot_t_mut
2024/06/19 23:50 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING: kmalloc bug in __snapshot_t_mut
2024/05/28 05:59 upstream 2bfcfd584ff5 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 WARNING: kmalloc bug in __snapshot_t_mut
2024/06/29 09:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 5e456a31d1ac 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: kmalloc bug in __snapshot_t_mut
2024/06/15 23:55 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ac2193b4b460 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: kmalloc bug in __snapshot_t_mut
2024/05/30 04:01 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: kmalloc bug in __snapshot_t_mut
* Struck through repros no longer work on HEAD.