================================================================== BUG: KCSAN: data-race in drain_all_stock / try_charge_memcg write to 0xffff888237c2a3c0 of 4 bytes by task 23071 on cpu 0: consume_stock mm/memcontrol.c:2297 [inline] try_charge_memcg+0xb49/0xd30 mm/memcontrol.c:2703 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3255 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3281 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4585 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:738 [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:1426 tcp_setsockopt+0x90/0xa0 net/ipv4/tcp.c:3724 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3711 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+0x44/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b read to 0xffff888237c2a3c0 of 4 bytes by task 23076 on cpu 1: drain_all_stock+0xd3/0x2d0 mm/memcontrol.c:2405 try_charge_memcg+0x6c5/0xd30 mm/memcontrol.c:2750 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3255 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3281 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4585 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:738 [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:1426 tcp_setsockopt+0x90/0xa0 net/ipv4/tcp.c:3724 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3711 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+0x44/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b value changed: 0x0000003b -> 0x00000023 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 23076 Comm: syz-executor.1 Not tainted 6.7.0-rc5-syzkaller-00047-g5bd7ef53ffe5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 ================================================================== syz-executor.1 invoked oom-killer: gfp_mask=0x402cc2(GFP_KERNEL_ACCOUNT|__GFP_HIGHMEM|__GFP_NOWARN), order=0, oom_score_adj=1000 CPU: 1 PID: 23076 Comm: syz-executor.1 Not tainted 6.7.0-rc5-syzkaller-00047-g5bd7ef53ffe5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xda/0x130 lib/dump_stack.c:106 dump_stack+0x15/0x20 lib/dump_stack.c:113 dump_header+0x82/0x2d0 mm/oom_kill.c:460 oom_kill_process+0x33a/0x4c0 mm/oom_kill.c:1031 out_of_memory+0x9ca/0xbf0 mm/oom_kill.c:1169 mem_cgroup_out_of_memory+0x139/0x190 mm/memcontrol.c:1791 mem_cgroup_oom mm/memcontrol.c:2021 [inline] try_charge_memcg+0x75c/0xd30 mm/memcontrol.c:2790 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3255 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3281 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4585 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:738 [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:1426 tcp_setsockopt+0x90/0xa0 net/ipv4/tcp.c:3724 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3711 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+0x44/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f07d1466ba9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f07d07e90c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f07d1585f80 RCX: 00007f07d1466ba9 RDX: 0000000000000060 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f07d14b247a R08: 0000000000000438 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f07d1585f80 R15: 00007fffaf03b828 memory: usage 307200kB, limit 307200kB, failcnt 205804 memory+swap: usage 307740kB, limit 9007199254740988kB, failcnt 0 kmem: usage 307196kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz1: cache 4096 rss 0 shmem 0 mapped_file 0 dirty 0 writeback 0 workingset_refault_anon 92099 workingset_refault_file 314 swap 552960 swapcached 0 pgpgin 2002275 pgpgout 2002274 pgfault 2104058 pgmajfault 40681 inactive_anon 0 active_anon 0 inactive_file 0 active_file 4096 unevictable 0 hierarchical_memory_limit 314572800 hierarchical_memsw_limit 9223372036854771712 total_cache 4096 total_rss 0 total_shmem 0 total_mapped_file 0 total_dirty 0 total_writeback 0 total_workingset_refault_anon 92099 total_workingset_refault_file 314 total_swap 552960 total_swapcached 0 total_pgpgin 2002275 total_pgpgout 2002274 total_pgfault 2104058 total_pgmajfault 40681 total_inactive_anon 0 total_active_anon 0 total_inactive_file 0 total_active_file 4096 total_unevictable 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz1,mems_allowed=0,oom_memcg=/syz1,task_memcg=/syz1,task=syz-executor.1,pid=23075,uid=0 Memory cgroup out of memory: Killed process 23075 (syz-executor.1) total-vm:46300kB, anon-rss:504kB, file-rss:8832kB, shmem-rss:0kB, UID:0 pgtables:80kB oom_score_adj:1000