syzbot


KCSAN: data-race in drain_all_stock / obj_cgroup_uncharge_pages

Status: auto-closed as invalid on 2021/11/21 07:08
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 408d, last: 408d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in drain_all_stock / obj_cgroup_uncharge_pages (2) 2 340d 350d 0/24 auto-closed as invalid on 2022/01/27 23:42
upstream KCSAN: data-race in drain_all_stock / obj_cgroup_uncharge_pages (3) 3 236d 271d 0/24 auto-closed as invalid on 2022/05/12 02:32

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

write to 0xffff888237d22e70 of 4 bytes by task 4478 on cpu 1:
 refill_stock mm/memcontrol.c:2209 [inline]
 obj_cgroup_uncharge_pages+0xc7/0x1a0 mm/memcontrol.c:2938
 refill_obj_stock+0x123/0x1b0 mm/memcontrol.c:3201
 obj_cgroup_uncharge+0xa/0x10 mm/memcontrol.c:3250
 memcg_slab_free_hook+0xd9/0x150 mm/slab.h:364
 ___cache_free+0x3c/0x300 mm/slab.c:3464
 __cache_free mm/slab.c:3453 [inline]
 kfree+0xf8/0x1d0 mm/slab.c:3803
 __io_remove_buffers fs/io_uring.c:4307 [inline]
 io_destroy_buffers fs/io_uring.c:9216 [inline]
 io_ring_ctx_free fs/io_uring.c:9275 [inline]
 io_ring_exit_work+0xe05/0x1580 fs/io_uring.c:9449
 process_one_work+0x402/0x910 kernel/workqueue.c:2297
 worker_thread+0x636/0xae0 kernel/workqueue.c:2444
 kthread+0x262/0x280 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30

read to 0xffff888237d22e70 of 4 bytes by task 21469 on cpu 0:
 drain_all_stock+0xc0/0x460 mm/memcontrol.c:2242
 try_charge_memcg+0x6c9/0xa00 mm/memcontrol.c:2602
 obj_cgroup_charge_pages+0x4f/0x190 mm/memcontrol.c:2960
 __memcg_kmem_charge_page+0x224/0x2e0 mm/memcontrol.c:3000
 __alloc_pages+0x1bd/0x320 mm/page_alloc.c:5392
 alloc_pages+0x382/0x3d0
 __get_free_pages+0x8/0x30 mm/page_alloc.c:5412
 io_mem_alloc fs/io_uring.c:8762 [inline]
 io_allocate_scq_urings fs/io_uring.c:10155 [inline]
 io_uring_create+0x949/0x1bb0 fs/io_uring.c:10291
 io_uring_setup fs/io_uring.c:10381 [inline]
 __do_sys_io_uring_setup fs/io_uring.c:10387 [inline]
 __se_sys_io_uring_setup fs/io_uring.c:10384 [inline]
 __x64_sys_io_uring_setup+0xf3/0x130 fs/io_uring.c:10384
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x0000000b -> 0x0000000c

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 21469 Comm: syz-executor.3 Tainted: G        W         5.15.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/10/17 07:02 upstream d999ade1cc86 0c5d9412 .config log report info KCSAN: data-race in drain_all_stock / obj_cgroup_uncharge_pages
* Struck through repros no longer work on HEAD.