syzbot


upstream test error: KCSAN: data-race in __percpu_counter_limited_add / __percpu_counter_limited_add (3)

Status: moderation: reported on 2025/04/14 18:19
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+274ae93c409f71024b04@syzkaller.appspotmail.com
First crash: 11d, last: 11d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream upstream test error: KCSAN: data-race in __percpu_counter_limited_add / __percpu_counter_limited_add (2) mm 1 186d 186d 0/28 auto-obsoleted due to no activity on 2024/12/17 04:16
upstream upstream test error: KCSAN: data-race in __percpu_counter_limited_add / __percpu_counter_limited_add mm 1 250d 250d 0/28 auto-obsoleted due to no activity on 2024/09/23 06:21

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __percpu_counter_limited_add / __percpu_counter_limited_add

write to 0xffff888108baca90 of 8 bytes by task 3790 on cpu 1:
 __percpu_counter_limited_add+0x3e4/0x460 lib/percpu_counter.c:386
 percpu_counter_limited_add include/linux/percpu_counter.h:77 [inline]
 shmem_inode_acct_blocks+0xf5/0x230 mm/shmem.c:233
 shmem_alloc_and_add_folio mm/shmem.c:1923 [inline]
 shmem_get_folio_gfp+0x5a2/0xd30 mm/shmem.c:2533
 shmem_get_folio mm/shmem.c:2639 [inline]
 shmem_write_begin+0xa7/0x190 mm/shmem.c:3289
 generic_perform_write+0x189/0x4b0 mm/filemap.c:4102
 shmem_file_write_iter+0xc2/0xe0 mm/shmem.c:3464
 __kernel_write_iter+0x243/0x4c0 fs/read_write.c:617
 dump_emit_page fs/coredump.c:885 [inline]
 dump_user_range+0x5ed/0x8b0 fs/coredump.c:959
 elf_core_dump+0x1d61/0x1ef0 fs/binfmt_elf.c:2128
 do_coredump+0x1814/0x1f50 fs/coredump.c:759
 get_signal+0xdb7/0x1080 kernel/signal.c:3019
 arch_do_signal_or_restart+0x9a/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 irqentry_exit_to_user_mode+0xa7/0x120 kernel/entry/common.c:231
 irqentry_exit+0x12/0x50 kernel/entry/common.c:334
 asm_exc_alignment_check+0x26/0x30 arch/x86/include/asm/idtentry.h:618

read to 0xffff888108baca90 of 8 bytes by task 3684 on cpu 0:
 __percpu_counter_limited_add+0xfc/0x460 lib/percpu_counter.c:-1
 percpu_counter_limited_add include/linux/percpu_counter.h:77 [inline]
 shmem_inode_acct_blocks+0xf5/0x230 mm/shmem.c:233
 shmem_alloc_and_add_folio mm/shmem.c:1923 [inline]
 shmem_get_folio_gfp+0x5a2/0xd30 mm/shmem.c:2533
 shmem_get_folio mm/shmem.c:2639 [inline]
 shmem_write_begin+0xa7/0x190 mm/shmem.c:3289
 generic_perform_write+0x189/0x4b0 mm/filemap.c:4102
 shmem_file_write_iter+0xc2/0xe0 mm/shmem.c:3464
 __kernel_write_iter+0x243/0x4c0 fs/read_write.c:617
 dump_emit_page fs/coredump.c:885 [inline]
 dump_user_range+0x5ed/0x8b0 fs/coredump.c:959
 elf_core_dump+0x1d61/0x1ef0 fs/binfmt_elf.c:2128
 do_coredump+0x1814/0x1f50 fs/coredump.c:759
 get_signal+0xdb7/0x1080 kernel/signal.c:3019
 arch_do_signal_or_restart+0x9a/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 irqentry_exit_to_user_mode+0xa7/0x120 kernel/entry/common.c:231
 irqentry_exit+0x12/0x50 kernel/entry/common.c:334
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

value changed: 0x00000000000043ef -> 0x0000000000004410

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3684 Comm: syz.3.364 Not tainted 6.15.0-rc2-syzkaller-00037-g834a4a689699 #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================
syz.3.364 (3684) used greatest stack depth: 10440 bytes left

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/14 18:18 upstream 834a4a689699 0bd6db41 .config console log report [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce upstream test error: KCSAN: data-race in __percpu_counter_limited_add / __percpu_counter_limited_add
* Struck through repros no longer work on HEAD.