syzbot


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

Status: auto-obsoleted due to no activity on 2023/09/21 20:14
Subsystems: mm
[Documentation on labels]
First crash: 316d, last: 316d
Similar bugs (4)
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 22d 22d 0/27 moderation: reported on 2024/06/06 10:01
upstream KCSAN: data-race in mlock_folio / need_mlock_drain (3) mm 1 185d 185d 0/27 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 66d 66d 0/27 auto-obsoleted due to no activity on 2024/05/28 09:55
upstream KCSAN: data-race in mlock_folio / need_mlock_drain mm 2 353d 354d 0/27 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 0xffff888237c29e68 of 1 bytes by task 23738 on cpu 0:
 folio_batch_add include/linux/pagevec.h:74 [inline]
 mlock_folio+0x135/0x220 mm/mlock.c:258
 mlock_vma_folio mm/internal.h:598 [inline]
 page_add_file_rmap+0x193/0x240 mm/rmap.c:1359
 do_set_pte+0x23c/0x4f0 mm/memory.c:4342
 filemap_map_pages+0x460/0x890 mm/filemap.c:3550
 do_fault_around mm/memory.c:4510 [inline]
 do_read_fault mm/memory.c:4542 [inline]
 do_fault mm/memory.c:4670 [inline]
 do_pte_missing mm/memory.c:3664 [inline]
 handle_pte_fault mm/memory.c:4939 [inline]
 __handle_mm_fault mm/memory.c:5079 [inline]
 handle_mm_fault+0x104d/0x2c10 mm/memory.c:5233
 faultin_page mm/gup.c:959 [inline]
 __get_user_pages+0x42e/0xd20 mm/gup.c:1258
 populate_vma_page_range mm/gup.c:1649 [inline]
 __mm_populate+0x23b/0x360 mm/gup.c:1758
 mm_populate include/linux/mm.h:3213 [inline]
 __do_sys_mlockall mm/mlock.c:727 [inline]
 __se_sys_mlockall+0x28d/0x320 mm/mlock.c:703
 __x64_sys_mlockall+0x1f/0x30 mm/mlock.c:703
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888237c29e68 of 1 bytes by task 3122 on cpu 1:
 folio_batch_count include/linux/pagevec.h:53 [inline]
 need_mlock_drain+0x30/0x50 mm/mlock.c:236
 cpu_needs_drain mm/swap.c:801 [inline]
 __lru_add_drain_all+0x240/0x420 mm/swap.c:889
 lru_add_drain_all+0x10/0x20 mm/swap.c:905
 invalidate_bdev+0x5a/0x80 block/bdev.c:86
 ext4_put_super+0x502/0x7f0 fs/ext4/super.c:1340
 generic_shutdown_super+0xd9/0x260 fs/super.c:499
 kill_block_super+0x3b/0x60 fs/super.c:1417
 deactivate_locked_super+0x6b/0xd0 fs/super.c:330
 deactivate_super+0x9b/0xb0 fs/super.c:361
 cleanup_mnt+0x272/0x2e0 fs/namespace.c:1254
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1261
 task_work_run+0x135/0x1a0 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xd1/0xe0 kernel/entry/common.c:171
 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297
 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x08 -> 0x0f

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3122 Comm: syz-executor.4 Not tainted 6.5.0-rc6-syzkaller-00038-g16931859a650 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/08/17 20:06 upstream 16931859a650 74b106b6 .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.