syzbot


KCSAN: data-race in do_try_to_free_pages / shrink_node (6)

Status: moderation: reported on 2024/06/30 17:46
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+24349a13216392fc19f2@syzkaller.appspotmail.com
First crash: 12d, last: 12d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in do_try_to_free_pages / shrink_node (5) mm 1 113d 113d 0/27 auto-obsoleted due to no activity on 2024/04/25 15:29
upstream KCSAN: data-race in do_try_to_free_pages / shrink_node (4) mm 7 175d 215d 0/27 auto-obsoleted due to no activity on 2024/02/23 13:13
upstream KCSAN: data-race in do_try_to_free_pages / shrink_node (2) mm 3 375d 391d 0/27 auto-obsoleted due to no activity on 2023/08/07 23:22
upstream KCSAN: data-race in do_try_to_free_pages / shrink_node (3) mm 2 329d 337d 0/27 auto-obsoleted due to no activity on 2023/09/22 16:58
upstream KCSAN: data-race in do_try_to_free_pages / shrink_node mm 35 1622d 1674d 0/27 auto-closed as invalid on 2020/04/13 04:50

Sample crash report:
==================================================================
BUG: KCSAN: data-race in do_try_to_free_pages / shrink_node

write to 0xffff8881112f3e70 of 8 bytes by task 3081 on cpu 0:
 snapshot_refaults mm/vmscan.c:6191 [inline]
 do_try_to_free_pages+0x93c/0xc50 mm/vmscan.c:6253
 try_to_free_mem_cgroup_pages+0x1eb/0x4e0 mm/vmscan.c:6545
 try_charge_memcg+0x27a/0xcd0 mm/memcontrol.c:2944
 try_charge mm/memcontrol.c:3092 [inline]
 charge_memcg mm/memcontrol.c:7495 [inline]
 __mem_cgroup_charge+0x63/0x100 mm/memcontrol.c:7510
 mem_cgroup_charge include/linux/memcontrol.h:691 [inline]
 filemap_add_folio+0x53/0x1b0 mm/filemap.c:965
 page_cache_ra_unbounded+0x148/0x2e0 mm/readahead.c:252
 do_page_cache_ra mm/readahead.c:303 [inline]
 page_cache_ra_order+0xf7/0x110 mm/readahead.c:547
 do_sync_mmap_readahead+0x267/0x2a0 mm/filemap.c:3175
 filemap_fault+0x331/0xa60 mm/filemap.c:3313
 __do_fault+0xb6/0x200 mm/memory.c:4556
 do_read_fault mm/memory.c:4921 [inline]
 do_fault mm/memory.c:5051 [inline]
 do_pte_missing mm/memory.c:3897 [inline]
 handle_pte_fault mm/memory.c:5381 [inline]
 __handle_mm_fault mm/memory.c:5524 [inline]
 handle_mm_fault+0xdeb/0x2a80 mm/memory.c:5689
 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x3b9/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffff8881112f3e70 of 8 bytes by task 5215 on cpu 1:
 prepare_scan_control mm/vmscan.c:2274 [inline]
 shrink_node+0x383/0x13c0 mm/vmscan.c:5922
 shrink_zones mm/vmscan.c:6168 [inline]
 do_try_to_free_pages+0x3c6/0xc50 mm/vmscan.c:6230
 try_to_free_mem_cgroup_pages+0x1eb/0x4e0 mm/vmscan.c:6545
 try_charge_memcg+0x27a/0xcd0 mm/memcontrol.c:2944
 try_charge mm/memcontrol.c:3092 [inline]
 charge_memcg mm/memcontrol.c:7495 [inline]
 mem_cgroup_swapin_charge_folio+0x107/0x1a0 mm/memcontrol.c:7580
 __read_swap_cache_async+0x2b9/0x520 mm/swap_state.c:514
 swap_cluster_readahead+0x276/0x3f0 mm/swap_state.c:678
 swapin_readahead+0xe2/0x7a0 mm/swap_state.c:904
 do_swap_page+0x3bc/0x1840 mm/memory.c:4065
 handle_pte_fault mm/memory.c:5384 [inline]
 __handle_mm_fault mm/memory.c:5524 [inline]
 handle_mm_fault+0x809/0x2a80 mm/memory.c:5689
 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x3b9/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

