================================================================== BUG: KCSAN: data-race in __mod_memcg_lruvec_state / mem_cgroup_css_rstat_flush write to 0xffffe8ffffc42e40 of 4 bytes by task 49 on cpu 1: mem_cgroup_css_rstat_flush+0x4ea/0x540 mm/memcontrol.c:5848 cgroup_rstat_flush_locked+0x848/0x980 kernel/cgroup/rstat.c:245 cgroup_rstat_flush+0x26/0x40 kernel/cgroup/rstat.c:277 do_flush_stats mm/memcontrol.c:745 [inline] flush_memcg_stats_dwork+0x50/0x90 mm/memcontrol.c:782 process_one_work kernel/workqueue.c:3267 [inline] process_scheduled_works+0x465/0x990 kernel/workqueue.c:3348 worker_thread+0x526/0x730 kernel/workqueue.c:3429 kthread+0x1d1/0x210 kernel/kthread.c:388 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 read-write to 0xffffe8ffffc42e40 of 4 bytes by task 22391 on cpu 0: memcg_rstat_updated mm/memcontrol.c:725 [inline] __mod_memcg_lruvec_state+0x13a/0x1a0 mm/memcontrol.c:875 __mod_lruvec_state+0x3c/0x50 mm/memcontrol.c:897 __update_lru_size include/linux/mm_inline.h:47 [inline] update_lru_size include/linux/mm_inline.h:56 [inline] lruvec_add_folio include/linux/mm_inline.h:326 [inline] lru_add_fn+0x289/0x430 mm/swap.c:215 folio_batch_move_lru+0x20c/0x2c0 mm/swap.c:233 folio_batch_add_and_move mm/swap.c:249 [inline] folio_add_lru mm/swap.c:532 [inline] folio_add_lru_vma+0x105/0x170 mm/swap.c:552 wp_page_copy mm/memory.c:3331 [inline] do_wp_page+0x1556/0x1e70 mm/memory.c:3660 handle_pte_fault mm/memory.c:5316 [inline] __handle_mm_fault mm/memory.c:5441 [inline] handle_mm_fault+0xb7f/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 rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:65 copy_user_generic arch/x86/include/asm/uaccess_64.h:110 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:131 [inline] copy_to_user_iter lib/iov_iter.c:25 [inline] iterate_ubuf include/linux/iov_iter.h:29 [inline] iterate_and_advance2 include/linux/iov_iter.h:245 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x137/0xaf0 lib/iov_iter.c:185 copy_to_iter include/linux/uio.h:196 [inline] simple_copy_to_iter net/core/datagram.c:532 [inline] __skb_datagram_iter+0xd2/0x5d0 net/core/datagram.c:420 skb_copy_datagram_iter+0x41/0x130 net/core/datagram.c:546 skb_copy_datagram_msg include/linux/skbuff.h:4050 [inline] tipc_recvstream+0x2df/0x7e0 net/tipc/socket.c:2071 sock_recvmsg_nosec net/socket.c:1046 [inline] sock_recvmsg+0x13f/0x170 net/socket.c:1068 ____sys_recvmsg+0xf9/0x280 net/socket.c:2803 ___sys_recvmsg net/socket.c:2845 [inline] __sys_recvmsg+0x1ea/0x280 net/socket.c:2875 __do_sys_recvmsg net/socket.c:2885 [inline] __se_sys_recvmsg net/socket.c:2882 [inline] __x64_sys_recvmsg+0x46/0x50 net/socket.c:2882 x64_sys_call+0x2bf9/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:48 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: 0x00000003 -> 0x00000000 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 22391 Comm: syz-executor.1 Tainted: G W 6.9.0-rc6-syzkaller-00022-g98369dccd2f8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 ==================================================================