syzbot


KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter

Status: upstream: reported on 2024/08/30 08:05
Subsystems: cgroups mm
[Documentation on labels]
Reported-by: syzbot+e099d407346c45275ce9@syzkaller.appspotmail.com
Fix commit: ec0db74b4b1f mm: restart if multiple traversals raced
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu-native-arm64-kvm]
First crash: 46d, last: 24d
Discussions (3)
Title Replies (including bot) Last reply
[PATCH mm-unstable v4 4/5] mm: restart if multiple traversals raced 1 (1) 2024/09/05 00:30
Re: [PATCH mm-unstable v3 4/5] mm: restart if multiple traversals raced 1 (1) 2024/08/30 19:04
[syzbot] [cgroups?] [mm?] KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter 2 (3) 2024/08/30 18:57

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

read-write to 0xffff888108704668 of 4 bytes by task 4329 on cpu 0:
 mem_cgroup_iter+0x28e/0x380 mm/memcontrol.c:1080
 shrink_node_memcgs mm/vmscan.c:5904 [inline]
 shrink_node+0x74a/0x1d40 mm/vmscan.c:5928
 shrink_zones mm/vmscan.c:6172 [inline]
 do_try_to_free_pages+0x3c6/0xc50 mm/vmscan.c:6234
 try_to_free_mem_cgroup_pages+0x1f3/0x4f0 mm/vmscan.c:6566
 try_charge_memcg+0x2bc/0x810 mm/memcontrol.c:2210
 obj_cgroup_charge_pages+0xbd/0x1a0 mm/memcontrol.c:2660
 __memcg_kmem_charge_page+0x9d/0x170 mm/memcontrol.c:2687
 __alloc_pages_noprof+0x1bc/0x360 mm/page_alloc.c:4719
 alloc_pages_mpol_noprof+0xb1/0x1e0 mm/mempolicy.c:2263
 alloc_pages_noprof+0xe1/0x100 mm/mempolicy.c:2343
 vm_area_alloc_pages mm/vmalloc.c:3587 [inline]
 __vmalloc_area_node mm/vmalloc.c:3656 [inline]
 __vmalloc_node_range_noprof+0x736/0xec0 mm/vmalloc.c:3837
 __kvmalloc_node_noprof+0x121/0x170 mm/util.c:675
 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:2550
 nfnetlink_rcv+0x16c/0x15c0 net/netfilter/nfnetlink.c:667
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x599/0x670 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x5cc/0x6e0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0x140/0x180 net/socket.c:745
 ____sys_sendmsg+0x312/0x410 net/socket.c:2603
 ___sys_sendmsg net/socket.c:2657 [inline]
 __sys_sendmsg+0x1dd/0x270 net/socket.c:2686
 __do_sys_sendmsg net/socket.c:2695 [inline]
 __se_sys_sendmsg net/socket.c:2693 [inline]
 __x64_sys_sendmsg+0x46/0x50 net/socket.c:2693
 x64_sys_call+0x2689/0x2d60 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

read to 0xffff888108704668 of 4 bytes by task 4316 on cpu 1:
 mem_cgroup_iter+0xba/0x380 mm/memcontrol.c:1018
 shrink_node_memcgs mm/vmscan.c:5849 [inline]
 shrink_node+0x458/0x1d40 mm/vmscan.c:5928
 shrink_zones mm/vmscan.c:6172 [inline]
 do_try_to_free_pages+0x3c6/0xc50 mm/vmscan.c:6234
 try_to_free_mem_cgroup_pages+0x1f3/0x4f0 mm/vmscan.c:6566
 try_charge_memcg+0x2bc/0x810 mm/memcontrol.c:2210
 try_charge mm/memcontrol-v1.h:20 [inline]
 charge_memcg mm/memcontrol.c:4438 [inline]
 __mem_cgroup_charge+0x63/0x100 mm/memcontrol.c:4453
 mem_cgroup_charge include/linux/memcontrol.h:672 [inline]
 filemap_add_folio+0x53/0x1b0 mm/filemap.c:967
 page_cache_ra_unbounded+0x175/0x310 mm/readahead.c:268
 do_page_cache_ra mm/readahead.c:320 [inline]
 page_cache_ra_order mm/readahead.c:520 [inline]
 page_cache_async_ra+0x40c/0x420 mm/readahead.c:670
 do_async_mmap_readahead mm/filemap.c:3214 [inline]
 filemap_fault+0x2ca/0xa60 mm/filemap.c:3311
 __do_fault+0xb6/0x200 mm/memory.c:4670
 do_read_fault mm/memory.c:5076 [inline]
 do_fault mm/memory.c:5206 [inline]
 do_pte_missing mm/memory.c:3962 [inline]
 handle_pte_fault mm/memory.c:5536 [inline]
 __handle_mm_fault mm/memory.c:5679 [inline]
 handle_mm_fault+0xe7f/0x2a40 mm/memory.c:5847
 faultin_page mm/gup.c:1207 [inline]
 __get_user_pages+0x499/0x10d0 mm/gup.c:1506
 populate_vma_page_range mm/gup.c:1945 [inline]
 __mm_populate+0x25b/0x3b0 mm/gup.c:2048
 mm_populate include/linux/mm.h:3437 [inline]
 __do_sys_mlockall mm/mlock.c:766 [inline]
 __se_sys_mlockall+0x2c5/0x370 mm/mlock.c:742
 __x64_sys_mlockall+0x1f/0x30 mm/mlock.c:742
 x64_sys_call+0x1e3a/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:152
 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: 0x000001c6 -> 0x000001c8

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 4316 Comm: syz.3.411 Not tainted 6.11.0-syzkaller-07462-g1868f9d0260e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
==================================================================

Crashes (59):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/21 03:22 upstream 1868f9d0260e 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/20 10:21 upstream baeb9a7d8b60 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/19 20:38 upstream 2004cef11ea0 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/19 13:15 upstream 839c4f596f89 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/18 23:19 upstream 4a39ac5b7d62 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/18 09:36 upstream bdf56c7580d2 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/17 18:02 upstream 2f27fce67173 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/17 04:46 upstream a430d95c5efa c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/16 14:46 upstream adfc3ded5c33 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/16 00:37 upstream 98f7e32f20d2 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/15 11:52 upstream d42f7708e27c 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/14 21:48 upstream 0babf683783d 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/14 09:14 upstream b7718454f937 c7e35043 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/14 07:45 upstream b7718454f937 b58f933c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/13 18:33 upstream 196145c606d0 b58f933c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/13 03:02 upstream fdf042df0463 73e8a465 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/13 00:07 upstream fdf042df0463 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/12 10:20 upstream 77f587896757 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/12 09:07 upstream 77f587896757 d94c83d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/11 20:21 upstream 7c6a3a65ace7 d94c83d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/11 04:09 upstream 8d8d276ba2fb 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/10 17:06 upstream 8d8d276ba2fb 86aa7bd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/10 16:30 upstream bc83b4d1f086 86aa7bd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/10 04:38 upstream bc83b4d1f086 784df80e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/10 04:37 upstream bc83b4d1f086 784df80e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/10 04:36 upstream bc83b4d1f086 784df80e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/09 14:17 upstream da3ea35007d0 073f8be2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/09 08:00 upstream da3ea35007d0 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/08 19:11 upstream 5dadc1be8fc5 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/08 19:11 upstream 5dadc1be8fc5 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/07 21:00 upstream d1f2d51b711a 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/07 20:56 upstream d1f2d51b711a 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/07 07:02 upstream b31c44928842 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/07 07:02 upstream b31c44928842 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/07 07:02 upstream b31c44928842 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/06 16:14 upstream b831f83e40a2 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/06 12:48 upstream b831f83e40a2 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/05 22:37 upstream ad618736883b 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/05 22:37 upstream ad618736883b 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/05 11:21 upstream c763c4339688 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/04 20:02 upstream c7fb1692dc01 dfbe2ed4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/04 20:01 upstream c7fb1692dc01 dfbe2ed4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/04 07:28 upstream 88fac17500f4 9d47f20a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/03 21:33 upstream 88fac17500f4 326f9c5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/03 10:16 upstream 67784a74e258 326f9c5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/02 20:58 upstream 67784a74e258 8045124c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/02 14:38 upstream 67784a74e258 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/02 14:37 upstream 67784a74e258 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/02 00:32 upstream c9f016e72b5c 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/09/01 12:35 upstream 431c1646e1f8 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/08/31 23:30 upstream e8784b0aef62 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/08/31 09:27 upstream 1934261d8974 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/08/30 21:04 upstream 20371ba12063 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/08/30 05:51 upstream 20371ba12063 ee2602b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/08/30 03:34 upstream 20371ba12063 9bd464fc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
2024/08/29 18:47 upstream d5d547aa7b51 9bd464fc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in mem_cgroup_iter / mem_cgroup_iter
* Struck through repros no longer work on HEAD.