================================================================== BUG: KCSAN: data-race in mem_cgroup_flush_stats / tick_do_update_jiffies64 read-write to 0xffffffff85a079c0 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:211 [inline] tick_nohz_highres_handler+0x7b/0x2c0 kernel/time/tick-sched.c:1509 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x217/0x700 kernel/time/hrtimer.c:1752 hrtimer_interrupt+0x20d/0x7b0 kernel/time/hrtimer.c:1814 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline] __sysvec_apic_timer_interrupt+0x52/0x190 arch/x86/kernel/apic/apic.c:1082 sysvec_apic_timer_interrupt+0x31/0x80 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 folio_rotate_reclaimable+0xc1/0x200 mm/swap.c:257 folio_end_writeback+0x66/0x1f0 mm/filemap.c:1588 __end_swap_bio_write+0xdf/0x200 mm/page_io.c:49 end_swap_bio_write+0x15/0x20 mm/page_io.c:54 bio_endio+0x35f/0x400 block/bio.c:1603 req_bio_endio block/blk-mq.c:788 [inline] blk_update_request+0x41c/0x950 block/blk-mq.c:933 scsi_end_request+0x52/0x4e0 drivers/scsi/scsi_lib.c:537 scsi_io_completion+0x9f/0x200 drivers/scsi/scsi_lib.c:975 scsi_finish_command+0x1bb/0x1d0 drivers/scsi/scsi.c:198 scsi_complete+0x19a/0x1d0 drivers/scsi/scsi_lib.c:1437 blk_complete_reqs block/blk-mq.c:1131 [inline] blk_done_softirq+0x73/0xa0 block/blk-mq.c:1136 __do_softirq+0xc4/0x279 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0x3b/0x90 kernel/softirq.c:644 common_interrupt+0x7f/0x90 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 __cond_resched+0x0/0x50 _cond_resched include/linux/sched.h:2105 [inline] inet_twsk_purge+0x442/0x490 net/ipv4/inet_timewait_sock.c:291 dccp_v6_exit_batch+0x1a/0x20 net/dccp/ipv6.c:1124 ops_exit_list net/core/net_namespace.c:175 [inline] setup_net+0x55f/0x710 net/core/net_namespace.c:362 copy_net_ns+0x384/0x520 net/core/net_namespace.c:491 create_new_namespaces+0x228/0x430 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xe4/0x120 kernel/nsproxy.c:228 ksys_unshare+0x3d3/0x720 kernel/fork.c:3433 __do_sys_unshare kernel/fork.c:3504 [inline] __se_sys_unshare kernel/fork.c:3502 [inline] __x64_sys_unshare+0x1f/0x30 kernel/fork.c:3502 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b read to 0xffffffff85a079c0 of 8 bytes by task 24838 on cpu 0: do_flush_stats mm/memcontrol.c:656 [inline] mem_cgroup_flush_stats+0x5d/0xd0 mm/memcontrol.c:667 count_shadow_nodes+0x67/0x3d0 mm/workingset.c:667 do_shrink_slab+0x57/0x680 mm/shrinker.c:382 shrink_slab_memcg mm/shrinker.c:548 [inline] shrink_slab+0x4f7/0x860 mm/shrinker.c:626 shrink_node_memcgs mm/vmscan.c:5814 [inline] shrink_node+0xaf2/0x15c0 mm/vmscan.c:5847 shrink_zones mm/vmscan.c:6086 [inline] do_try_to_free_pages+0x43d/0xce0 mm/vmscan.c:6148 try_to_free_mem_cgroup_pages+0x1e2/0x480 mm/vmscan.c:6463 try_charge_memcg+0x280/0xd30 mm/memcontrol.c:2742 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:3704 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:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b value changed: 0x0000000100039519 -> 0x000000010003951a Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 24838 Comm: syz-executor.4 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 ================================================================== syz-executor.4 invoked oom-killer: gfp_mask=0x402cc2(GFP_KERNEL_ACCOUNT|__GFP_HIGHMEM|__GFP_NOWARN), order=0, oom_score_adj=1000 CPU: 0 PID: 24838 Comm: syz-executor.4 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #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:3704 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:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f525b9d7ae9 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:00007f525ad180c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f525baf7120 RCX: 00007f525b9d7ae9 RDX: 0000000000000060 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007f525ba2347a R08: 0000000000000438 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f525baf7120 R15: 00007ffdfc4e7f68 memory: usage 307200kB, limit 307200kB, failcnt 60206 memory+swap: usage 312720kB, limit 9007199254740988kB, failcnt 0 kmem: usage 307184kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz4: cache 8192 rss 0 shmem 0 mapped_file 0 dirty 4096 writeback 0 workingset_refault_anon 10807 workingset_refault_file 151 swap 5652480 swapcached 8192 pgpgin 1009475 pgpgout 1009471 pgfault 1369158 pgmajfault 6455 inactive_anon 8192 active_anon 0 inactive_file 8192 active_file 0 unevictable 0 hierarchical_memory_limit 314572800 hierarchical_memsw_limit 9223372036854771712 total_cache 8192 total_rss 0 total_shmem 0 total_mapped_file 0 total_dirty 4096 total_writeback 0 total_workingset_refault_anon 10807 total_workingset_refault_file 151 total_swap 5652480 total_swapcached 8192 total_pgpgin 1009475 total_pgpgout 1009471 total_pgfault 1369162 total_pgmajfault 6455 total_inactive_anon 8192 total_active_anon 0 total_inactive_file 8192 total_active_file 0 total_unevictable 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz4,mems_allowed=0,oom_memcg=/syz4,task_memcg=/syz4,task=syz-executor.4,pid=24814,uid=0 Memory cgroup out of memory: Killed process 24814 (syz-executor.4) total-vm:48740kB, anon-rss:508kB, file-rss:11008kB, shmem-rss:0kB, UID:0 pgtables:104kB oom_score_adj:1000