[moderation] [kernel?] KCSAN: data-race in mem_cgroup_flush_stats / tick_do_update_jiffies64 (2)

8 views
Skip to first unread message

syzbot

unread,
Dec 8, 2023, 7:02:21 PM12/8/23
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: bee0e7762ad2 Merge tag 'for-linus-iommufd' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12cc8212e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ac34c1f29a8029df
dashboard link: https://syzkaller.appspot.com/bug?extid=f41148929261021e711a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [fred...@kernel.org linux-...@vger.kernel.org mi...@kernel.org tg...@linutronix.de]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/233be5f65dd2/disk-bee0e776.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/94423738a289/vmlinux-bee0e776.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0b977463fa9a/bzImage-bee0e776.xz

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

==================================================================
BUG: KCSAN: data-race in mem_cgroup_flush_stats / tick_do_update_jiffies64

read-write to 0xffffffff85a079c0 of 8 bytes by interrupt on cpu 0:
tick_do_update_jiffies64+0x112/0x1b0 kernel/time/tick-sched.c:118
tick_sched_do_timer kernel/time/tick-sched.c:211 [inline]
tick_nohz_highres_handler+0x7b/0x2c0 kernel/time/tick-sched.c:1509
__run_hrtimer kernel/time/hrtimer.c:1688 [inline]
__hrtimer_run_queues+0x217/0x700 kernel/time/hrtimer.c:1752
hrtimer_interrupt+0x20d/0x7b0 kernel/time/hrtimer.c:1814
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline]
__sysvec_apic_timer_interrupt+0x52/0x190 arch/x86/kernel/apic/apic.c:1082
sysvec_apic_timer_interrupt+0x68/0x80 arch/x86/kernel/apic/apic.c:1076
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
rcu_preempt_read_enter kernel/rcu/tree_plugin.h:379 [inline]
__rcu_read_lock+0x2b/0x50 kernel/rcu/tree_plugin.h:402
rcu_read_lock include/linux/rcupdate.h:745 [inline]
mod_memcg_page_state include/linux/memcontrol.h:1004 [inline]
__vmalloc_area_node mm/vmalloc.c:3147 [inline]
__vmalloc_node_range+0x9c5/0xea0 mm/vmalloc.c:3320
kvmalloc_node+0x121/0x160 mm/util.c:642
kvmalloc include/linux/slab.h:738 [inline]
xt_alloc_table_info+0x3d/0x80 net/netfilter/x_tables.c:1192
do_replace net/ipv6/netfilter/ip6_tables.c:1139 [inline]
do_ip6t_set_ctl+0x633/0x17f0 net/ipv6/netfilter/ip6_tables.c:1636
nf_setsockopt+0x18d/0x1b0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x11c/0x130 net/ipv6/ipv6_sockglue.c:1005
udpv6_setsockopt+0x95/0xa0 net/ipv6/udp.c:1694
sock_common_setsockopt+0x61/0x70 net/core/sock.c:3711
do_sock_setsockopt net/socket.c:2311 [inline]
__sys_setsockopt+0x1d4/0x240 net/socket.c:2334
__do_sys_setsockopt net/socket.c:2343 [inline]
__se_sys_setsockopt net/socket.c:2340 [inline]
__x64_sys_setsockopt+0x66/0x80 net/socket.c:2340
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffffffff85a079c0 of 8 bytes by task 10833 on cpu 1:
do_flush_stats mm/memcontrol.c:656 [inline]
mem_cgroup_flush_stats+0x5d/0xd0 mm/memcontrol.c:667
prepare_scan_control mm/vmscan.c:2225 [inline]
shrink_node+0x304/0x15c0 mm/vmscan.c:5845
shrink_zones mm/vmscan.c:6086 [inline]
do_try_to_free_pages+0x43d/0xce0 mm/vmscan.c:6148
try_to_free_mem_cgroup_pages+0x1e2/0x480 mm/vmscan.c:6463
try_charge_memcg+0x280/0xd30 mm/memcontrol.c:2742
try_charge mm/memcontrol.c:2884 [inline]
charge_memcg mm/memcontrol.c:7210 [inline]
mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7295
__read_swap_cache_async+0x2f6/0x550 mm/swap_state.c:490
swap_cluster_readahead+0x452/0x4c0 mm/swap_state.c:674
swapin_readahead+0xe9/0x7f0 mm/swap_state.c:878
do_swap_page+0x4a0/0x1670 mm/memory.c:3883
handle_pte_fault mm/memory.c:5041 [inline]
__handle_mm_fault mm/memory.c:5179 [inline]
handle_mm_fault+0xa36/0x2dd0 mm/memory.c:5344
do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
handle_page_fault arch/x86/mm/fault.c:1505 [inline]
exc_page_fault+0x3ff/0x6c0 arch/x86/mm/fault.c:1561
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

value changed: 0x00000000fffff99d -> 0x00000000fffff99e

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 10833 Comm: syz-executor.3 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
==================================================================


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

syzbot

unread,
Feb 3, 2024, 8:54:19 AM2/3/24
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages