================================================================== BUG: KCSAN: data-race in __refill_stock / drain_all_stock read-write to 0xffff888237c2a3c0 of 4 bytes by task 21485 on cpu 0: __refill_stock+0x7f/0xb0 mm/memcontrol.c:2364 refill_stock mm/memcontrol.c:2375 [inline] obj_cgroup_uncharge_pages+0xfb/0x1a0 mm/memcontrol.c:3234 __memcg_kmem_uncharge_page+0x53/0x100 mm/memcontrol.c:3307 free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page_prepare+0x7c/0x2a0 mm/page_alloc.c:2347 free_unref_page+0x34/0x170 mm/page_alloc.c:2487 vfree+0x27c/0x410 mm/vmalloc.c:2842 __vmalloc_area_node mm/vmalloc.c:3203 [inline] __vmalloc_node_range+0xddb/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/ipv6/netfilter/ip6_tables.c:1139 [inline] do_ip6t_set_ctl+0x633/0x17f0 net/ipv6/netfilter/ip6_tables.c:1636 nf_setsockopt+0x18d/0x1b0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x11c/0x130 net/ipv6/ipv6_sockglue.c:1005 rawv6_setsockopt+0x21e/0x410 net/ipv6/raw.c:1048 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 21480 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/ipv6/netfilter/ip6_tables.c:1139 [inline] do_ip6t_set_ctl+0x633/0x17f0 net/ipv6/netfilter/ip6_tables.c:1636 nf_setsockopt+0x18d/0x1b0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x11c/0x130 net/ipv6/ipv6_sockglue.c:1005 rawv6_setsockopt+0x21e/0x410 net/ipv6/raw.c:1048 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: 0x00000028 -> 0x0000000e Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 21480 Comm: syz-executor.5 Not tainted 6.7.0-rc4-syzkaller-00424-gc527f5606aa5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 ================================================================== syz-executor.5 invoked oom-killer: gfp_mask=0x402cc2(GFP_KERNEL_ACCOUNT|__GFP_HIGHMEM|__GFP_NOWARN), order=0, oom_score_adj=1000 CPU: 1 PID: 21480 Comm: syz-executor.5 Not tainted 6.7.0-rc4-syzkaller-00424-gc527f5606aa5 #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/ipv6/netfilter/ip6_tables.c:1139 [inline] do_ip6t_set_ctl+0x633/0x17f0 net/ipv6/netfilter/ip6_tables.c:1636 nf_setsockopt+0x18d/0x1b0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x11c/0x130 net/ipv6/ipv6_sockglue.c:1005 rawv6_setsockopt+0x21e/0x410 net/ipv6/raw.c:1048 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:0x7fec0bc6aba9 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:00007fec0afed0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fec0bd89f80 RCX: 00007fec0bc6aba9 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003 RBP: 00007fec0bcb647a R08: 00000000000004b0 R09: 0000000000000000 R10: 0000000020000ec0 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fec0bd89f80 R15: 00007ffd27afc078 memory: usage 307192kB, limit 307200kB, failcnt 99144 memory+swap: usage 374672kB, limit 9007199254740988kB, failcnt 0 kmem: usage 157556kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz5: cache 11370496 rss 141619200 shmem 11370496 mapped_file 98304 dirty 0 writeback 0 workingset_refault_anon 4 workingset_refault_file 39 swap 69099520 swapcached 237568 pgpgin 953806 pgpgout 916397 pgfault 1730806 pgmajfault 1 inactive_anon 140476416 active_anon 12750848 inactive_file 0 active_file 0 unevictable 0 hierarchical_memory_limit 314572800 hierarchical_memsw_limit 9223372036854771712 total_cache 11370496 total_rss 141619200 total_shmem 11370496 total_mapped_file 98304 total_dirty 0 total_writeback 0 total_workingset_refault_anon 4 total_workingset_refault_file 39 total_swap 69099520 total_swapcached 237568 total_pgpgin 953806 total_pgpgout 916397 total_pgfault 1730806 total_pgmajfault 1 total_inactive_anon 140476416 total_active_anon 12750848 total_inactive_file 0 total_active_file 0 total_unevictable 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz5,mems_allowed=0,oom_memcg=/syz5,task_memcg=/syz5,task=syz-executor.5,pid=24635,uid=0 Memory cgroup out of memory: Killed process 24635 (syz-executor.5) total-vm:48744kB, anon-rss:460kB, file-rss:10368kB, shmem-rss:0kB, UID:0 pgtables:72kB oom_score_adj:1000