================================================================== BUG: KCSAN: data-race in drain_all_stock / try_charge_memcg write to 0xffff888237d2a690 of 4 bytes by task 23279 on cpu 1: consume_stock mm/memcontrol.c:2322 [inline] try_charge_memcg+0xb46/0xd20 mm/memcontrol.c:2743 obj_cgroup_charge_pages+0xbd/0x1c0 mm/memcontrol.c:3301 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3327 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4584 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+0x6ee/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 bloom_map_alloc+0x1aa/0x2b0 kernel/bpf/bloom_filter.c:134 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 0xffff888237d2a690 of 4 bytes by task 3102 on cpu 0: 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:886 do_swap_page+0x439/0x1530 mm/memory.c:3898 handle_pte_fault mm/memory.c:5147 [inline] __handle_mm_fault mm/memory.c:5285 [inline] handle_mm_fault+0x7f6/0x27c0 mm/memory.c:5450 do_user_addr_fault arch/x86/mm/fault.c:1415 [inline] handle_page_fault arch/x86/mm/fault.c:1507 [inline] exc_page_fault+0x2f9/0x6d0 arch/x86/mm/fault.c:1563 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/0x130 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: 0x00000024 -> 0x0000000c Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 3102 Comm: syz-executor.3 Not tainted 6.8.0-rc4-syzkaller-00034-g8d3dea210042 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 ================================================================== syz-executor.3 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0 CPU: 0 PID: 3102 Comm: syz-executor.3 Not tainted 6.8.0-rc4-syzkaller-00034-g8d3dea210042 #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:886 do_swap_page+0x439/0x1530 mm/memory.c:3898 handle_pte_fault mm/memory.c:5147 [inline] __handle_mm_fault mm/memory.c:5285 [inline] handle_mm_fault+0x7f6/0x27c0 mm/memory.c:5450 do_user_addr_fault arch/x86/mm/fault.c:1415 [inline] handle_page_fault arch/x86/mm/fault.c:1507 [inline] exc_page_fault+0x2f9/0x6d0 arch/x86/mm/fault.c:1563 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:ffffc90000f5fe38 EFLAGS: 00050202 RAX: 0000555555c2dda8 RBX: ffffc90000f5fe40 RCX: ffffffff8144d083 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888100f8db10 RBP: ffffc90000f5fef0 R08: 0001888100f8db17 R09: 0000000000000000 R10: 0001ffffffffffff R11: 0000000000007ba1 R12: ffff888100f8d140 R13: ffff888100f8db10 R14: ffffc90000f5ff58 R15: ffffc90000f5ffd8 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/0x130 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:0x7f6e00073173 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:00007fffa6e64e88 EFLAGS: 00000202 ORIG_RAX: 00000000000000e6 RAX: 0000000000000000 RBX: 0000000000005b31 RCX: 00007f6e00073173 RDX: 00007fffa6e64ea0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007fffa6e64f2c R08: 0000000000000010 R09: 00007fffa6f1c0b0 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000032 R13: 00000000001551a3 R14: 0000000000154d80 R15: 0000000000000010 memory: usage 307200kB, limit 307200kB, failcnt 34485 memory+swap: usage 299844kB, limit 9007199254740988kB, failcnt 0 kmem: usage 301052kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz3: cache 16384 rss 8192 shmem 0 mapped_file 0 dirty 0 writeback 0 workingset_refault_anon 5638 workingset_refault_file 1285 swap 176128 swapcached 16384 pgpgin 256325 pgpgout 256317 pgfault 618248 pgmajfault 2472 inactive_anon 0 active_anon 0 inactive_file 12288 active_file 0 unevictable 0 hierarchical_memory_limit 314572800 hierarchical_memsw_limit 9223372036854771712 total_cache 16384 total_rss 8192 total_shmem 0 total_mapped_file 0 total_dirty 0 total_writeback 0 total_workingset_refault_anon 5638 total_workingset_refault_file 1285 total_swap 176128 total_swapcached 16384 total_pgpgin 256325 total_pgpgout 256317 total_pgfault 618248 total_pgmajfault 2472 total_inactive_anon 0 total_active_anon 0 total_inactive_file 12288 total_active_file 0 total_unevictable 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz3,mems_allowed=0,oom_memcg=/syz3,task_memcg=/syz3,task=syz-executor.3,pid=23384,uid=0 Memory cgroup out of memory: Killed process 23384 (syz-executor.3) total-vm:50936kB, anon-rss:508kB, file-rss:13056kB, shmem-rss:0kB, UID:0 pgtables:96kB 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