==================================================================
BUG: KCSAN: data-race in drain_all_stock / try_charge_memcg
write to 0xffff888237c2a690 of 4 bytes by task 18503 on cpu 0:
consume_stock mm/memcontrol.c:2317 [inline]
try_charge_memcg+0xb46/0xd20 mm/memcontrol.c:2723
obj_cgroup_charge_pages+0xbd/0x1c0 mm/memcontrol.c:3275
__memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3301
__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
pagetable_alloc include/linux/mm.h:2842 [inline]
__pte_alloc_one include/asm-generic/pgalloc.h:68 [inline]
pte_alloc_one+0x32/0xe0 arch/x86/mm/pgtable.c:33
__pte_alloc+0x33/0x270 mm/memory.c:440
copy_pte_range mm/memory.c:1048 [inline]
copy_pmd_range mm/memory.c:1187 [inline]
copy_pud_range mm/memory.c:1224 [inline]
copy_p4d_range mm/memory.c:1248 [inline]
copy_page_range+0x1c5d/0x2150 mm/memory.c:1346
dup_mmap kernel/fork.c:745 [inline]
dup_mm kernel/fork.c:1685 [inline]
copy_mm+0x938/0x1060 kernel/fork.c:1734
copy_process+0x1002/0x20a0 kernel/fork.c:2496
kernel_clone+0x169/0x560 kernel/fork.c:2901
__do_sys_clone kernel/fork.c:3044 [inline]
__se_sys_clone kernel/fork.c:3028 [inline]
__x64_sys_clone+0xe8/0x120 kernel/fork.c:3028
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x59/0x120 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
read to 0xffff888237c2a690 of 4 bytes by task 3107 on cpu 1:
drain_all_stock+0xd3/0x2e0 mm/memcontrol.c:2425
try_charge_memcg+0x6c2/0xd20 mm/memcontrol.c:2770
obj_cgroup_charge_pages+0xbd/0x1c0 mm/memcontrol.c:3275
obj_cgroup_charge+0xec/0x140 mm/memcontrol.c:3566
__memcg_slab_pre_alloc_hook+0xe3/0x120 mm/slub.c:1929
memcg_slab_pre_alloc_hook mm/slub.c:1950 [inline]
slab_pre_alloc_hook mm/slub.c:3766 [inline]
slab_alloc_node mm/slub.c:3842 [inline]
kmem_cache_alloc_lru+0x19c/0x2e0 mm/slub.c:3879
__d_alloc+0x3d/0x330 fs/dcache.c:1624
d_alloc_anon fs/dcache.c:1722 [inline]
d_make_root+0x2a/0xb0 fs/dcache.c:1913
__ns_get_path+0x157/0x200 fs/nsfs.c:93
ns_get_path_cb fs/nsfs.c:116 [inline]
ns_get_path+0x39/0x70 fs/nsfs.c:142
perf_fill_ns_link_info kernel/events/core.c:8434 [inline]
perf_event_namespaces+0xac/0x570 kernel/events/core.c:8468
perf_event_fork+0xe1/0x110 kernel/events/core.c:8269
copy_process+0x205f/0x20a0 kernel/fork.c:2719
kernel_clone+0x169/0x560 kernel/fork.c:2901
__do_sys_clone kernel/fork.c:3044 [inline]
__se_sys_clone kernel/fork.c:3028 [inline]
__x64_sys_clone+0xe8/0x120 kernel/fork.c:3028
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x59/0x120 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
value changed: 0x00000034 -> 0x00000033
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3107 Comm: syz-executor.1 Not tainted 6.7.0-syzkaller-12377-g9d1694dc91ce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================
syz-executor.1 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
CPU: 1 PID: 3107 Comm: syz-executor.1 Not tainted 6.7.0-syzkaller-12377-g9d1694dc91ce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/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: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:1811
mem_cgroup_oom mm/memcontrol.c:2041 [inline]
try_charge_memcg+0x759/0xd20 mm/memcontrol.c:2810
try_charge mm/memcontrol.c:2904 [inline]
charge_memcg mm/memcontrol.c:7241 [inline]
mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7326
__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+0x44c/0x1570 mm/memory.c:3898
handle_pte_fault mm/memory.c:5147 [inline]
__handle_mm_fault mm/memory.c:5285 [inline]
handle_mm_fault+0x7f6/0x27b0 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+0x2f7/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: 0000:ffffc90000f5fe38 EFLAGS: 00050202
RAX: 00005555559ddda8 RBX: ffffc90000f5fe40 RCX: ffffffff8144d7e3
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888101712a50
RBP: ffffc90000f5ff00 R08: 0001888101712a57 R09: 0000000000000000
R10: 0001ffffffffffff R11: 00018881017120eb R12: ffff888101712080
R13: ffff888101712a50 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+0x8e/0x130 kernel/entry/common.c:212
do_syscall_64+0x65/0x120 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f648db34173
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:00007fffb0770728 EFLAGS: 00000202
ORIG_RAX: 00000000000000e6
RAX: 0000000000000000 RBX: 0000000000005b74 RCX: 00007f648db34173
RDX: 00007fffb0770740 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fffb07707cc R08: 0000000000000010 R09: 00007fffb078f0b0
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00000000002c6f99 R14: 00000000002c6f99 R15: 0000000000000000
memory: usage 307200kB, limit 307200kB, failcnt 161578
memory+swap: usage 307604kB, limit 9007199254740988kB, failcnt 0
kmem: usage 307180kB, limit 9007199254740988kB, failcnt 0
Memory cgroup stats for /syz1
:
cache 0
rss 28672
shmem 0
mapped_file 0
dirty 0
writeback 0
workingset_refault_anon 90040
workingset_refault_file 26
swap 405504
swapcached 20480
pgpgin 374586
pgpgout 374579
pgfault 708340
pgmajfault 60645
inactive_anon 20480
active_anon 4096
inactive_file 0
active_file 0
unevictable 0
hierarchical_memory_limit 314572800
hierarchical_memsw_limit 9223372036854771712
total_cache 0
total_rss 28672
total_shmem 0
total_mapped_file 0
total_dirty 0
total_writeback 0
total_workingset_refault_anon 90040
total_workingset_refault_file 26
total_swap 405504
total_swapcached 20480
total_pgpgin 374586
total_pgpgout 374579
total_pgfault 708340
total_pgmajfault 60645
total_inactive_anon 20480
total_active_anon 4096
total_inactive_file 0
total_active_file 0
total_unevictable 0
oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz1,mems_allowed=0,oom_memcg=/syz1,task_memcg=/syz1,task=syz-executor.1,pid=2175,uid=0
Memory cgroup out of memory: Killed process 2175 (syz-executor.1) total-vm:46176kB, anon-rss:364kB, file-rss:8832kB, shmem-rss:0kB, UID:0 pgtables:76kB oom_score_adj:1000
syz-executor.1 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
CPU: 1 PID: 3107 Comm: syz-executor.1 Not tainted 6.7.0-syzkaller-12377-g9d1694dc91ce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/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: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:1811
mem_cgroup_oom mm/memcontrol.c:2041 [inline]
try_charge_memcg+0x759/0xd20 mm/memcontrol.c:2810
try_charge mm/memcontrol.c:2904 [inline]
charge_memcg mm/memcontrol.c:7241 [inline]
mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7326
__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+0x44c/0x1570 mm/memory.c:3898
handle_pte_fault mm/memory.c:5147 [inline]
__handle_mm_fault mm/memory.c:5285 [inline]
handle_mm_fault+0x7f6/0x27b0 mm/memory.c:5450
do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
handle_page_fault arch/x86/mm/fault.c:1507 [inline]
exc_page_fault+0x3ff/0x6d0 arch/x86/mm/fault.c:1563
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x7f648db34175
Code: 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 f7 d8 66 2e 0f 1f 84 00 00 00 00 00 48 83 ec 28 48 89 54 24 10 89 74
RSP: 002b:00007fffb0770728 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000005b7c RCX: 00007f648db34173
RDX: 00007fffb0770740 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fffb07707cc R08: 0000000000000010 R09: 00007fffb078f0b0
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000032
R13: 00000000002c7d73 R14: 00000000002c7d73 R15: 0000000000000000
memory: usage 307200kB, limit 307200kB, failcnt 162332
memory+swap: usage 307656kB, limit 9007199254740988kB, failcnt 0
kmem: usage 307172kB, limit 9007199254740988kB, failcnt 0
Memory cgroup stats for /syz1:
cache 0
rss 4096
shmem 0
mapped_file 0
dirty 0
writeback 4096
workingset_refault_anon 90287
workingset_refault_file 26
swap 471040
swapcached 16384
pgpgin 374891
pgpgout 374887
pgfault 708896
pgmajfault 60811
inactive_anon 8192
active_anon 0
inactive_file 0
active_file 0
unevictable 0
hierarchical_memory_limit 314572800
hierarchical_memsw_limit 9223372036854771712
total_cache 0
total_rss 4096
total_shmem 0
total_mapped_file 0
total_dirty 0
total_writeback 4096
total_workingset_refault_anon 90287
total_workingset_refault_file 26
total_swap 471040
total_swapcached 16384
total_pgpgin 374891
total_pgpgout 374887
total_pgfault 708896
total_pgmajfault 60811
total_inactive_anon 8192
total_active_anon 0
total_inactive_file 0
total_active_file 0
total_unevictable 0
oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz1,mems_allowed=0,oom_memcg=/syz1,task_memcg=/syz1,task=syz-executor.1,pid=3107,uid=0
Memory cgroup out of memory: Killed process 3107 (syz-executor.1) total-vm:42336kB, anon-rss:488kB, file-rss:8832kB, shmem-rss:0kB, UID:0 pgtables:76kB oom_score_adj:0
----------------
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