syzbot


KCSAN: data-race in __mod_memcg_lruvec_state / rebind_subsystems

Status: moderation: reported on 2024/05/23 05:59
Subsystems: cgroups
[Documentation on labels]
Reported-by: syzbot+50b9e23cf39a956e10ba@syzkaller.appspotmail.com
First crash: 24d, last: 24d

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

write to 0xffff888100149000 of 8 bytes by task 3086 on cpu 0:
 rebind_subsystems+0x44d/0x9b0 kernel/cgroup/cgroup.c:1842
 cgroup_setup_root+0x1ea/0x560 kernel/cgroup/cgroup.c:2117
 cgroup1_root_to_use kernel/cgroup/cgroup-v1.c:1224 [inline]
 cgroup1_get_tree+0x54e/0x840 kernel/cgroup/cgroup-v1.c:1244
 vfs_get_tree+0x56/0x1d0 fs/super.c:1780
 do_new_mount+0x227/0x690 fs/namespace.c:3352
 path_mount+0x49b/0xb30 fs/namespace.c:3679
 do_mount fs/namespace.c:3692 [inline]
 __do_sys_mount fs/namespace.c:3898 [inline]
 __se_sys_mount+0x27f/0x2d0 fs/namespace.c:3875
 __x64_sys_mount+0x67/0x80 fs/namespace.c:3875
 x64_sys_call+0x2591/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:166
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888100149000 of 8 bytes by task 3098 on cpu 1:
 memcg_rstat_updated mm/memcontrol.c:855 [inline]
 __mod_memcg_lruvec_state+0xe4/0x220 mm/memcontrol.c:1029
 __mod_lruvec_state+0x3c/0x50 mm/memcontrol.c:1051
 __update_lru_size include/linux/mm_inline.h:47 [inline]
 update_lru_size include/linux/mm_inline.h:56 [inline]
 lruvec_del_folio include/linux/mm_inline.h:356 [inline]
 __page_cache_release+0x2fa/0x4a0 mm/swap.c:82
 folios_put_refs+0x15e/0x2b0 mm/swap.c:1009
 free_pages_and_swap_cache+0x289/0x400 mm/swap_state.c:329
 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline]
 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:366 [inline]
 tlb_flush_mmu+0x2cf/0x440 mm/mmu_gather.c:373
 tlb_finish_mmu+0x8c/0x100 mm/mmu_gather.c:465
 exit_mmap+0x2b7/0x710 mm/mmap.c:3325
 __mmput+0x28/0x1c0 kernel/fork.c:1346
 mmput+0x4c/0x60 kernel/fork.c:1368
 exit_mm+0xe4/0x190 kernel/exit.c:568
 do_exit+0x57e/0x1740 kernel/exit.c:864
 do_group_exit+0x142/0x150 kernel/exit.c:1026
 __do_sys_exit_group kernel/exit.c:1037 [inline]
 __se_sys_exit_group kernel/exit.c:1035 [inline]
 __x64_sys_exit_group+0x1f/0x20 kernel/exit.c:1035
 x64_sys_call+0x27c1/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0xffffffff8614d5c0 -> 0xffff88810b6de040

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3098 Comm: dhcpcd Not tainted 6.9.0-syzkaller-10713-g2a8120d7b482 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
==================================================================
dhcpcd (3098) used greatest stack depth: 11336 bytes left

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/23 05:59 upstream 2a8120d7b482 4d098039 .config console log report [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __mod_memcg_lruvec_state / rebind_subsystems
* Struck through repros no longer work on HEAD.