================================================================== BUG: KCSAN: data-race in drain_all_stock / try_charge_memcg write to 0xffff888237d28138 of 4 bytes by task 9974 on cpu 1: consume_stock mm/memcontrol.c:2146 [inline] try_charge_memcg+0x9de/0xa50 mm/memcontrol.c:2545 try_charge mm/memcontrol.c:2717 [inline] charge_memcg+0x51/0x1e0 mm/memcontrol.c:6671 __mem_cgroup_charge+0x25/0xa0 mm/memcontrol.c:6692 mem_cgroup_charge include/linux/memcontrol.h:665 [inline] wp_page_copy+0x1eb/0x10e0 mm/memory.c:3008 do_wp_page+0x4fb/0xa80 handle_pte_fault mm/memory.c:4569 [inline] __handle_mm_fault mm/memory.c:4686 [inline] handle_mm_fault+0x975/0x1590 mm/memory.c:4784 do_user_addr_fault+0x609/0xbe0 arch/x86/mm/fault.c:1397 handle_page_fault arch/x86/mm/fault.c:1485 [inline] exc_page_fault+0x91/0x290 arch/x86/mm/fault.c:1541 asm_exc_page_fault+0x1e/0x30 read to 0xffff888237d28138 of 4 bytes by task 9963 on cpu 0: drain_all_stock+0xd5/0x4b0 mm/memcontrol.c:2248 try_charge_memcg+0x69b/0xa50 mm/memcontrol.c:2600 try_charge mm/memcontrol.c:2717 [inline] charge_memcg+0x51/0x1e0 mm/memcontrol.c:6671 __mem_cgroup_charge+0x25/0xa0 mm/memcontrol.c:6692 mem_cgroup_charge include/linux/memcontrol.h:665 [inline] do_anonymous_page+0x1d6/0x8d0 mm/memory.c:3764 handle_pte_fault mm/memory.c:4549 [inline] __handle_mm_fault mm/memory.c:4686 [inline] handle_mm_fault+0x814/0x1590 mm/memory.c:4784 faultin_page mm/gup.c:939 [inline] __get_user_pages+0x388/0xc80 mm/gup.c:1160 populate_vma_page_range mm/gup.c:1492 [inline] __mm_populate+0x24d/0x370 mm/gup.c:1601 mm_populate include/linux/mm.h:2746 [inline] __do_sys_mlockall+0x24b/0x2d0 mm/mlock.c:800 __se_sys_mlockall mm/mlock.c:776 [inline] __x64_sys_mlockall+0x1a/0x20 mm/mlock.c:776 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x0000001e -> 0x0000001d Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 9963 Comm: syz-executor.5 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ================================================================== syz-executor.5 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000 CPU: 0 PID: 9963 Comm: syz-executor.5 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd6/0x122 lib/dump_stack.c:106 dump_stack+0x11/0x1b lib/dump_stack.c:113 dump_header+0x98/0x410 mm/oom_kill.c:463 oom_kill_process+0x18e/0x3f0 mm/oom_kill.c:982 out_of_memory+0x5ed/0x890 mm/oom_kill.c:1119 mem_cgroup_out_of_memory mm/memcontrol.c:1610 [inline] mem_cgroup_oom+0x484/0x520 mm/memcontrol.c:1845 try_charge_memcg+0x75c/0xa50 mm/memcontrol.c:2640 try_charge mm/memcontrol.c:2717 [inline] charge_memcg+0x51/0x1e0 mm/memcontrol.c:6671 __mem_cgroup_charge+0x25/0xa0 mm/memcontrol.c:6692 mem_cgroup_charge include/linux/memcontrol.h:665 [inline] do_anonymous_page+0x1d6/0x8d0 mm/memory.c:3764 handle_pte_fault mm/memory.c:4549 [inline] __handle_mm_fault mm/memory.c:4686 [inline] handle_mm_fault+0x814/0x1590 mm/memory.c:4784 faultin_page mm/gup.c:939 [inline] __get_user_pages+0x388/0xc80 mm/gup.c:1160 populate_vma_page_range mm/gup.c:1492 [inline] __mm_populate+0x24d/0x370 mm/gup.c:1601 mm_populate include/linux/mm.h:2746 [inline] __do_sys_mlockall+0x24b/0x2d0 mm/mlock.c:800 __se_sys_mlockall mm/mlock.c:776 [inline] __x64_sys_mlockall+0x1a/0x20 mm/mlock.c:776 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f94a31d2e99 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f94a2349168 EFLAGS: 00000246 ORIG_RAX: 0000000000000097 RAX: ffffffffffffffda RBX: 00007f94a32e5f60 RCX: 00007f94a31d2e99 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 00007f94a322cff1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc5b5f856f R14: 00007f94a2349300 R15: 0000000000022000 memory: usage 307200kB, limit 307200kB, failcnt 27673 swap: usage 0kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz5: anon 291844096 file 19165184 kernel_stack 360448 pagetables 1757184 percpu 0 sock 0 shmem 19156992 file_mapped 4423680 file_dirty 8192 file_writeback 0 swapcached 0 inactive_anon 263016448 active_anon 14721024 inactive_file 4096 active_file 4096 unevictable 33263616 slab_reclaimable 167936 slab_unreclaimable 983624 slab 1151560 workingset_refault_anon 0 workingset_refault_file 7 workingset_activate_anon 0 workingset_activate_file 0 workingset_restore_anon 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz5,mems_allowed=0,oom_memcg=/syz5,task_memcg=/syz5,task=syz-executor.5,pid=9962,uid=0 Memory cgroup out of memory: Killed process 9962 (syz-executor.5) total-vm:49136kB, anon-rss:28284kB, file-rss:14780kB, shmem-rss:4284kB, UID:0 pgtables:144kB oom_score_adj:1000