================================================================== BUG: KCSAN: data-race in drain_all_stock / drain_stock write to 0xffff888237c2a690 of 4 bytes by task 24061 on cpu 0: drain_stock+0x48/0xf0 mm/memcontrol.c:2345 __refill_stock+0x33/0xb0 mm/memcontrol.c:2385 refill_stock mm/memcontrol.c:2400 [inline] obj_cgroup_uncharge_pages+0x134/0x200 mm/memcontrol.c:3280 __memcg_kmem_uncharge_page+0x53/0x100 mm/memcontrol.c:3353 free_pages_prepare mm/page_alloc.c:1097 [inline] free_unref_page_prepare+0x61/0x2c0 mm/page_alloc.c:2346 free_unref_page+0x34/0x170 mm/page_alloc.c:2486 vfree+0x211/0x390 mm/vmalloc.c:2842 __vmalloc_area_node mm/vmalloc.c:3203 [inline] __vmalloc_node_range+0xdf9/0xec0 mm/vmalloc.c:3320 __bpf_map_area_alloc kernel/bpf/syscall.c:306 [inline] bpf_map_area_alloc+0xd8/0x100 kernel/bpf/syscall.c:313 array_map_alloc+0x1e3/0x3c0 kernel/bpf/arraymap.c:138 map_create+0x713/0xa40 kernel/bpf/syscall.c:1237 __sys_bpf+0x62a/0x780 kernel/bpf/syscall.c:5439 __do_sys_bpf kernel/bpf/syscall.c:5561 [inline] __se_sys_bpf kernel/bpf/syscall.c:5559 [inline] __x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5559 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+0x63/0x6b read to 0xffff888237c2a690 of 4 bytes by task 3132 on cpu 1: drain_all_stock+0xd3/0x2e0 mm/memcontrol.c:2430 try_charge_memcg+0x6c2/0xd20 mm/memcontrol.c:2790 try_charge mm/memcontrol.c:2930 [inline] charge_memcg mm/memcontrol.c:7276 [inline] mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7361 __read_swap_cache_async+0x2b9/0x510 mm/swap_state.c:498 swap_cluster_readahead+0x276/0x3f0 mm/swap_state.c:662 swapin_readahead+0xe2/0x7a0 mm/swap_state.c:888 do_swap_page+0x3bb/0x15e0 mm/memory.c:3913 handle_pte_fault mm/memory.c:5167 [inline] __handle_mm_fault mm/memory.c:5305 [inline] handle_mm_fault+0x7f6/0x27c0 mm/memory.c:5470 do_user_addr_fault arch/x86/mm/fault.c:1406 [inline] handle_page_fault arch/x86/mm/fault.c:1498 [inline] exc_page_fault+0x2f9/0x6d0 arch/x86/mm/fault.c:1554 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 __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+0xc7/0xbf0 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:108 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x8f/0x120 kernel/entry/common.c:212 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x63/0x6b value changed: 0x0000002f -> 0x00000006 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 3132 Comm: syz-executor.2 Not tainted 6.8.0-rc6-syzkaller-00021-gcf1182944c7c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 ================================================================== syz-executor.2 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0 CPU: 0 PID: 3132 Comm: syz-executor.2 Not tainted 6.8.0-rc6-syzkaller-00021-gcf1182944c7c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 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:461 oom_kill_process+0x33a/0x4c0 mm/oom_kill.c:1032 out_of_memory+0x9ca/0xbf0 mm/oom_kill.c:1170 mem_cgroup_out_of_memory+0x139/0x190 mm/memcontrol.c:1816 mem_cgroup_oom mm/memcontrol.c:2046 [inline] try_charge_memcg+0x759/0xd20 mm/memcontrol.c:2830 try_charge mm/memcontrol.c:2930 [inline] charge_memcg mm/memcontrol.c:7276 [inline] mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7361 __read_swap_cache_async+0x2b9/0x510 mm/swap_state.c:498 swap_cluster_readahead+0x276/0x3f0 mm/swap_state.c:662 swapin_readahead+0xe2/0x7a0 mm/swap_state.c:888 do_swap_page+0x3bb/0x15e0 mm/memory.c:3913 handle_pte_fault mm/memory.c:5167 [inline] __handle_mm_fault mm/memory.c:5305 [inline] handle_mm_fault+0x7f6/0x27c0 mm/memory.c:5470 do_user_addr_fault arch/x86/mm/fault.c:1406 [inline] handle_page_fault arch/x86/mm/fault.c:1498 [inline] exc_page_fault+0x2f9/0x6d0 arch/x86/mm/fault.c:1554 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:__get_user_8+0x11/0x20 arch/x86/lib/getuser.S:88 Code: 48 c1 fa 3f 48 09 d0 0f 01 cb 8b 10 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 89 c2 48 c1 fa 3f 48 09 d0 0f 01 cb <48> 8b 10 31 c0 0f 01 ca c3 66 0f 1f 44 00 00 f3 0f 1e fa 0f 01 cb RSP: 0018:ffffc90000eebe38 EFLAGS: 00050202 RAX: 0000555556365da8 RBX: ffffc90000eebe40 RCX: ffffffff8144d153 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881042f6b50 RBP: ffffc90000eebef0 R08: 00018881042f6b57 R09: 0000000000000000 R10: 0001ffffffffffff R11: 0000000000004c02 R12: ffff8881042f6180 R13: ffff8881042f6b50 R14: ffffc90000eebf58 R15: ffffc90000eebfd8 rseq_get_rseq_cs kernel/rseq.c:161 [inline] rseq_ip_fixup kernel/rseq.c:281 [inline] __rseq_handle_notify_resume+0xc7/0xbf0 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:108 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x8f/0x120 kernel/entry/common.c:212 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7ff1132b2173 Code: 00 00 00 00 0f 1f 00 83 ff 03 74 7b 83 ff 02 b8 fa ff ff ff 49 89 ca 0f 44 f8 80 3d 8e 6d 0d 00 00 74 14 b8 e6 00 00 00 0f 05 d8 c3 66 2e 0f 1f 84 00 00 00 00 00 48 83 ec 28 48 89 54 24 10 RSP: 002b:00007ffcdc99f878 EFLAGS: 00000202 ORIG_RAX: 00000000000000e6 RAX: 0000000000000000 RBX: 000000000000771e RCX: 00007ff1132b2173 RDX: 00007ffcdc99f890 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffcdc99f91c R08: 0000000000000010 R09: 00007ffcdc9ba0b0 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000032 R13: 000000000026a882 R14: 000000000026a882 R15: 0000000000000000 memory: usage 307060kB, limit 307200kB, failcnt 481024 memory+swap: usage 308352kB, limit 9007199254740988kB, failcnt 0 kmem: usage 307032kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz2: cache 4096 rss 0 shmem 0 mapped_file 0 dirty 0 writeback 0 workingset_refault_anon 234178 workingset_refault_file 1211 swap 1347584 swapcached 0 pgpgin 652612 pgpgout 652611 pgfault 1180203 pgmajfault 160676 inactive_anon 0 active_anon 0 inactive_file 0 active_file 4096 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 0 total_writeback 0 total_workingset_refault_anon 234178 total_workingset_refault_file 1211 total_swap 1347584 total_swapcached 0 total_pgpgin 652786 total_pgpgout 652785 total_pgfault 1180399 total_pgmajfault 160676 total_inactive_anon 0 total_active_anon 0 total_inactive_file 0 total_active_file 4096 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=24208,uid=0 Memory cgroup out of memory: Killed process 24208 (syz-executor.2) total-vm:46312kB, anon-rss:380kB, file-rss:8924kB, shmem-rss:0kB, UID:0 pgtables:76kB oom_score_adj:1000 ---------------- Code disassembly (best guess): 0: 48 c1 fa 3f sar $0x3f,%rdx 4: 48 09 d0 or %rdx,%rax 7: 0f 01 cb stac a: 8b 10 mov (%rax),%edx c: 31 c0 xor %eax,%eax e: 0f 01 ca clac 11: c3 ret 12: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 19: f3 0f 1e fa endbr64 1d: 48 89 c2 mov %rax,%rdx 20: 48 c1 fa 3f sar $0x3f,%rdx 24: 48 09 d0 or %rdx,%rax 27: 0f 01 cb stac * 2a: 48 8b 10 mov (%rax),%rdx <-- trapping instruction 2d: 31 c0 xor %eax,%eax 2f: 0f 01 ca clac 32: c3 ret 33: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 39: f3 0f 1e fa endbr64 3d: 0f 01 cb stac