================================================================== BUG: KCSAN: data-race in drain_all_stock / try_charge_memcg write to 0xffff888237c2a690 of 4 bytes by task 9287 on cpu 0: consume_stock mm/memcontrol.c:2317 [inline] try_charge_memcg+0xb46/0xd20 mm/memcontrol.c:2723 try_charge mm/memcontrol.c:2904 [inline] charge_memcg mm/memcontrol.c:7241 [inline] __mem_cgroup_charge+0x63/0xf0 mm/memcontrol.c:7256 mem_cgroup_charge include/linux/memcontrol.h:690 [inline] __filemap_add_folio+0x135/0x730 mm/filemap.c:855 filemap_add_folio+0x70/0x160 mm/filemap.c:938 __filemap_get_folio+0x2f1/0x5a0 mm/filemap.c:1927 ext4_da_write_begin+0x2eb/0x550 fs/ext4/inode.c:2891 generic_perform_write+0x1c9/0x410 mm/filemap.c:3930 ext4_buffered_write_iter+0x1f6/0x370 fs/ext4/file.c:299 ext4_file_write_iter+0x297/0xe10 __kernel_write_iter+0x25f/0x480 fs/read_write.c:523 dump_emit_page fs/coredump.c:888 [inline] dump_user_range+0x25d/0x480 fs/coredump.c:915 elf_core_dump+0x1a85/0x1ba0 fs/binfmt_elf.c:2077 do_coredump+0x102a/0x1890 fs/coredump.c:764 get_signal+0xdb5/0x10a0 kernel/signal.c:2879 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x98/0x130 kernel/entry/common.c:225 irqentry_exit+0x12/0x40 kernel/entry/common.c:328 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 read to 0xffff888237c2a690 of 4 bytes by task 9304 on cpu 1: drain_all_stock+0xd3/0x2e0 mm/memcontrol.c:2425 try_charge_memcg+0x6c2/0xd20 mm/memcontrol.c:2770 obj_cgroup_charge_pages+0xbd/0x1c0 mm/memcontrol.c:3275 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3301 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4584 alloc_pages_mpol+0xb1/0x1d0 mm/mempolicy.c:2133 alloc_pages+0xe0/0x100 mm/mempolicy.c:2204 vm_area_alloc_pages mm/vmalloc.c:3063 [inline] __vmalloc_area_node mm/vmalloc.c:3139 [inline] __vmalloc_node_range+0x6d2/0xea0 mm/vmalloc.c:3320 kvmalloc_node+0x121/0x160 mm/util.c:642 kvmalloc include/linux/slab.h:728 [inline] xt_alloc_table_info+0x3d/0x80 net/netfilter/x_tables.c:1192 do_replace net/ipv4/netfilter/arp_tables.c:970 [inline] do_arpt_set_ctl+0x634/0x13b0 net/ipv4/netfilter/arp_tables.c:1421 nf_setsockopt+0x18d/0x1b0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xe6/0x100 net/ipv4/ip_sockglue.c:1418 tcp_setsockopt+0x90/0xa0 net/ipv4/tcp.c:3723 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3715 do_sock_setsockopt net/socket.c:2311 [inline] __sys_setsockopt+0x1d4/0x240 net/socket.c:2334 __do_sys_setsockopt net/socket.c:2343 [inline] __se_sys_setsockopt net/socket.c:2340 [inline] __x64_sys_setsockopt+0x66/0x80 net/socket.c:2340 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x59/0x120 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b value changed: 0x00000025 -> 0x00000023 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 9304 Comm: syz-executor.0 Not tainted 6.8.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 ==================================================================