[moderation] [mm?] KCSAN: data-race in __filemap_remove_folio / migrate_pages_batch

0 views
Skip to first unread message

syzbot

unread,
Apr 21, 2024, 9:29:18 AM (13 days ago) Apr 21
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 977b1ef51866 Merge tag 'block-6.9-20240420' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14c99c27180000
kernel config: https://syzkaller.appspot.com/x/.config?x=eaea34ec4c9b6fb6
dashboard link: https://syzkaller.appspot.com/bug?extid=8087a55cacdf555a6f28
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [ak...@linux-foundation.org hu...@google.com 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/deeaf44a7761/disk-977b1ef5.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/befb9e8ca501/vmlinux-977b1ef5.xz
kernel image: https://storage.googleapis.com/syzbot-assets/558e81cc1437/bzImage-977b1ef5.xz

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

==================================================================
BUG: KCSAN: data-race in __filemap_remove_folio / migrate_pages_batch

write to 0xffffea0004722b18 of 8 bytes by task 3481 on cpu 0:
page_cache_delete mm/filemap.c:152 [inline]
__filemap_remove_folio+0x1ac/0x2c0 mm/filemap.c:232
filemap_remove_folio+0x6c/0x1f0 mm/filemap.c:264
truncate_inode_folio+0x42/0x50 mm/truncate.c:195
shmem_undo_range+0x25e/0xa50 mm/shmem.c:1001
shmem_truncate_range mm/shmem.c:1114 [inline]
shmem_evict_inode+0x14d/0x530 mm/shmem.c:1242
evict+0x1ae/0x420 fs/inode.c:667
iput_final fs/inode.c:1741 [inline]
iput+0x432/0x5c0 fs/inode.c:1767
dentry_unlink_inode+0x230/0x240 fs/dcache.c:400
__dentry_kill+0x188/0x4b0 fs/dcache.c:603
dput+0x5c/0xd0 fs/dcache.c:845
__fput+0x44c/0x660 fs/file_table.c:430
____fput+0x15/0x20 fs/file_table.c:450
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

read to 0xffffea0004722b18 of 8 bytes by task 3476 on cpu 1:
__folio_test_movable include/linux/page-flags.h:688 [inline]
migrate_folio_unmap mm/migrate.c:1119 [inline]
migrate_pages_batch+0x200/0x18a0 mm/migrate.c:1678
migrate_pages_sync mm/migrate.c:1844 [inline]
migrate_pages+0xd41/0x17f0 mm/migrate.c:1953
do_mbind mm/mempolicy.c:1390 [inline]
kernel_mbind mm/mempolicy.c:1532 [inline]
__do_sys_mbind mm/mempolicy.c:1606 [inline]
__se_sys_mbind+0xeb6/0x1030 mm/mempolicy.c:1602
__x64_sys_mbind+0x78/0x90 mm/mempolicy.c:1602
x64_sys_call+0x1cee/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:238
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

value changed: 0xffff888116fdc4e8 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3476 Comm: syz-executor.4 Not tainted 6.9.0-rc4-syzkaller-00266-g977b1ef51866 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
==================================================================


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