================================================================== BUG: KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64 read-write to 0xffffffff860079c0 of 8 bytes by interrupt on cpu 1: tick_do_update_jiffies64+0x112/0x1b0 kernel/time/tick-sched.c:118 tick_sched_do_timer kernel/time/tick-sched.c:232 [inline] tick_nohz_handler+0x7c/0x2d0 kernel/time/tick-sched.c:290 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x214/0x5e0 kernel/time/hrtimer.c:1756 hrtimer_interrupt+0x210/0x7b0 kernel/time/hrtimer.c:1818 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline] __sysvec_apic_timer_interrupt+0x5c/0x1a0 arch/x86/kernel/apic/apic.c:1049 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x6e/0x80 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 __sanitizer_cov_trace_pc+0x0/0x70 do_shrink_slab+0x88/0x690 mm/shrinker.c:383 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x4f7/0x870 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5875 [inline] shrink_node+0xab2/0x15a0 mm/vmscan.c:5908 shrink_zones mm/vmscan.c:6152 [inline] do_try_to_free_pages+0x3cc/0xca0 mm/vmscan.c:6214 try_to_free_mem_cgroup_pages+0x1eb/0x4e0 mm/vmscan.c:6529 try_charge_memcg+0x279/0xd10 mm/memcontrol.c:2783 try_charge mm/memcontrol.c:2931 [inline] charge_memcg mm/memcontrol.c:7284 [inline] mem_cgroup_swapin_charge_folio+0x107/0x1a0 mm/memcontrol.c:7369 __read_swap_cache_async+0x2b9/0x520 mm/swap_state.c:514 swap_cluster_readahead+0x276/0x3f0 mm/swap_state.c:678 swapin_readahead+0xe2/0x7a0 mm/swap_state.c:904 do_swap_page+0x3bb/0x15f0 mm/memory.c:4048 handle_pte_fault mm/memory.c:5303 [inline] __handle_mm_fault mm/memory.c:5441 [inline] handle_mm_fault+0x7fa/0x27e0 mm/memory.c:5606 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2f5/0x6d0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 __get_user_8+0x11/0x20 arch/x86/lib/getuser.S:85 rseq_get_rseq_cs kernel/rseq.c:161 [inline] rseq_ip_fixup kernel/rseq.c:281 [inline] __rseq_handle_notify_resume+0xc8/0xc00 kernel/rseq.c:329 rseq_handle_notify_resume include/linux/rseq.h:38 [inline] resume_user_mode_work include/linux/resume_user_mode.h:62 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x90/0x130 kernel/entry/common.c:218 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f read to 0xffffffff860079c0 of 8 bytes by task 13489 on cpu 0: mem_cgroup_flush_stats_ratelimited+0x29/0x100 mm/memcontrol.c:772 count_shadow_nodes+0x69/0x3d0 mm/workingset.c:684 do_shrink_slab+0x5a/0x690 mm/shrinker.c:382 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x4f7/0x870 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5875 [inline] shrink_node+0xab2/0x15a0 mm/vmscan.c:5908 shrink_zones mm/vmscan.c:6152 [inline] do_try_to_free_pages+0x3cc/0xca0 mm/vmscan.c:6214 try_to_free_mem_cgroup_pages+0x1eb/0x4e0 mm/vmscan.c:6529 try_charge_memcg+0x279/0xd10 mm/memcontrol.c:2783 obj_cgroup_charge_pages+0xbd/0x1d0 mm/memcontrol.c:3302 __memcg_kmem_charge_page+0x9d/0x170 mm/memcontrol.c:3328 __alloc_pages+0x1bc/0x360 mm/page_alloc.c:4592 alloc_pages_preferred_many mm/mempolicy.c:2205 [inline] alloc_pages_mpol+0xec/0x1e0 mm/mempolicy.c:2229 alloc_pages+0xe1/0x100 mm/mempolicy.c:2335 vm_area_alloc_pages mm/vmalloc.c:3561 [inline] __vmalloc_area_node mm/vmalloc.c:3637 [inline] __vmalloc_node_range+0x6f2/0xee0 mm/vmalloc.c:3818 kvmalloc_node+0x121/0x170 mm/util.c:659 kvmalloc include/linux/slab.h:766 [inline] kvzalloc include/linux/slab.h:774 [inline] ip_set_alloc+0x1f/0x30 net/netfilter/ipset/ip_set_core.c:255 hash_netiface_create+0x277/0x740 net/netfilter/ipset/ip_set_hash_gen.h:1568 ip_set_create+0x359/0x8a0 net/netfilter/ipset/ip_set_core.c:1103 nfnetlink_rcv_msg+0x4a9/0x570 net/netfilter/nfnetlink.c:302 netlink_rcv_skb+0x12c/0x230 net/netlink/af_netlink.c:2559 nfnetlink_rcv+0x170/0x13e0 net/netfilter/nfnetlink.c:659 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x58d/0x660 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x5d3/0x6e0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x140/0x180 net/socket.c:745 ____sys_sendmsg+0x312/0x410 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x1e9/0x280 net/socket.c:2667 __do_sys_sendmsg net/socket.c:2676 [inline] __se_sys_sendmsg net/socket.c:2674 [inline] __x64_sys_sendmsg+0x46/0x50 net/socket.c:2674 x64_sys_call+0xae9/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:47 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: 0x000000010001a0db -> 0x000000010001a0dc Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 13489 Comm: syz-executor.2 Tainted: G W 6.9.0-rc4-syzkaller-00214-g13a2e429f644 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 ================================================================== syz-executor.2 invoked oom-killer: gfp_mask=0x402dc2(GFP_KERNEL_ACCOUNT|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), order=0, oom_score_adj=1000 CPU: 0 PID: 13489 Comm: syz-executor.2 Tainted: G W 6.9.0-rc4-syzkaller-00214-g13a2e429f644 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xf2/0x150 lib/dump_stack.c:114 dump_stack+0x15/0x20 lib/dump_stack.c:123 dump_header+0x83/0x2d0 mm/oom_kill.c:462 oom_kill_process+0x33e/0x4c0 mm/oom_kill.c:1036 out_of_memory+0x9cb/0xc00 mm/oom_kill.c:1174 mem_cgroup_out_of_memory+0x13e/0x190 mm/memcontrol.c:1817 mem_cgroup_oom mm/memcontrol.c:2047 [inline] try_charge_memcg+0x752/0xd10 mm/memcontrol.c:2831 obj_cgroup_charge_pages+0xbd/0x1d0 mm/memcontrol.c:3302 __memcg_kmem_charge_page+0x9d/0x170 mm/memcontrol.c:3328 __alloc_pages+0x1bc/0x360 mm/page_alloc.c:4592 alloc_pages_preferred_many mm/mempolicy.c:2205 [inline] alloc_pages_mpol+0xec/0x1e0 mm/mempolicy.c:2229 alloc_pages+0xe1/0x100 mm/mempolicy.c:2335 vm_area_alloc_pages mm/vmalloc.c:3561 [inline] __vmalloc_area_node mm/vmalloc.c:3637 [inline] __vmalloc_node_range+0x6f2/0xee0 mm/vmalloc.c:3818 kvmalloc_node+0x121/0x170 mm/util.c:659 kvmalloc include/linux/slab.h:766 [inline] kvzalloc include/linux/slab.h:774 [inline] ip_set_alloc+0x1f/0x30 net/netfilter/ipset/ip_set_core.c:255 hash_netiface_create+0x277/0x740 net/netfilter/ipset/ip_set_hash_gen.h:1568 ip_set_create+0x359/0x8a0 net/netfilter/ipset/ip_set_core.c:1103 nfnetlink_rcv_msg+0x4a9/0x570 net/netfilter/nfnetlink.c:302 netlink_rcv_skb+0x12c/0x230 net/netlink/af_netlink.c:2559 nfnetlink_rcv+0x170/0x13e0 net/netfilter/nfnetlink.c:659 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x58d/0x660 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x5d3/0x6e0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x140/0x180 net/socket.c:745 ____sys_sendmsg+0x312/0x410 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x1e9/0x280 net/socket.c:2667 __do_sys_sendmsg net/socket.c:2676 [inline] __se_sys_sendmsg net/socket.c:2674 [inline] __x64_sys_sendmsg+0x46/0x50 net/socket.c:2674 x64_sys_call+0xae9/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:47 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 RIP: 0033:0x7f61b1afdea9 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:00007f61b0e560c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f61b1c2c050 RCX: 00007f61b1afdea9 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007f61b1b4a4a4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f61b1c2c050 R15: 00007ffc4d7d9218 memory: usage 307200kB, limit 307200kB, failcnt 19745 memory+swap: usage 307832kB, limit 9007199254740988kB, failcnt 0 kmem: usage 307196kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz2: cache 4096 rss 0 shmem 0 mapped_file 0 dirty 4096 writeback 0 workingset_refault_anon 269 workingset_refault_file 58 swap 647168 swapcached 0 pgpgin 546552 pgpgout 546551 pgfault 622249 pgmajfault 128 inactive_anon 0 active_anon 0 inactive_file 4096 active_file 0 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 4096 total_writeback 0 total_workingset_refault_anon 269 total_workingset_refault_file 58 total_swap 647168 total_swapcached 0 total_pgpgin 546552 total_pgpgout 546551 total_pgfault 622249 total_pgmajfault 128 total_inactive_anon 0 total_active_anon 0 total_inactive_file 4096 total_active_file 0 total_unevictable 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz2,mems_allowed=0,oom_memcg=/syz2,task_memcg=/syz2,task=syz-executor.2,pid=13481,uid=0 Memory cgroup out of memory: Killed process 13481 (syz-executor.2) total-vm:46476kB, anon-rss:380kB, file-rss:8832kB, shmem-rss:0kB, UID:0 pgtables:84kB oom_score_adj:1000