syzbot


KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64

Status: moderation: reported on 2023/12/09 00:03
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+fb9027810f21adb900b7@syzkaller.appspotmail.com
First crash: 434d, last: 10h30m

Sample crash report:
==================================================================
BUG: KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64

read-write to 0xffffffff860079c0 of 8 bytes by interrupt on cpu 1:
 tick_do_update_jiffies64+0x112/0x1b0 kernel/time/tick-sched.c:118
 tick_sched_do_timer kernel/time/tick-sched.c:232 [inline]
 tick_nohz_handler+0x7c/0x2d0 kernel/time/tick-sched.c:290
 __run_hrtimer kernel/time/hrtimer.c:1689 [inline]
 __hrtimer_run_queues+0x20d/0x5e0 kernel/time/hrtimer.c:1753
 hrtimer_interrupt+0x210/0x7b0 kernel/time/hrtimer.c:1815
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline]
 __sysvec_apic_timer_interrupt+0x5c/0x1a0 arch/x86/kernel/apic/apic.c:1049
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0x6e/0x80 arch/x86/kernel/apic/apic.c:1043
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
 mem_cgroup_flush_stats_ratelimited+0x1d/0x100 mm/memcontrol.c:906
 count_shadow_nodes+0x6b/0x230 mm/workingset.c:693
 do_shrink_slab+0x5a/0x690 mm/shrinker.c:382
 shrink_slab_memcg mm/shrinker.c:548 [inline]
 shrink_slab+0x4ed/0x860 mm/shrinker.c:626
 shrink_node_memcgs mm/vmscan.c:5891 [inline]
 shrink_node+0x59a/0x1da0 mm/vmscan.c:5924
 shrink_zones mm/vmscan.c:6168 [inline]
 do_try_to_free_pages+0x3cf/0xc20 mm/vmscan.c:6230
 try_to_free_mem_cgroup_pages+0x1ea/0x4e0 mm/vmscan.c:6545
 try_charge_memcg+0x27a/0xcd0 mm/memcontrol.c:2944
 try_charge mm/memcontrol.c:3092 [inline]
 charge_memcg mm/memcontrol.c:7495 [inline]
 mem_cgroup_swapin_charge_folio+0x107/0x1a0 mm/memcontrol.c:7580
 __read_swap_cache_async+0x2b9/0x520 mm/swap_state.c:514
 swap_cluster_readahead+0x276/0x3f0 mm/swap_state.c:678
 swapin_readahead+0xe2/0x7a0 mm/swap_state.c:904
 do_swap_page+0x3bc/0x1840 mm/memory.c:4065
 handle_pte_fault mm/memory.c:5384 [inline]
 __handle_mm_fault mm/memory.c:5524 [inline]
 handle_mm_fault+0x8b9/0x2ac0 mm/memory.c:5689
 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x296/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
 rep_stos_alternative+0x40/0x80 arch/x86/lib/clear_page_64.S:92
 __clear_user arch/x86/include/asm/uaccess_64.h:172 [inline]
 copy_fpstate_to_sigframe+0x2b8/0x720 arch/x86/kernel/fpu/signal.c:236
 get_sigframe+0x295/0x350 arch/x86/kernel/signal.c:142
 x64_setup_rt_frame+0xa7/0x570 arch/x86/kernel/signal_64.c:175
 setup_rt_frame arch/x86/kernel/signal.c:223 [inline]
 handle_signal arch/x86/kernel/signal.c:267 [inline]
 arch_do_signal_or_restart+0x287/0x4b0 arch/x86/kernel/signal.c:312
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 irqentry_exit_to_user_mode+0x94/0x130 kernel/entry/common.c:231
 irqentry_exit+0x12/0x50 kernel/entry/common.c:334
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffffffff860079c0 of 8 bytes by task 14777 on cpu 0:
 mem_cgroup_flush_stats_ratelimited+0x29/0x100 mm/memcontrol.c:906
 count_shadow_nodes+0x6b/0x230 mm/workingset.c:693
 do_shrink_slab+0x5a/0x690 mm/shrinker.c:382
 shrink_slab_memcg mm/shrinker.c:548 [inline]
 shrink_slab+0x4ed/0x860 mm/shrinker.c:626
 shrink_node_memcgs mm/vmscan.c:5891 [inline]
 shrink_node+0x59a/0x1da0 mm/vmscan.c:5924
 shrink_zones mm/vmscan.c:6168 [inline]
 do_try_to_free_pages+0x3cf/0xc20 mm/vmscan.c:6230
 try_to_free_mem_cgroup_pages+0x1ea/0x4e0 mm/vmscan.c:6545
 try_charge_memcg+0x27a/0xcd0 mm/memcontrol.c:2944
 obj_cgroup_charge_pages+0xbd/0x1d0 mm/memcontrol.c:3416
 __memcg_kmem_charge_page+0x9d/0x170 mm/memcontrol.c:3442
 __alloc_pages_noprof+0x1bc/0x360 mm/page_alloc.c:4700
 alloc_pages_mpol_noprof+0xb1/0x1e0 mm/mempolicy.c:2265
 alloc_pages_noprof+0xe1/0x100 mm/mempolicy.c:2336
 vm_area_alloc_pages mm/vmalloc.c:3583 [inline]
 __vmalloc_area_node mm/vmalloc.c:3659 [inline]
 __vmalloc_node_range_noprof+0x719/0xef0 mm/vmalloc.c:3840
 kvmalloc_node_noprof+0x121/0x170 mm/util.c:659
 ip_set_alloc+0x1f/0x30 net/netfilter/ipset/ip_set_core.c:256
 hash_netiface_create+0x273/0x730 net/netfilter/ipset/ip_set_hash_gen.h:1568
 ip_set_create+0x359/0x8a0 net/netfilter/ipset/ip_set_core.c:1104
 nfnetlink_rcv_msg+0x4a9/0x570 net/netfilter/nfnetlink.c:302
 netlink_rcv_skb+0x12c/0x230 net/netlink/af_netlink.c:2564
 nfnetlink_rcv+0x16c/0x15b0 net/netfilter/nfnetlink.c:664
 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
 netlink_unicast+0x58d/0x660 net/netlink/af_netlink.c:1361
 netlink_sendmsg+0x5ca/0x6e0 net/netlink/af_netlink.c:1905
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0x140/0x180 net/socket.c:745
 ____sys_sendmsg+0x312/0x410 net/socket.c:2585
 ___sys_sendmsg net/socket.c:2639 [inline]
 __sys_sendmsg+0x1e9/0x280 net/socket.c:2668
 __do_sys_sendmsg net/socket.c:2677 [inline]
 __se_sys_sendmsg net/socket.c:2675 [inline]
 __x64_sys_sendmsg+0x46/0x50 net/socket.c:2675
 x64_sys_call+0xb25/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:47
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000000ffffd61b -> 0x00000000ffffd61c

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 14777 Comm: syz.1.3492 Not tainted 6.10.0-syzkaller-00017-g5e0497553643 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
==================================================================

