syzbot


KCSAN: data-race in mlock_new_page / need_mlock_page_drain

Status: auto-closed as invalid on 2022/07/12 22:07
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 247d, last: 183d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in mlock_new_page / need_mlock_page_drain (2) 1 76d 76d 0/24 auto-obsoleted due to no activity on 2022/10/27 10:16

Sample crash report:
BUG: KCSAN: data-race in mlock_new_page / need_mlock_page_drain

read-write to 0xffff888237d27ec0 of 1 bytes by task 12302 on cpu 1:
 pagevec_add include/linux/pagevec.h:75 [inline]
 mlock_new_page+0x238/0x500 mm/mlock.c:280
 lru_cache_add_inactive_or_unevictable+0x55/0x60 mm/swap.c:486
 do_anonymous_page+0x706/0xa20 mm/memory.c:4116
 handle_pte_fault mm/memory.c:4901 [inline]
 __handle_mm_fault mm/memory.c:5042 [inline]
 handle_mm_fault+0x8a0/0xa90 mm/memory.c:5140
 faultin_page mm/gup.c:953 [inline]
 __get_user_pages+0x34a/0xbf0 mm/gup.c:1174
 populate_vma_page_range mm/gup.c:1518 [inline]
 __mm_populate+0x26e/0x3a0 mm/gup.c:1631
 do_mlock+0x37f/0x430 mm/mlock.c:609
 __do_sys_mlock mm/mlock.c:617 [inline]
 __se_sys_mlock mm/mlock.c:615 [inline]
 __x64_sys_mlock+0x32/0x40 mm/mlock.c:615
 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+0x46/0xb0

read to 0xffff888237d27ec0 of 1 bytes by task 12291 on cpu 0:
 pagevec_count include/linux/pagevec.h:62 [inline]
 need_mlock_page_drain+0x2c/0x50 mm/mlock.c:236
 __lru_add_drain_all+0x24c/0x3e0 mm/swap.c:832
 lru_add_drain_all+0xc/0x10 mm/swap.c:849
 invalidate_bdev+0x56/0x80 block/bdev.c:87
 invalidate_disk+0x25/0xb0 block/genhd.c:678
 __loop_clr_fd+0x176/0x3c0 drivers/block/loop.c:1159
 loop_clr_fd drivers/block/loop.c:1252 [inline]
 lo_ioctl+0xd8c/0x1290 drivers/block/loop.c:1558
 blkdev_ioctl+0x20e/0x440 block/ioctl.c:614
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:856
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:856
 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+0x46/0xb0

value changed: 0x0e -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 12291 Comm: syz-executor.2 Not tainted 5.19.0-rc1-syzkaller-00003-ge71e60cd74df-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (7):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/06/07 22:05 upstream e71e60cd74df b2706118 .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
ci2-upstream-kcsan-gce 2022/06/04 13:48 upstream 032dcf09e2bf c8857892 .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
ci2-upstream-kcsan-gce 2022/05/29 11:53 upstream 664a393a2663 a46af346 .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
ci2-upstream-kcsan-gce 2022/05/20 16:26 upstream 3d7285a335ed bd37ad7e .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
ci2-upstream-kcsan-gce 2022/04/30 16:13 upstream 8013d1d3d2e3 2df221f6 .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
ci2-upstream-kcsan-gce 2022/04/21 15:50 upstream b253435746d9 2738b391 .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
ci2-upstream-kcsan-gce 2022/04/04 04:38 upstream 09bb8856d4a7 79a2a8fc .config log report info KCSAN: data-race in mlock_new_page / need_mlock_page_drain
* Struck through repros no longer work on HEAD.