syzbot


KCSAN: data-race in mlock_folio / need_mlock_drain (10)

Status: moderation: reported on 2026/04/30 11:42
Subsystems: mm
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+2f4ec809c0aa94d7d565@syzkaller.appspotmail.com
First crash: 28d, last: 3d11h
✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision Error
6b123187-a81f-4db8-8cd1-1f3ad050b89b assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ KCSAN: data-race in mlock_folio / need_mlock_drain (10) 2026/05/22 23:53 2026/05/22 23:53 2026/05/23 00:49 df8ac09c914d5408499c5695877a3e0e31969e6f
6bc7a208-6133-4e12-b047-83e42024b0c7 assessment-kcsan Benign: ✅ Confident: ✅ KCSAN: data-race in mlock_folio / need_mlock_drain (10) 2026/04/30 11:42 2026/04/30 11:42 2026/04/30 12:03 005438fcbda13a7d244e9d155c2150fc79e9f734
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (5) mm 6 1 721d 721d 0/29 auto-obsoleted due to no activity on 2024/07/11 10:01
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (9) mm 6 5 98d 198d 0/29 auto-obsoleted due to no activity on 2026/04/16 07:40
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (7) mm 6 3 346d 389d 0/29 auto-obsoleted due to no activity on 2025/08/10 18:09
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (2) mm 6 1 1014d 1014d 0/29 auto-obsoleted due to no activity on 2023/09/21 20:14
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (6) mm 6 13 504d 682d 0/29 auto-obsoleted due to no activity on 2025/03/06 02:54
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (3) mm 6 1 884d 884d 0/29 auto-obsoleted due to no activity on 2024/01/30 08:30
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (8) mm 6 1 275d 275d 0/29 auto-obsoleted due to no activity on 2025/10/20 23:51
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (4) mm 6 1 765d 765d 0/29 auto-obsoleted due to no activity on 2024/05/28 09:55
upstream KCSAN: data-race in mlock_folio / need_mlock_drain mm 6 2 1052d 1052d 0/29 auto-obsoleted due to no activity on 2023/08/15 13:37

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

read-write to 0xffff888237c27248 of 1 bytes by task 17070 on cpu 0:
 folio_batch_add include/linux/folio_batch.h:77 [inline]
 mlock_folio+0x14d/0x240 mm/mlock.c:257
 mlock_vma_folio mm/internal.h:1199 [inline]
 __folio_add_file_rmap mm/rmap.c:1715 [inline]
 folio_add_file_rmap_ptes+0x1d0/0x1e0 mm/rmap.c:1732
 set_pte_range+0x2c1/0x4f0 mm/memory.c:5635
 filemap_map_order0_folio mm/filemap.c:3862 [inline]
 filemap_map_pages+0x5b8/0xea0 mm/filemap.c:3932
 do_fault_around mm/memory.c:5867 [inline]
 do_read_fault mm/memory.c:5900 [inline]
 do_fault mm/memory.c:6043 [inline]
 do_pte_missing mm/memory.c:4566 [inline]
 handle_pte_fault mm/memory.c:6427 [inline]
 __handle_mm_fault mm/memory.c:6565 [inline]
 handle_mm_fault+0x1508/0x2e70 mm/memory.c:6734
 faultin_page mm/gup.c:1126 [inline]
 __get_user_pages+0x1290/0x1f10 mm/gup.c:1428
 populate_vma_page_range mm/gup.c:1860 [inline]
 __mm_populate+0x242/0x390 mm/gup.c:1963
 do_mlock+0x47c/0x520 mm/mlock.c:659
 __do_sys_mlock mm/mlock.c:667 [inline]
 __se_sys_mlock mm/mlock.c:665 [inline]
 __x64_sys_mlock+0x36/0x50 mm/mlock.c:665
 x64_sys_call+0x1ab3/0x3020 arch/x86/include/generated/asm/syscalls_64.h:150
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x12c/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237c27248 of 1 bytes by task 15812 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:792 [inline]
 __lru_add_drain_all+0x273/0x450 mm/swap.c:883
 lru_add_drain_all+0x10/0x20 mm/swap.c:899
 invalidate_bdev+0x47/0x70 block/bdev.c:101
 ext4_put_super+0x610/0x7b0 fs/ext4/super.c:1355
 generic_shutdown_super+0xee/0x220 fs/super.c:646
 kill_block_super+0x2a/0x70 fs/super.c:1725
 ext4_kill_sb+0x42/0x80 fs/ext4/super.c:7492
 deactivate_locked_super+0x75/0x1c0 fs/super.c:476
 deactivate_super+0x97/0xa0 fs/super.c:509
 cleanup_mnt+0x2bb/0x330 fs/namespace.c:1312
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1319
 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:67 [inline]
 exit_to_user_mode_loop+0x211/0x820 kernel/entry/common.c:98
 __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+0x232/0x3b0 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00 -> 0x01

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

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/05/25 06:19 upstream 6a97c4d5262d c69befb3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2026/04/30 11:42 upstream e75a43c7cec4 a7464baf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
* Struck through repros no longer work on HEAD.