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

1 view
Skip to first unread message

syzbot

unread,
May 2, 2026, 10:22:32 PM (8 hours ago) May 2
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 66edb901bf87 Merge tag 'v7.1-p3' of git://git.kernel.org/p..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10e6396a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2e40c0f41e01837e
dashboard link: https://syzkaller.appspot.com/bug?extid=5ff4a12779d5bcd990f7
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
CC: [ak...@linux-foundation.org axelra...@google.com bao...@kernel.org b...@redhat.com chr...@kernel.org kas...@tencent.com linux-...@vger.kernel.org linu...@kvack.org nph...@gmail.com qi.z...@linux.dev shakee...@linux.dev shik...@huaweicloud.com wei...@google.com youngj...@lge.com yua...@google.com]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/da085ba13d7b/disk-66edb901.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8301c287d6d4/vmlinux-66edb901.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f461fbc65583/bzImage-66edb901.xz

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

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

write to 0xffff888237d27248 of 1 bytes by task 25650 on cpu 1:
folio_batch_reinit include/linux/folio_batch.h:50 [inline]
folios_put_refs+0x28f/0x2d0 mm/swap.c:1002
folios_put include/linux/mm.h:2149 [inline]
mlock_folio_batch+0x1bae/0x1be0 mm/mlock.c:209
mlock_folio+0x1d1/0x240 mm/mlock.c:259
mlock_vma_folio mm/internal.h:1199 [inline]
__folio_add_anon_rmap mm/rmap.c:1576 [inline]
folio_add_anon_rmap_ptes+0x24e/0x250 mm/rmap.c:1599
remove_migration_pte+0x7d9/0xbf0 mm/migrate.c:432
rmap_walk_anon+0x280/0x430 mm/rmap.c:2999
rmap_walk+0x8b/0xd0 mm/rmap.c:3104
remove_migration_ptes mm/migrate.c:473 [inline]
migrate_folio_move mm/migrate.c:1411 [inline]
migrate_folios_move mm/migrate.c:1740 [inline]
migrate_pages_batch+0x14cc/0x2010 mm/migrate.c:1996
migrate_pages_sync mm/migrate.c:2026 [inline]
migrate_pages+0x102e/0x1860 mm/migrate.c:2135
do_mbind mm/mempolicy.c:1614 [inline]
kernel_mbind mm/mempolicy.c:1757 [inline]
__do_sys_mbind mm/mempolicy.c:1831 [inline]
__se_sys_mbind+0xc98/0xdd0 mm/mempolicy.c:1827
__x64_sys_mbind+0x78/0x90 mm/mempolicy.c:1827
x64_sys_call+0x2b72/0x3020 arch/x86/include/generated/asm/syscalls_64.h:238
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 25645 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: 0x01 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 25645 Comm: syz.9.5684 Tainted: G W syzkaller #0 PREEMPT(full)
Tainted: [W]=WARN
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