value changed: 0x0000000000000019 -> 0x000000000000001c

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 5215 Comm: syz.4.525 Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
==================================================================
syz.4.525 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=1000
CPU: 1 PID: 5215 Comm: syz.4.525 Not tainted 6.10.0-rc5-syzkaller-00282-g8282d5af7be8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xf2/0x150 lib/dump_stack.c:114
 dump_stack+0x15/0x20 lib/dump_stack.c:123
 dump_header+0x83/0x2d0 mm/oom_kill.c:462
 oom_kill_process+0x33e/0x4c0 mm/oom_kill.c:1035
 out_of_memory+0x9af/0xbe0 mm/oom_kill.c:1173
 mem_cgroup_out_of_memory+0x13e/0x190 mm/memcontrol.c:1975
 mem_cgroup_oom mm/memcontrol.c:2203 [inline]
 try_charge_memcg+0x745/0xcd0 mm/memcontrol.c:2992
 try_charge mm/memcontrol.c:3092 [inline]
 charge_memcg mm/memcontrol.c:7495 [inline]
 mem_cgroup_swapin_charge_folio+0x107/0x1a0 mm/memcontrol.c:7580
 __read_swap_cache_async+0x2b9/0x520 mm/swap_state.c:514
 swap_cluster_readahead+0x380/0x3f0 mm/swap_state.c:697
 swapin_readahead+0xe2/0x7a0 mm/swap_state.c:904
 do_swap_page+0x3bc/0x1840 mm/memory.c:4065
 handle_pte_fault mm/memory.c:5384 [inline]
 __handle_mm_fault mm/memory.c:5524 [inline]
 handle_mm_fault+0x809/0x2a80 mm/memory.c:5689
 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x3b9/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f89e410835b
Code: ff 48 8b 00 89 83 9c 00 00 00 31 f6 e8 8e ec ff ff 48 81 c3 d8 00 00 00 48 39 dd 0f 84 54 fd ff ff 80 7b 20 00 48 89 df 74 e7 <e8> 80 c4 ff ff 84 c0 74 d7 80 3d 45 3e 28 00 00 48 8b 83 a8 00 00
RSP: 002b:00007ffc0fe8f6d0 EFLAGS: 00010202
RAX: 0000000000010426 RBX: 00007f89e43c1fa0 RCX: 00000000000101d0
RDX: 0000000000000256 RSI: 00007ffc0fe8f6b0 RDI: 00007f89e43c1fa0
RBP: 00007f89e43c3aa0 R08: 0000000023b2aa3e R09: 7fffffffffffffff
R10: 00007f89e43980b8 R11: 00007f89e4398080 R12: 000000000001039c
R13: 0000000000000032 R14: 00007f89e43c3aa0 R15: 00007f89e43c2078
 </TASK>
memory: usage 307200kB, limit 307200kB, failcnt 693
memory+swap: usage 307400kB, limit 9007199254740988kB, failcnt 0
kmem: usage 307192kB, limit 9007199254740988kB, failcnt 0
Memory cgroup stats for /syz4:
cache 8192
rss 0
shmem 0
mapped_file 413696
dirty 0
writeback 0
workingset_refault_anon 167
workingset_refault_file 404
swap 208896
swapcached 0
pgpgin 56229
pgpgout 56227
pgfault 65254
pgmajfault 93
inactive_anon 0
active_anon 0
inactive_file 8192
active_file 0
unevictable 0
hierarchical_memory_limit 314572800
hierarchical_memsw_limit 9223372036854771712
total_cache 8192
total_rss 0
total_shmem 0
total_mapped_file 413696
total_dirty 0
total_writeback 0
total_workingset_refault_anon 167
total_workingset_refault_file 404
total_swap 208896
total_swapcached 0
total_pgpgin 56229
total_pgpgout 56227
total_pgfault 65254
total_pgmajfault 93
total_inactive_anon 0
total_active_anon 0
total_inactive_file 8192
total_active_file 0
total_unevictable 0
oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz4,mems_allowed=0,oom_memcg=/syz4,task_memcg=/syz4,task=syz.4.525,pid=5215,uid=0
Memory cgroup out of memory: Killed process 5215 (syz.4.525) total-vm:81156kB, anon-rss:580kB, file-rss:10308kB, shmem-rss:0kB, UID:0 pgtables:92kB oom_score_adj:1000

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/30 17:45 upstream 8282d5af7be8 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in do_try_to_free_pages / shrink_node
* Struck through repros no longer work on HEAD.