syzbot


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

Status: moderation: reported on 2025/08/25 23:51
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+0b56a21a45d02d091d5e@syzkaller.appspotmail.com
First crash: 3d20h, last: 3d20h
Similar bugs (7)
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 449d 449d 0/29 auto-obsoleted due to no activity on 2024/07/11 10:01
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (7) mm 6 3 75d 117d 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 743d 743d 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 232d 410d 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 612d 612d 0/29 auto-obsoleted due to no activity on 2024/01/30 08:30
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (4) mm 6 1 493d 493d 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 780d 780d 0/29 auto-obsoleted due to no activity on 2023/08/15 13:37

Sample crash report:
loop4: detected capacity change from 0 to 2048
EXT4-fs (loop4): failed to initialize system zone (-117)
EXT4-fs (loop4): mount failed
==================================================================
BUG: KCSAN: data-race in mlock_folio / need_mlock_drain

read-write to 0xffff888237c26a48 of 1 bytes by task 16953 on cpu 0:
 folio_batch_add include/linux/pagevec.h:77 [inline]
 mlock_folio+0x128/0x200 mm/mlock.c:257
 mlock_vma_folio mm/internal.h:1038 [inline]
 __folio_add_anon_rmap mm/rmap.c:1488 [inline]
 folio_add_anon_rmap_ptes+0x20f/0x220 mm/rmap.c:1511
 remove_migration_pte+0x67e/0xa70 mm/migrate.c:432
 rmap_walk_anon+0x27d/0x430 mm/rmap.c:2842
 rmap_walk+0x8b/0xd0 mm/rmap.c:2947
 remove_migration_ptes mm/migrate.c:472 [inline]
 migrate_folio_move mm/migrate.c:1388 [inline]
 migrate_folios_move mm/migrate.c:1719 [inline]
 migrate_pages_batch+0x1422/0x1ae0 mm/migrate.c:1966
 migrate_pages_sync mm/migrate.c:1996 [inline]
 migrate_pages+0xf5f/0x1770 mm/migrate.c:2105
 do_mbind mm/mempolicy.c:1539 [inline]
 kernel_mbind mm/mempolicy.c:1682 [inline]
 __do_sys_mbind mm/mempolicy.c:1756 [inline]
 __se_sys_mbind+0x975/0xac0 mm/mempolicy.c:1752
 __x64_sys_mbind+0x78/0x90 mm/mempolicy.c:1752
 x64_sys_call+0x2932/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:238
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237c26a48 of 1 bytes by task 16954 on cpu 1:
 folio_batch_count include/linux/pagevec.h:56 [inline]
 need_mlock_drain+0x30/0x50 mm/mlock.c:235
 cpu_needs_drain mm/swap.c:784 [inline]
 __lru_add_drain_all+0x220/0x3f0 mm/swap.c:872
 lru_add_drain_all+0x10/0x20 mm/swap.c:888
 invalidate_bdev+0x47/0x70 block/bdev.c:101
 __ext4_fill_super fs/ext4/super.c:5703 [inline]
 ext4_fill_super+0x2b5d/0x35d0 fs/ext4/super.c:5728
 get_tree_bdev_flags+0x291/0x300 fs/super.c:1692
 get_tree_bdev+0x1f/0x30 fs/super.c:1715
 ext4_get_tree+0x1c/0x30 fs/ext4/super.c:5760
 vfs_get_tree+0x54/0x1d0 fs/super.c:1815
 do_new_mount+0x207/0x5e0 fs/namespace.c:3808
 path_mount+0x4a4/0xb20 fs/namespace.c:4123
 do_mount fs/namespace.c:4136 [inline]
 __do_sys_mount fs/namespace.c:4347 [inline]
 __se_sys_mount+0x28f/0x2e0 fs/namespace.c:4324
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4324
 x64_sys_call+0x2b4d/0x2ff0 arch/x86/include/generated/asm/syscalls_64.h:166
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00 -> 0x01

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 16954 Comm: syz.4.4352 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/25 23:51 upstream b6add54ba618 bf27483f .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.