syzbot


KCSAN: data-race in scan_swap_map_slots / scan_swap_map_slots

Status: auto-obsoleted due to no activity on 2024/01/09 18:17
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+5753f436c6a28cd8e35e@syzkaller.appspotmail.com
First crash: 80d, last: 80d

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

write to 0xffff88810286b670 of 4 bytes by task 12242 on cpu 1:
 swap_range_alloc mm/swapfile.c:702 [inline]
 scan_swap_map_slots+0x96e/0x1240 mm/swapfile.c:920
 get_swap_pages+0x31d/0x480 mm/swapfile.c:1097
 refill_swap_slots_cache mm/swap_slots.c:266 [inline]
 folio_alloc_swap+0x2d0/0x4a0 mm/swap_slots.c:334
 add_to_swap+0x18/0x80 mm/swap_state.c:185
 shrink_folio_list+0x1421/0x2540 mm/vmscan.c:1209
 reclaim_folio_list+0x7b/0x1d0 mm/vmscan.c:2100
 reclaim_pages+0x220/0x280 mm/vmscan.c:2136
 madvise_cold_or_pageout_pte_range+0x98c/0x9f0 mm/madvise.c:515
 walk_pmd_range mm/pagewalk.c:143 [inline]
 walk_pud_range mm/pagewalk.c:221 [inline]
 walk_p4d_range mm/pagewalk.c:256 [inline]
 walk_pgd_range+0x80a/0xec0 mm/pagewalk.c:293
 __walk_page_range+0xc2/0x320 mm/pagewalk.c:395
 walk_page_range+0x2c7/0x3f0 mm/pagewalk.c:521
 madvise_pageout_page_range mm/madvise.c:574 [inline]
 madvise_pageout mm/madvise.c:601 [inline]
 madvise_vma_behavior mm/madvise.c:1020 [inline]
 madvise_walk_vmas mm/madvise.c:1249 [inline]
 do_madvise+0x1b27/0x26f0 mm/madvise.c:1429
 __do_sys_madvise mm/madvise.c:1442 [inline]
 __se_sys_madvise mm/madvise.c:1440 [inline]
 __x64_sys_madvise+0x60/0x70 mm/madvise.c:1440
 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

read to 0xffff88810286b670 of 4 bytes by task 12240 on cpu 0:
 scan_swap_map_slots+0x1e7/0x1240 mm/swapfile.c:852
 get_swap_pages+0x31d/0x480 mm/swapfile.c:1097
 refill_swap_slots_cache mm/swap_slots.c:266 [inline]
 folio_alloc_swap+0x2d0/0x4a0 mm/swap_slots.c:334
 add_to_swap+0x18/0x80 mm/swap_state.c:185
 shrink_folio_list+0x1421/0x2540 mm/vmscan.c:1209
 reclaim_folio_list+0x7b/0x1d0 mm/vmscan.c:2100
 reclaim_pages+0x220/0x280 mm/vmscan.c:2136
 madvise_cold_or_pageout_pte_range+0x98c/0x9f0 mm/madvise.c:515
 walk_pmd_range mm/pagewalk.c:143 [inline]
 walk_pud_range mm/pagewalk.c:221 [inline]
 walk_p4d_range mm/pagewalk.c:256 [inline]
 walk_pgd_range+0x80a/0xec0 mm/pagewalk.c:293
 __walk_page_range+0xc2/0x320 mm/pagewalk.c:395
 walk_page_range+0x2c7/0x3f0 mm/pagewalk.c:521
 madvise_pageout_page_range mm/madvise.c:574 [inline]
 madvise_pageout mm/madvise.c:601 [inline]
 madvise_vma_behavior mm/madvise.c:1020 [inline]
 madvise_walk_vmas mm/madvise.c:1249 [inline]
 do_madvise+0x1b27/0x26f0 mm/madvise.c:1429
 __do_sys_madvise mm/madvise.c:1442 [inline]
 __se_sys_madvise mm/madvise.c:1440 [inline]
 __x64_sys_madvise+0x60/0x70 mm/madvise.c:1440
 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

value changed: 0x0000070f -> 0x00000722

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 12240 Comm: syz-executor.2 Not tainted 6.7.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/03 13:48 upstream 33cc938e65a9 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in scan_swap_map_slots / scan_swap_map_slots
* Struck through repros no longer work on HEAD.