Crashes (329):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/16 04:40 upstream 5e0497553643 e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/15 01:48 upstream 0c3836482481 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/14 11:41 upstream 4d145e3f830b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/13 23:48 upstream d0d0cd380055 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/12 15:24 upstream 43db1e03c086 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/12 08:39 upstream 8a18fda0febb eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/11 17:35 upstream 9d9a2f29aefd c699c2eb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/10 03:36 upstream 34afb82a3c67 bc144f9a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/09 21:49 upstream 34afb82a3c67 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/09 15:21 upstream 4376e966ecb7 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/09 06:51 upstream 4376e966ecb7 bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/08 08:11 upstream 256abd8e550c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/07 16:02 upstream c6653f49e4fd 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/07 03:52 upstream 22f902dfc51e 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/06 19:24 upstream 1dd28064d416 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/05 23:07 upstream d270dd21bee0 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/04 22:38 upstream 661e504db04c 3f2748a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/04 10:40 upstream 795c58e4c7fc 3f2748a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/03 21:53 upstream 8a9c6c40432e f76a75f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/03 06:31 upstream e9d22f7a6655 1ecfa2d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/02 12:29 upstream 1dfe225e9af5 07f0a0a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/02 09:00 upstream 1dfe225e9af5 b294e901 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/01 18:25 upstream 9903efbddba0 b294e901 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/01 14:56 upstream 22a40d14b572 b294e901 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/07/01 01:22 upstream 22a40d14b572 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/29 22:33 upstream 27b31deb900d 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/29 08:55 upstream de0a9f448633 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/28 18:22 upstream 6c0483dbfe72 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/28 03:56 upstream 66e55ff12e73 6ef39602 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/28 03:55 upstream 66e55ff12e73 6ef39602 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/27 11:51 upstream afcd48134c58 6ef39602 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/27 04:20 upstream afcd48134c58 c6d33a01 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/26 12:28 upstream 55027e689933 c6d33a01 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/25 09:57 upstream 55027e689933 04bd2a30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/24 19:46 upstream 626737a5791b 215eef4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/24 09:02 upstream f2661062f16b edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/23 20:04 upstream 7c16f0a4ed1c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/23 02:42 upstream 563a50672d8a edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/22 09:35 upstream 35bb670d65fc edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/21 21:40 upstream 66cc544fd75c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/20 23:53 upstream 50736169ecc8 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/20 14:52 upstream e5b3efbe1ab1 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/19 22:32 upstream e5b3efbe1ab1 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/19 12:14 upstream 92e5605a199e 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/18 18:14 upstream 3d54351c64e8 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/18 14:16 upstream 14d7c92f8df9 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/18 07:13 upstream 14d7c92f8df9 ce6011bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/17 23:23 upstream 6226e74900d7 1f11cfd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/16 20:39 upstream b5beaa44747b f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2024/06/16 18:23 upstream a3e18a540541 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
2023/11/28 23:27 upstream 18d46e76d7c2 1adfb6f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_flush_stats_ratelimited / tick_do_update_jiffies64
* Struck through repros no longer work on HEAD.