[moderation] [mm?] KCSAN: data-race in mlock_folio / need_mlock_drain (4)

0 views
Skip to first unread message

syzbot

unread,
Apr 23, 2024, 5:55:24 AM (10 days ago) Apr 23
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 71b1543c83d6 Merge tag '6.9-rc5-ksmbd-fixes' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1278699f180000
kernel config: https://syzkaller.appspot.com/x/.config?x=4128b708dfac799b
dashboard link: https://syzkaller.appspot.com/bug?extid=336025f268285ce8f9f8
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [ak...@linux-foundation.org linux-...@vger.kernel.org linu...@kvack.org]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8b58054f3198/disk-71b1543c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/50c92527b69a/vmlinux-71b1543c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f9cb9354fd63/bzImage-71b1543c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+336025...@syzkaller.appspotmail.com

EXT4-fs (loop4): unmounting filesystem 00000000-0000-0000-0000-000000000000.
==================================================================
BUG: KCSAN: data-race in mlock_folio / need_mlock_drain

read-write to 0xffff888237d2b410 of 1 bytes by task 11300 on cpu 1:
folio_batch_add include/linux/pagevec.h:77 [inline]
mlock_folio+0x136/0x210 mm/mlock.c:257
mlock_vma_folio mm/internal.h:765 [inline]
__folio_add_file_rmap mm/rmap.c:1461 [inline]
folio_add_file_rmap_ptes+0x175/0x180 mm/rmap.c:1478
set_pte_range+0x2ae/0x670 mm/memory.c:4682
finish_fault+0x3fc/0x510 mm/memory.c:4757
do_read_fault mm/memory.c:4898 [inline]
do_fault mm/memory.c:5024 [inline]
do_pte_missing mm/memory.c:3880 [inline]
handle_pte_fault mm/memory.c:5300 [inline]
__handle_mm_fault mm/memory.c:5441 [inline]
handle_mm_fault+0xdeb/0x27e0 mm/memory.c:5606
faultin_page mm/gup.c:958 [inline]
__get_user_pages+0x470/0xec0 mm/gup.c:1257
populate_vma_page_range mm/gup.c:1697 [inline]
__mm_populate+0x204/0x340 mm/gup.c:1800
mm_populate include/linux/mm.h:3411 [inline]
__do_sys_mlockall mm/mlock.c:777 [inline]
__se_sys_mlockall+0x28e/0x320 mm/mlock.c:753
__x64_sys_mlockall+0x1f/0x30 mm/mlock.c:753
x64_sys_call+0x2a41/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:152
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237d2b410 of 1 bytes by task 10929 on cpu 0:
folio_batch_count include/linux/pagevec.h:56 [inline]
need_mlock_drain+0x30/0x50 mm/mlock.c:235
cpu_needs_drain mm/swap.c:816 [inline]
__lru_add_drain_all+0x240/0x420 mm/swap.c:904
lru_add_drain_all+0x10/0x20 mm/swap.c:920
invalidate_bdev+0x54/0x80 block/bdev.c:95
ext4_put_super+0x51b/0x7e0 fs/ext4/super.c:1361
generic_shutdown_super+0xde/0x210 fs/super.c:641
kill_block_super+0x2a/0x70 fs/super.c:1675
ext4_kill_sb+0x44/0x80 fs/ext4/super.c:7327
deactivate_locked_super+0x7d/0x1c0 fs/super.c:472
deactivate_super+0x9f/0xb0 fs/super.c:505
cleanup_mnt+0x272/0x2e0 fs/namespace.c:1267
__cleanup_mnt+0x19/0x20 fs/namespace.c:1274
task_work_run+0x13a/0x1a0 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
__syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
syscall_exit_to_user_mode+0xbe/0x130 kernel/entry/common.c:218
do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x19 -> 0x1a

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 10929 Comm: syz-executor.4 Not tainted 6.9.0-rc5-syzkaller-00031-g71b1543c83d6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
==================================================================
EXT4-fs (loop4): unmounting filesystem 00000000-0000-0000-0000-000000000000.


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages