syzbot


KCSAN: data-race in drain_all_stock / drain_stock (7)

Status: auto-obsoleted due to no activity on 2023/05/23 02:38
Subsystems: cgroups mm
[Documentation on labels]
First crash: 647d, last: 565d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in drain_all_stock / drain_stock (5) cgroups mm 1 811d 811d 0/28 auto-closed as invalid on 2022/09/19 00:38
upstream KCSAN: data-race in drain_all_stock / drain_stock (3) cgroups mm 1 950d 950d 0/28 auto-closed as invalid on 2022/05/03 08:41
upstream KCSAN: data-race in drain_all_stock / drain_stock (6) cgroups mm 4 704d 762d 0/28 auto-obsoleted due to no activity on 2023/01/16 19:50
upstream KCSAN: data-race in drain_all_stock / drain_stock (8) cgroups mm 12 342d 329d 0/28 auto-obsoleted due to no activity on 2024/01/01 19:14
upstream KCSAN: data-race in drain_all_stock / drain_stock (2) cgroups mm 3 1106d 1111d 0/28 auto-closed as invalid on 2021/11/28 07:11
upstream KCSAN: data-race in drain_all_stock / drain_stock cgroups mm 1 1573d 1573d 0/28 auto-closed as invalid on 2020/08/18 19:14
upstream KCSAN: data-race in drain_all_stock / drain_stock (4) cgroups mm 2 859d 889d 0/28 auto-closed as invalid on 2022/08/02 11:05
upstream KCSAN: data-race in drain_all_stock / drain_stock (9) mm cgroups 5 219d 289d 0/28 auto-obsoleted due to no activity on 2024/05/03 07:59

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

write to 0xffff888237c2a2f0 of 4 bytes by task 9355 on cpu 0:
 drain_stock+0x48/0xf0 mm/memcontrol.c:2273
 __refill_stock+0x30/0xb0 mm/memcontrol.c:2313
 refill_stock mm/memcontrol.c:2328 [inline]
 try_charge_memcg+0x9eb/0xd20 mm/memcontrol.c:2779
 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3109
 obj_cgroup_charge+0xe9/0x140 mm/memcontrol.c:3399
 pcpu_memcg_pre_alloc_hook mm/percpu.c:1635 [inline]
 pcpu_alloc+0x1e4/0x1280 mm/percpu.c:1760
 __alloc_percpu_gfp+0x26/0x30 mm/percpu.c:1930
 __percpu_counter_init+0x47/0x130 lib/percpu_counter.c:162
 mm_init+0x433/0x5c0 kernel/fork.c:1166
 dup_mm kernel/fork.c:1545 [inline]
 copy_mm+0x11c/0xf10 kernel/fork.c:1597
 copy_process+0xf3e/0x2100 kernel/fork.c:2267
 kernel_clone+0x169/0x560 kernel/fork.c:2682
 __do_sys_clone kernel/fork.c:2823 [inline]
 __se_sys_clone kernel/fork.c:2807 [inline]
 __x64_sys_clone+0xdf/0x110 kernel/fork.c:2807
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888237c2a2f0 of 4 bytes by task 9351 on cpu 1:
 drain_all_stock+0xd3/0x2a0 mm/memcontrol.c:2358
 try_charge_memcg+0x6c2/0xd20 mm/memcontrol.c:2703
 try_charge mm/memcontrol.c:2837 [inline]
 mem_cgroup_charge_skmem+0x51/0x1c0 mm/memcontrol.c:7290
 sock_reserve_memory+0xb1/0x370 net/core/sock.c:1025
 sk_setsockopt+0x800/0x1e70 net/core/sock.c:1525
 sock_setsockopt+0x3c/0x50 net/core/sock.c:1551
 __sys_setsockopt+0x177/0x230 net/socket.c:2267
 __do_sys_setsockopt net/socket.c:2282 [inline]
 __se_sys_setsockopt net/socket.c:2279 [inline]
 __x64_sys_setsockopt+0x66/0x80 net/socket.c:2279
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x00000002 -> 0x00000040

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 9351 Comm: syz-executor.5 Not tainted 6.3.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/18 02:31 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/03/23 07:46 upstream fff5a5e7f528 f94b4a29 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/02/25 17:44 upstream 489fa31ea873 ee50e71c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
2023/01/26 12:33 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in drain_all_stock / drain_stock
* Struck through repros no longer work on HEAD.