syzbot


BUG: spinlock bad magic in __percpu_counter_sum

Status: moderation: reported on 2025/05/22 18:08
Subsystems: overlayfs
[Documentation on labels]
Reported-by: syzbot+8438d5251c5448479dad@syzkaller.appspotmail.com
First crash: 5d19h, last: 5d19h

Sample crash report:
overlayfs: missing 'lowerdir'
BUG: spinlock bad magic on CPU#0, syz.5.1359/10894
 lock: 0xffff8880328ac808, .magic: ffff8880, .owner: <none>/-1, .owner_cpu: -1
CPU: 0 UID: 0 PID: 10894 Comm: syz.5.1359 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 spin_bug kernel/locking/spinlock_debug.c:78 [inline]
 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline]
 do_raw_spin_lock+0x1ca/0x290 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xb3/0xf0 kernel/locking/spinlock.c:162
 __percpu_counter_sum+0x2c/0x1e0 lib/percpu_counter.c:177
 percpu_counter_sum include/linux/percpu_counter.h:105 [inline]
 shmem_statfs+0x13d/0x2b0 mm/shmem.c:3815
 statfs_by_dentry fs/statfs.c:66 [inline]
 vfs_statfs+0x147/0x2d0 fs/statfs.c:90
 ovl_check_namelen fs/overlayfs/super.c:388 [inline]
 ovl_get_upper fs/overlayfs/super.c:506 [inline]
 ovl_fill_super+0x788/0x35d0 fs/overlayfs/super.c:1392
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0xbb/0x150 fs/super.c:1299
 vfs_get_tree+0x92/0x2b0 fs/super.c:1759
 do_new_mount+0x24a/0xa40 fs/namespace.c:3881
 do_mount fs/namespace.c:4221 [inline]
 __do_sys_mount fs/namespace.c:4432 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4409
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb8d278e969
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb8d05b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fb8d29b6160 RCX: 00007fb8d278e969
RDX: 0000200000000080 RSI: 00002000000000c0 RDI: 0000000000000000
RBP: 00007fb8d2810ab1 R08: 0000200000000340 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fb8d29b6160 R15: 00007ffe7e429128
 </TASK>
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.h:68:9
index 2858 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 10894 Comm: syz.5.1359 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 ubsan_epilogue+0xa/0x40 lib/ubsan.c:231
 __ubsan_handle_out_of_bounds+0xe9/0xf0 lib/ubsan.c:453
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 __pv_queued_spin_lock_slowpath+0xaaf/0xb60 kernel/locking/qspinlock.c:285
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:572 [inline]
 queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x21f/0x290 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xb3/0xf0 kernel/locking/spinlock.c:162
 __percpu_counter_sum+0x2c/0x1e0 lib/percpu_counter.c:177
 percpu_counter_sum include/linux/percpu_counter.h:105 [inline]
 shmem_statfs+0x13d/0x2b0 mm/shmem.c:3815
 statfs_by_dentry fs/statfs.c:66 [inline]
 vfs_statfs+0x147/0x2d0 fs/statfs.c:90
 ovl_check_namelen fs/overlayfs/super.c:388 [inline]
 ovl_get_upper fs/overlayfs/super.c:506 [inline]
 ovl_fill_super+0x788/0x35d0 fs/overlayfs/super.c:1392
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0xbb/0x150 fs/super.c:1299
 vfs_get_tree+0x92/0x2b0 fs/super.c:1759
 do_new_mount+0x24a/0xa40 fs/namespace.c:3881
 do_mount fs/namespace.c:4221 [inline]
 __do_sys_mount fs/namespace.c:4432 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4409
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb8d278e969
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb8d05b4038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fb8d29b6160 RCX: 00007fb8d278e969
RDX: 0000200000000080 RSI: 00002000000000c0 RDI: 0000000000000000
RBP: 00007fb8d2810ab1 R08: 0000200000000340 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fb8d29b6160 R15: 00007ffe7e429128
 </TASK>
---[ end trace ]---

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/18 17:58 upstream 5723cc3450bc f41472b0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: spinlock bad magic in __percpu_counter_sum
* Struck through repros no longer work on HEAD.