syzbot


KCSAN: data-race in folios_put_refs / need_mlock_drain (3)

Status: moderation: reported on 2025/12/07 02:00
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+de65acfe4354d4b78123@syzkaller.appspotmail.com
First crash: 5d21h, last: 5d21h
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in folios_put_refs / need_mlock_drain mm 6 20 453d 542d 0/29 auto-obsoleted due to no activity on 2024/10/20 22:05
upstream KCSAN: data-race in folios_put_refs / need_mlock_drain (2) mm 6 24 68d 403d 0/29 auto-obsoleted due to no activity on 2025/11/30 16:35

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

write to 0xffff888237d27010 of 1 bytes by task 5144 on cpu 1:
 folio_batch_reinit include/linux/pagevec.h:50 [inline]
 folios_put_refs+0x285/0x2d0 mm/swap.c:996
 folios_put include/linux/mm.h:1671 [inline]
 mlock_folio_batch+0x1b5a/0x1b90 mm/mlock.c:209
 munlock_folio+0xd2/0x120 mm/mlock.c:303
 munlock_vma_folio mm/internal.h:1060 [inline]
 __folio_remove_rmap mm/rmap.c:1762 [inline]
 folio_remove_rmap_ptes+0x197/0x1a0 mm/rmap.c:1779
 zap_present_folio_ptes mm/memory.c:1650 [inline]
 zap_present_ptes mm/memory.c:1708 [inline]
 do_zap_pte_range mm/memory.c:1810 [inline]
 zap_pte_range mm/memory.c:1854 [inline]
 zap_pmd_range mm/memory.c:1946 [inline]
 zap_pud_range mm/memory.c:1975 [inline]
 zap_p4d_range mm/memory.c:1996 [inline]
 unmap_page_range+0x144c/0x2530 mm/memory.c:2017
 unmap_single_vma mm/memory.c:2059 [inline]
 unmap_vmas+0x23d/0x3a0 mm/memory.c:2101
 exit_mmap+0x1ae/0x6b0 mm/mmap.c:1277
 __mmput+0x28/0x1c0 kernel/fork.c:1130
 mmput+0x40/0x50 kernel/fork.c:1153
 exit_mm+0xe4/0x180 kernel/exit.c:583
 do_exit+0x427/0x15d0 kernel/exit.c:961
 do_group_exit+0xff/0x140 kernel/exit.c:1114
 get_signal+0xe58/0xf70 kernel/signal.c:3034
 arch_do_signal_or_restart+0x96/0x450 arch/x86/kernel/signal.c:337
 __exit_to_user_mode_loop kernel/entry/common.c:41 [inline]
 exit_to_user_mode_loop+0x6a/0x740 kernel/entry/common.c:75
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline]
 do_syscall_64+0x202/0x2a0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237d27010 of 1 bytes by task 32465 on cpu 0:
 folio_batch_count include/linux/pagevec.h:56 [inline]
 need_mlock_drain+0x30/0x50 mm/mlock.c:235
 cpu_needs_drain mm/swap.c:786 [inline]
 __lru_add_drain_all+0x273/0x450 mm/swap.c:877
 lru_add_drain_all+0x10/0x20 mm/swap.c:893
 invalidate_bdev+0x47/0x70 block/bdev.c:101
 ext4_put_super+0x624/0x7d0 fs/ext4/super.c:1348
 generic_shutdown_super+0xe6/0x210 fs/super.c:643
 kill_block_super+0x2a/0x70 fs/super.c:1722
 ext4_kill_sb+0x42/0x80 fs/ext4/super.c:7444
 deactivate_locked_super+0x75/0x1c0 fs/super.c:474
 deactivate_super+0x97/0xa0 fs/super.c:507
 cleanup_mnt+0x2a9/0x320 fs/namespace.c:1318
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1325
 task_work_run+0x131/0x1a0 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:44 [inline]
 exit_to_user_mode_loop+0x1fe/0x740 kernel/entry/common.c:75
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline]
 do_syscall_64+0x202/0x2a0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x1f -> 0x11

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 32465 Comm: syz-executor Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/07 02:00 upstream cc3ee4ba57b7 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in folios_put_refs / need_mlock_drain
* Struck through repros no longer work on HEAD.