syzbot


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

Status: moderation: reported on 2026/05/03 02:22
Subsystems: mm
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+5ff4a12779d5bcd990f7@syzkaller.appspotmail.com
First crash: 66d, last: 8d20h
✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision Error
e5419c01-9a2e-459f-96f4-979b1e4ccec7 assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ KCSAN: data-race in folios_put_refs / need_mlock_drain (4) 2026/05/23 15:14 2026/05/23 15:14 2026/05/23 15:56 c69befb30ac10e158cc9d1557b508ee3f0eca1de

			
		
8e0f59fc-bb6f-402e-9b47-ceaa1d2754a6 assessment-kcsan Benign: ✅ Confident: ✅ KCSAN: data-race in folios_put_refs / need_mlock_drain (4) 2026/05/03 02:22 2026/05/03 02:22 2026/05/03 02:44 a0d91488fc4a789de6e559c15c02b0633b053c1d

			
		
Similar bugs (3)
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 660d 750d 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 (3) mm 6 4 178d 213d 0/29 auto-obsoleted due to no activity on 2026/03/07 21:34
upstream KCSAN: data-race in folios_put_refs / need_mlock_drain (2) mm 6 24 276d 611d 0/29 auto-obsoleted due to no activity on 2025/11/30 16:35

Sample crash report:
EXT4-fs (loop8): unmounting filesystem 00000000-0000-0000-0000-000000000000.
==================================================================
BUG: KCSAN: data-race in folios_put_refs / need_mlock_drain

write to 0xffff888237c27088 of 1 bytes by task 18231 on cpu 0:
 folio_batch_reinit include/linux/folio_batch.h:50 [inline]
 folios_put_refs+0x2b4/0x300 mm/swap.c:1051
 folios_put include/linux/mm.h:2183 [inline]
 mlock_folio_batch+0x1beb/0x1c20 mm/mlock.c:209
 munlock_folio+0xd2/0x120 mm/mlock.c:303
 munlock_vma_folio mm/internal.h:1215 [inline]
 __folio_remove_rmap mm/rmap.c:1883 [inline]
 folio_remove_rmap_ptes+0x187/0x190 mm/rmap.c:1900
 zap_present_folio_ptes mm/memory.c:1672 [inline]
 zap_present_ptes mm/memory.c:1730 [inline]
 do_zap_pte_range mm/memory.c:1832 [inline]
 zap_pte_range mm/memory.c:1934 [inline]
 zap_pmd_range mm/memory.c:2020 [inline]
 zap_pud_range mm/memory.c:2048 [inline]
 zap_p4d_range mm/memory.c:2069 [inline]
 __zap_vma_range+0x14c9/0x2c60 mm/memory.c:2109
 unmap_vmas+0x200/0x310 mm/memory.c:2178
 exit_mmap+0x1a2/0x5e0 mm/mmap.c:1300
 __mmput+0x28/0x1c0 kernel/fork.c:1182
 mmput+0x40/0x50 kernel/fork.c:1205
 exit_mm+0x113/0x1a0 kernel/exit.c:610
 do_exit+0x438/0x1500 kernel/exit.c:992
 do_group_exit+0xfe/0x140 kernel/exit.c:1147
 get_signal+0xe07/0xf10 kernel/signal.c:3038
 arch_do_signal_or_restart+0x96/0x480 arch/x86/kernel/signal.c:337
 __exit_to_user_mode_loop kernel/entry/common.c:66 [inline]
 exit_to_user_mode_loop+0x15d/0x8c0 kernel/entry/common.c:101
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x23c/0x3c0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237c27088 of 1 bytes by task 14699 on cpu 1:
 folio_batch_count include/linux/folio_batch.h:56 [inline]
 need_mlock_drain+0x30/0x50 mm/mlock.c:235
 cpu_needs_drain mm/swap.c:837 [inline]
 __lru_add_drain_all+0x273/0x450 mm/swap.c:928
 lru_add_drain_all+0x10/0x20 mm/swap.c:944
 invalidate_bdev+0x47/0x70 block/bdev.c:101
 ext4_put_super+0x614/0x7c0 fs/ext4/super.c:1355
 generic_shutdown_super+0xee/0x220 fs/super.c:647
 kill_block_super+0x2a/0x70 fs/super.c:1665
 ext4_kill_sb+0x42/0x80 fs/ext4/super.c:7499
 deactivate_locked_super+0x75/0x1c0 fs/super.c:477
 deactivate_super+0x97/0xa0 fs/super.c:510
 cleanup_mnt+0x2c3/0x340 fs/namespace.c:1317
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1324
 task_work_run+0x130/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:70 [inline]
 exit_to_user_mode_loop+0x1e4/0x8c0 kernel/entry/common.c:101
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x23c/0x3c0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x1f -> 0x05

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 14699 Comm: syz-executor Tainted: G        W           syzkaller #0 PREEMPT(lazy) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/06/29 21:40 upstream dc59e4fea9d8 6a0c72dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in folios_put_refs / need_mlock_drain
2026/06/14 20:50 upstream 8cd9520d35a6 1d2f3589 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in folios_put_refs / need_mlock_drain
2026/05/03 02:22 upstream 66edb901bf87 a0d91488 .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.