syzbot


KCSAN: data-race in mlock_new_page / need_mlock_page_drain (3)

Status: auto-obsoleted due to no activity on 2023/03/17 13:51
Subsystems: mm
[Documentation on labels]
First crash: 471d, last: 471d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in mlock_new_page / need_mlock_page_drain mm 7 698d 762d 0/26 auto-closed as invalid on 2022/07/12 22:07
upstream KCSAN: data-race in mlock_new_page / need_mlock_page_drain (2) mm 1 591d 591d 0/26 auto-obsoleted due to no activity on 2022/10/27 10:16

Sample crash report:
EXT4-fs (loop3): unmounting filesystem 00000000-0000-0000-0000-000000000000.
==================================================================
BUG: KCSAN: data-race in mlock_new_page / need_mlock_page_drain

read-write to 0xffff888237d28168 of 1 bytes by task 12469 on cpu 1:
 pagevec_add include/linux/pagevec.h:64 [inline]
 mlock_new_page+0x238/0x500 mm/mlock.c:280
 folio_add_lru_vma+0x55/0x60 mm/swap.c:565
 lru_cache_add_inactive_or_unevictable+0x45/0xf0 mm/folio-compat.c:82
 do_anonymous_page+0x6cf/0x9c0 mm/memory.c:4114
 handle_pte_fault mm/memory.c:4929 [inline]
 __handle_mm_fault mm/memory.c:5073 [inline]
 handle_mm_fault+0x8dc/0xb20 mm/memory.c:5219
 faultin_page mm/gup.c:926 [inline]
 __get_user_pages+0x348/0xc20 mm/gup.c:1153
 populate_vma_page_range mm/gup.c:1526 [inline]
 __mm_populate+0x281/0x380 mm/gup.c:1640
 mm_populate include/linux/mm.h:2874 [inline]
 __do_sys_brk+0x30d/0x620 mm/mmap.c:275
 __se_sys_brk mm/mmap.c:170 [inline]
 __x64_sys_brk+0x1b/0x20 mm/mmap.c:170
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888237d28168 of 1 bytes by task 3132 on cpu 0:
 pagevec_count include/linux/pagevec.h:51 [inline]
 need_mlock_page_drain+0x2c/0x50 mm/mlock.c:236
 cpu_needs_drain mm/swap.c:835 [inline]
 __lru_add_drain_all+0x24e/0x3c0 mm/swap.c:923
 lru_add_drain_all+0xc/0x10 mm/swap.c:939
 invalidate_bdev+0x56/0x80 block/bdev.c:86
 ext4_put_super+0x510/0x810 fs/ext4/super.c:1273
 generic_shutdown_super+0xd5/0x240 fs/super.c:492
 kill_block_super+0x4a/0x90 fs/super.c:1386
 deactivate_locked_super+0x6a/0xb0 fs/super.c:332
 deactivate_super+0x85/0x90 fs/super.c:363
 cleanup_mnt+0x267/0x2d0 fs/namespace.c:1291
 __cleanup_mnt+0x15/0x20 fs/namespace.c:1298
 task_work_run+0xde/0x110 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0x124/0x130 kernel/entry/common.c:171
 exit_to_user_mode_prepare kernel/entry/common.c:203 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
 syscall_exit_to_user_mode+0x6a/0x90 kernel/entry/common.c:296
 do_syscall_64+0x37/0x70 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x0e -> 0x04

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 3132 Comm: syz-executor.3 Not tainted 6.2.0-rc4-syzkaller-00077-gd368967cb103-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/20 13:42 upstream d368967cb103 dd15ff29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mlock_new_page / need_mlock_page_drain
* Struck through repros no longer work on HEAD.