[moderation] [mm?] [cgroups?] KCSAN: data-race in __mod_memcg_lruvec_state / mem_cgroup_css_rstat_flush

2 views
Skip to first unread message

syzbot

unread,
Feb 11, 2024, 6:36:24 AMFeb 11
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7521f258ea30 Merge tag 'mm-hotfixes-stable-2024-02-10-11-1..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15fb56ec180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3cd0dc1b46a5bc5c
dashboard link: https://syzkaller.appspot.com/bug?extid=19fc22693ef14439725b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [ak...@linux-foundation.org cgr...@vger.kernel.org han...@cmpxchg.org linux-...@vger.kernel.org linu...@kvack.org mho...@kernel.org muchu...@linux.dev roman.g...@linux.dev shak...@google.com]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/13bab0f1fd7a/disk-7521f258.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b8ba502ce3fb/vmlinux-7521f258.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1a60cc363ef5/bzImage-7521f258.xz

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

==================================================================
BUG: KCSAN: data-race in __mod_memcg_lruvec_state / mem_cgroup_css_rstat_flush

write to 0xffff888237d32a00 of 4 bytes by task 11 on cpu 0:
mem_cgroup_css_rstat_flush+0x4ea/0x540 mm/memcontrol.c:5845
cgroup_rstat_flush_locked+0x86b/0x9a0 kernel/cgroup/rstat.c:245
cgroup_rstat_flush+0x26/0x40 kernel/cgroup/rstat.c:277
do_flush_stats mm/memcontrol.c:744 [inline]
flush_memcg_stats_dwork+0x50/0x80 mm/memcontrol.c:781
process_one_work kernel/workqueue.c:2633 [inline]
process_scheduled_works+0x5b8/0xa40 kernel/workqueue.c:2706
worker_thread+0x525/0x730 kernel/workqueue.c:2787
kthread+0x1d7/0x210 kernel/kthread.c:388
ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242

read-write to 0xffff888237d32a00 of 4 bytes by task 15536 on cpu 1:
memcg_rstat_updated mm/memcontrol.c:724 [inline]
__mod_memcg_lruvec_state+0x13a/0x1a0 mm/memcontrol.c:874
__mod_lruvec_state+0x3c/0x50 mm/memcontrol.c:896
__update_lru_size include/linux/mm_inline.h:47 [inline]
update_lru_size include/linux/mm_inline.h:56 [inline]
lruvec_add_folio include/linux/mm_inline.h:326 [inline]
lru_add_fn+0x289/0x430 mm/swap.c:199
folio_batch_move_lru+0x21e/0x2f0 mm/swap.c:217
folio_batch_add_and_move mm/swap.c:234 [inline]
folio_add_lru+0xc4/0x120 mm/swap.c:517
filemap_add_folio+0x103/0x160 mm/filemap.c:953
__filemap_get_folio+0x2f1/0x5a0 mm/filemap.c:1927
ext4_da_write_begin+0x2eb/0x550 fs/ext4/inode.c:2885
generic_perform_write+0x1c9/0x410 mm/filemap.c:3930
ext4_buffered_write_iter+0x1f6/0x370 fs/ext4/file.c:299
ext4_file_write_iter+0x297/0xe10
call_write_iter include/linux/fs.h:2085 [inline]
new_sync_write fs/read_write.c:497 [inline]
vfs_write+0x760/0x8d0 fs/read_write.c:590
ksys_write+0xeb/0x1a0 fs/read_write.c:643
__do_sys_write fs/read_write.c:655 [inline]
__se_sys_write fs/read_write.c:652 [inline]
__x64_sys_write+0x42/0x50 fs/read_write.c:652
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+0x63/0x6b

value changed: 0x0000000d -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 15536 Comm: syz-executor.4 Not tainted 6.8.0-rc3-syzkaller-00317-g7521f258ea30 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/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