syzbot


KCSAN: data-race in __percpu_counter_limited_add / percpu_counter_add_batch (2)

Status: moderation: reported on 2024/10/28 03:58
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+7e125305db4a27caacd1@syzkaller.appspotmail.com
First crash: 24d, last: 24d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __percpu_counter_limited_add / percpu_counter_add_batch mm 1 337d 337d 0/28 auto-obsoleted due to no activity on 2024/01/23 11:04

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

read-write to 0xffff888114dba490 of 8 bytes by task 9541 on cpu 1:
 percpu_counter_add_batch+0x120/0x140 lib/percpu_counter.c:107
 percpu_counter_add include/linux/percpu_counter.h:71 [inline]
 percpu_counter_sub include/linux/percpu_counter.h:277 [inline]
 shmem_inode_unacct_blocks mm/shmem.c:259 [inline]
 shmem_recalc_inode+0x130/0x1b0 mm/shmem.c:456
 shmem_undo_range+0xa3d/0xa70 mm/shmem.c:1139
 shmem_truncate_range mm/shmem.c:1144 [inline]
 shmem_evict_inode+0x14d/0x530 mm/shmem.c:1272
 evict+0x2f0/0x580 fs/inode.c:725
 iput_final fs/inode.c:1877 [inline]
 iput+0x42a/0x5b0 fs/inode.c:1903
 dentry_unlink_inode+0x24f/0x260 fs/dcache.c:412
 __dentry_kill+0x18b/0x4c0 fs/dcache.c:615
 dput+0x5c/0xd0 fs/dcache.c:857
 __fput+0x3fb/0x6d0 fs/file_table.c:439
 ____fput+0x1c/0x30 fs/file_table.c:459
 task_work_run+0x13a/0x1a0 kernel/task_work.c:239
 exit_task_work include/linux/task_work.h:43 [inline]
 do_exit+0x5dd/0x17f0 kernel/exit.c:939
 do_group_exit+0x102/0x150 kernel/exit.c:1088
 get_signal+0xf2a/0x1070 kernel/signal.c:2917
 arch_do_signal_or_restart+0x95/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:328 [inline]
 irqentry_exit_to_user_mode+0x9a/0x130 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

read to 0xffff888114dba490 of 8 bytes by task 9575 on cpu 0:
 __percpu_counter_limited_add+0xfa/0x450
 percpu_counter_limited_add include/linux/percpu_counter.h:77 [inline]
 shmem_inode_acct_blocks+0xf5/0x230 mm/shmem.c:228
 shmem_alloc_and_add_folio mm/shmem.c:1838 [inline]
 shmem_get_folio_gfp+0x5be/0xd90 mm/shmem.c:2330
 shmem_get_folio mm/shmem.c:2436 [inline]
 shmem_fallocate+0x593/0x860 mm/shmem.c:3477
 vfs_fallocate+0x368/0x3b0 fs/open.c:333
 ksys_fallocate fs/open.c:356 [inline]
 __do_sys_fallocate fs/open.c:364 [inline]
 __se_sys_fallocate fs/open.c:362 [inline]
 __x64_sys_fallocate+0x79/0xc0 fs/open.c:362
 x64_sys_call+0x2783/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:286
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0000000000005756 -> 0x0000000000001e25

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 9575 Comm: syz.4.1563 Not tainted 6.12.0-rc4-syzkaller-00281-g284a2f899676 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/28 03:57 upstream 284a2f899676 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __percpu_counter_limited_add / percpu_counter_add_batch
* Struck through repros no longer work on HEAD.