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

0 views
Skip to first unread message

syzbot

unread,
7:42 AM (3 hours ago) 7:42 AM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e75a43c7cec4 Merge tag 'trace-v7.1-rc1' of git://git.kerne..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=159519ba580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2e40c0f41e01837e
dashboard link: https://syzkaller.appspot.com/bug?extid=2f4ec809c0aa94d7d565
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
CC: [Liam.H...@oracle.com ak...@linux-foundation.org ja...@google.com linux-...@vger.kernel.org linu...@kvack.org l...@kernel.org pfal...@suse.de vba...@kernel.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/df0996649a15/disk-e75a43c7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e05a46b995bf/vmlinux-e75a43c7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2811c2791b29/bzImage-e75a43c7.xz

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

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

read-write to 0xffff888237d27248 of 1 bytes by task 7763 on cpu 1:
folio_batch_add include/linux/folio_batch.h:77 [inline]
mlock_folio+0x14d/0x240 mm/mlock.c:257
mlock_pte_range+0x28d/0x590 mm/mlock.c:397
walk_pmd_range mm/pagewalk.c:148 [inline]
walk_pud_range mm/pagewalk.c:239 [inline]
walk_p4d_range mm/pagewalk.c:280 [inline]
walk_pgd_range+0xa76/0x1520 mm/pagewalk.c:321
__walk_page_range+0xdd/0x340 mm/pagewalk.c:429
walk_page_range_mm_unsafe+0x3e4/0x530 mm/pagewalk.c:525
walk_page_range+0x56/0x70 mm/pagewalk.c:604
mlock_vma_pages_range mm/mlock.c:449 [inline]
mlock_fixup+0x387/0x420 mm/mlock.c:513
apply_mlockall_flags+0x202/0x280 mm/mlock.c:740
__do_sys_mlockall mm/mlock.c:772 [inline]
__se_sys_mlockall+0x241/0x3c0 mm/mlock.c:751
__x64_sys_mlockall+0x1f/0x30 mm/mlock.c:751
x64_sys_call+0xf90/0x3020 arch/x86/include/generated/asm/syscalls_64.h:152
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x12c/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237d27248 of 1 bytes by task 6189 on cpu 0:
folio_batch_count include/linux/folio_batch.h:56 [inline]
need_mlock_drain+0x30/0x50 mm/mlock.c:235
cpu_needs_drain mm/swap.c:792 [inline]
__lru_add_drain_all+0x273/0x450 mm/swap.c:883
lru_add_drain_all+0x10/0x20 mm/swap.c:899
invalidate_bdev+0x47/0x70 block/bdev.c:101
ext4_put_super+0x610/0x7b0 fs/ext4/super.c:1355
generic_shutdown_super+0xee/0x220 fs/super.c:646
kill_block_super+0x2a/0x70 fs/super.c:1725
ext4_kill_sb+0x42/0x80 fs/ext4/super.c:7492
deactivate_locked_super+0x75/0x1c0 fs/super.c:476
deactivate_super+0x97/0xa0 fs/super.c:509
cleanup_mnt+0x2bb/0x330 fs/namespace.c:1312
__cleanup_mnt+0x19/0x20 fs/namespace.c:1319
task_work_run+0x130/0x1a0 kernel/task_work.c:233
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
__exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
exit_to_user_mode_loop+0x1f4/0x6f0 kernel/entry/common.c:98
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:238 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
do_syscall_64+0x232/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x0a -> 0x1f

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 6189 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
==================================================================


---
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