syzbot


KCSAN: data-race in drain_all_stock / drain_stock (8)

Status: auto-obsoleted due to no activity on 2024/01/01 19:14
Subsystems: cgroups mm
[Documentation on labels]
Reported-by: syzbot+b116632ad98620c6da29@syzkaller.appspotmail.com
First crash: 246d, last: 92d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in drain_all_stock / drain_stock (7) cgroups mm 4 315d 397d 0/26 auto-obsoleted due to no activity on 2023/05/23 02:38
upstream KCSAN: data-race in drain_all_stock / drain_stock (5) cgroups mm 1 561d 561d 0/26 auto-closed as invalid on 2022/09/19 00:38
upstream KCSAN: data-race in drain_all_stock / drain_stock (3) cgroups mm 1 700d 700d 0/26 auto-closed as invalid on 2022/05/03 08:41
upstream KCSAN: data-race in drain_all_stock / drain_stock (6) cgroups mm 4 454d 512d 0/26 auto-obsoleted due to no activity on 2023/01/16 19:50
upstream KCSAN: data-race in drain_all_stock / drain_stock (2) cgroups mm 3 856d 861d 0/26 auto-closed as invalid on 2021/11/28 07:11
upstream KCSAN: data-race in drain_all_stock / drain_stock cgroups mm 1 1323d 1323d 0/26 auto-closed as invalid on 2020/08/18 19:14
upstream KCSAN: data-race in drain_all_stock / drain_stock (4) cgroups mm 2 609d 639d 0/26 auto-closed as invalid on 2022/08/02 11:05
upstream KCSAN: data-race in drain_all_stock / drain_stock (9) cgroups mm 3 1d20h 39d 0/26 moderation: reported on 2024/01/18 23:03

Sample crash report:
==================================================================
BUG: KCSAN: data-race in drain_all_stock / drain_stock

write to 0xffff888237d2a3c0 of 4 bytes by task 28928 on cpu 1:
 drain_stock+0x48/0xf0 mm/memcontrol.c:2320
 __refill_stock+0x33/0xb0 mm/memcontrol.c:2360
 refill_stock mm/memcontrol.c:2375 [inline]
 try_charge_memcg+0x9ee/0xd30 mm/memcontrol.c:2826
 try_charge mm/memcontrol.c:2884 [inline]
 charge_memcg mm/memcontrol.c:7210 [inline]
 __mem_cgroup_charge+0x63/0xf0 mm/memcontrol.c:7225
 mem_cgroup_charge include/linux/memcontrol.h:684 [inline]
 wp_page_copy mm/memory.c:3143 [inline]
 do_wp_page+0x9d4/0x1f40 mm/memory.c:3510
 handle_pte_fault mm/memory.c:5054 [inline]
 __handle_mm_fault mm/memory.c:5179 [inline]
 handle_mm_fault+0xe5d/0x2dd0 mm/memory.c:5344
 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x3ff/0x6c0 arch/x86/mm/fault.c:1561
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

read to 0xffff888237d2a3c0 of 4 bytes by task 28993 on cpu 0:
 drain_all_stock+0xd3/0x2d0 mm/memcontrol.c:2405
 try_charge_memcg+0x6c5/0xd30 mm/memcontrol.c:2750
 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3255
 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3281
 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4585
 alloc_pages_mpol+0xb1/0x1d0 mm/mempolicy.c:2133
 alloc_pages+0xe0/0x100 mm/mempolicy.c:2204
 pagetable_alloc include/linux/mm.h:2830 [inline]
 __pte_alloc_one include/asm-generic/pgalloc.h:68 [inline]
 pte_alloc_one+0x32/0xe0 arch/x86/mm/pgtable.c:33
 do_fault_around mm/memory.c:4580 [inline]
 do_read_fault mm/memory.c:4619 [inline]
 do_fault mm/memory.c:4762 [inline]
 do_pte_missing mm/memory.c:3730 [inline]
 handle_pte_fault mm/memory.c:5038 [inline]
 __handle_mm_fault mm/memory.c:5179 [inline]
 handle_mm_fault+0x11d6/0x2dd0 mm/memory.c:5344
 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x3ff/0x6c0 arch/x86/mm/fault.c:1561
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

value changed: 0x00000008 -> 0x0000003d

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 28993 Comm: syz-executor.2 Not tainted 6.7.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
==================================================================
syz-executor.2 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000
CPU: 1 PID: 28993 Comm: syz-executor.2 Not tainted 6.7.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
 <TASK>
 __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:460
 oom_kill_process+0x33a/0x4c0 mm/oom_kill.c:1031
 out_of_memory+0x9ca/0xbf0 mm/oom_kill.c:1169
 mem_cgroup_out_of_memory+0x139/0x190 mm/memcontrol.c:1791
 mem_cgroup_oom mm/memcontrol.c:2021 [inline]
 try_charge_memcg+0x75c/0xd30 mm/memcontrol.c:2790
 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3255
 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3281
 memcg_kmem_charge_page include/linux/memcontrol.h:1826 [inline]
 memcg_charge_kernel_stack+0x146/0x210 kernel/fork.c:260
 alloc_thread_stack_node kernel/fork.c:294 [inline]
 dup_task_struct+0x125/0x480 kernel/fork.c:1118
 copy_process+0x3a6/0x20a0 kernel/fork.c:2332
 kernel_clone+0x169/0x560 kernel/fork.c:2907
 __do_sys_clone3 kernel/fork.c:3208 [inline]
 __se_sys_clone3+0x1b5/0x1f0 kernel/fork.c:3192
 __x64_sys_clone3+0x31/0x40 kernel/fork.c:3192
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f46dcfdc8d9
Code: ff ff eb d2 e8 f8 62 fd ff 0f 1f 84 00 00 00 00 00 b8 ea ff ff ff 48 85 ff 74 2c 48 85 d2 74 27 49 89 c8 b8 b3 01 00 00 0f 05 <48> 85 c0 7c 18 74 01 c3 31 ed 48 83 e4 f0 4c 89 c7 ff d2 48 89 c7
RSP: 002b:00007ffde96fbd98 EFLAGS: 00000202 ORIG_RAX: 00000000000001b3
RAX: ffffffffffffffda RBX: 00007f46dcf84fb0 RCX: 00007f46dcfdc8d9
RDX: 00007f46dcf84fb0 RSI: 0000000000000058 RDI: 00007ffde96fbde0
RBP: 00007f46dc3336c0 R08: 00007f46dc3336c0 R09: 00007ffde96fbec7
R10: 0000000000000008 R11: 0000000000000202 R12: ffffffffffffffb0
R13: 000000000000000b R14: 00007ffde96fbde0 R15: 00007ffde96fbec8
 </TASK>
memory: usage 307200kB, limit 307200kB, failcnt 529597
memory+swap: usage 307788kB, limit 9007199254740988kB, failcnt 0
kmem: usage 307184kB, limit 9007199254740988kB, failcnt 0
Memory cgroup stats for /syz2:
cache 0
rss 12288
shmem 0
mapped_file 0
dirty 0
writeback 0
workingset_refault_anon 327551
workingset_refault_file 65
swap 602112
swapcached 12288
pgpgin 673881
pgpgout 673878
pgfault 1270328
pgmajfault 220100
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 12288
total_shmem 0
total_mapped_file 0
total_dirty 0
total_writeback 0
total_workingset_refault_anon 327551
total_workingset_refault_file 65
total_swap 602112
total_swapcached 12288
total_pgpgin 673881
total_pgpgout 673878
total_pgfault 1270328
total_pgmajfault 220100
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=syz2,mems_allowed=0,oom_memcg=/syz2,task_memcg=/syz2,task=syz-executor.2,pid=28993,uid=0
Memory cgroup out of memory: Killed process 28993 (syz-executor.2) total-vm:42456kB, anon-rss:376kB, file-rss:8832kB, shmem-rss:0kB, UID:0 pgtables:76kB oom_score_adj:1000

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/27 19:13 upstream 2cc14f52aeb7 7ec6c044 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/10/29 05:46 upstream 51a7691038c3 3c418d72 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/10/01 20:43 upstream e402b08634b3 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/09/17 15:16 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/08/29 00:58 upstream 727dbda16b83 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/08/28 12:36 upstream 2dde18cd1d8f 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/08/23 15:33 upstream 89bf6209cad6 b81ca3f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/08/19 04:49 upstream d4ddefee5160 d216d8a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/08/13 02:03 upstream ae545c3283dc 39990d51 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/07/19 23:04 upstream bfa3037d8280 4547cdf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/07/10 02:20 upstream 06c2afb862f9 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/06/26 02:46 upstream 547cc9be86f4 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
* Struck through repros no longer work on HEAD.