syzbot


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

Status: moderation: reported on 2024/07/15 10:41
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+8c752dc4d5931f95802c@syzkaller.appspotmail.com
First crash: 128d, last: 4d17h
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (5) mm 1 167d 167d 0/28 auto-obsoleted due to no activity on 2024/07/11 10:01
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (2) mm 1 461d 461d 0/28 auto-obsoleted due to no activity on 2023/09/21 20:14
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (3) mm 1 330d 330d 0/28 auto-obsoleted due to no activity on 2024/01/30 08:30
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (4) mm 1 211d 211d 0/28 auto-obsoleted due to no activity on 2024/05/28 09:55
upstream KCSAN: data-race in mlock_folio / need_mlock_drain mm 2 498d 499d 0/28 auto-obsoleted due to no activity on 2023/08/15 13:37

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

read-write to 0xffff888237c2b5a0 of 1 bytes by task 20827 on cpu 0:
 folio_batch_add include/linux/pagevec.h:77 [inline]
 mlock_folio+0x136/0x210 mm/mlock.c:257
 mlock_vma_folio mm/internal.h:926 [inline]
 __folio_add_anon_rmap mm/rmap.c:1349 [inline]
 folio_add_anon_rmap_ptes+0x219/0x220 mm/rmap.c:1372
 remove_migration_pte+0x62e/0x9c0 mm/migrate.c:333
 rmap_walk_anon+0x28f/0x440 mm/rmap.c:2635
 rmap_walk+0x5b/0x70 mm/rmap.c:2713
 remove_migration_ptes mm/migrate.c:373 [inline]
 migrate_folio_move mm/migrate.c:1388 [inline]
 migrate_pages_batch+0x1374/0x1910 mm/migrate.c:1898
 migrate_pages_sync mm/migrate.c:1964 [inline]
 migrate_pages+0xff1/0x1820 mm/migrate.c:2073
 do_mbind mm/mempolicy.c:1390 [inline]
 kernel_mbind mm/mempolicy.c:1533 [inline]
 __do_sys_mbind mm/mempolicy.c:1607 [inline]
 __se_sys_mbind+0xf76/0x1160 mm/mempolicy.c:1603
 __x64_sys_mbind+0x78/0x90 mm/mempolicy.c:1603
 x64_sys_call+0x2b4d/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:238
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237c2b5a0 of 1 bytes by task 20831 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:778 [inline]
 __lru_add_drain_all+0x22a/0x3f0 mm/swap.c:866
 lru_cache_disable+0x1f/0x30 mm/swap.c:919
 do_mbind mm/mempolicy.c:1307 [inline]
 kernel_mbind mm/mempolicy.c:1533 [inline]
 __do_sys_mbind mm/mempolicy.c:1607 [inline]
 __se_sys_mbind+0x4df/0x1160 mm/mempolicy.c:1603
 __x64_sys_mbind+0x78/0x90 mm/mempolicy.c:1603
 x64_sys_call+0x2b4d/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:238
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00 -> 0x01

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 20831 Comm: syz.3.6158 Not tainted 6.12.0-rc7-syzkaller-00189-ge8bdb3c8be08 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024
==================================================================

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/16 12:57 upstream e8bdb3c8be08 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/11/09 00:28 upstream f1dce1f09380 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/10/23 08:31 upstream c2ee9f594da8 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/10/22 17:40 upstream d12937763990 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/09/26 12:24 upstream 11a299a7933e 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/09/11 14:03 upstream 8d8d276ba2fb 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/08/30 11:57 upstream 20371ba12063 ee2602b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/08/01 11:27 upstream 21b136cc63d2 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/07/29 09:22 upstream 8400291e289e 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/07/28 14:19 upstream 5437f30d3458 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_folio / need_mlock_drain
2024/07/15 10:40 upstream 0c3836482481 c605e6a2 .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.