syzbot


WARNING: refcount bug in css_task_iter_next

Status: fixed on 2019/07/10 21:40
Subsystems: cgroups
[Documentation on labels]
Reported-by: syzbot+644dc16442b3a35f3629@syzkaller.appspotmail.com
Fix commit: c596687a008b cgroup: Fix css_task_iter_advance_css_set() cset skip condition
First crash: 1956d, last: 1951d
Discussions (1)
Title Replies (including bot) Last reply
WARNING: refcount bug in css_task_iter_next 0 (1) 2019/06/06 05:33
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in css_task_iter_next (2) cgroups 1 1551d 1547d 0/28 auto-closed as invalid on 2020/10/12 17:01

Sample crash report:
------------[ cut here ]------------
refcount_t: increment on 0; use-after-free.
WARNING: CPU: 1 PID: 19102 at lib/refcount.c:156 refcount_inc_checked lib/refcount.c:156 [inline]
WARNING: CPU: 1 PID: 19102 at lib/refcount.c:156 refcount_inc_checked+0x61/0x70 lib/refcount.c:154
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 19102 Comm: syz-executor.5 Not tainted 5.2.0-rc3-next-20190607 #11
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 panic+0x2cb/0x744 kernel/panic.c:219
 __warn.cold+0x20/0x4d kernel/panic.c:576
 report_bug+0x263/0x2b0 lib/bug.c:186
 fixup_bug arch/x86/kernel/traps.c:179 [inline]
 fixup_bug arch/x86/kernel/traps.c:174 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:272
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:291
 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:986
RIP: 0010:refcount_inc_checked lib/refcount.c:156 [inline]
RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:154
Code: 1d 20 38 68 06 31 ff 89 de e8 9b c7 3b fe 84 db 75 dd e8 52 c6 3b fe 48 c7 c7 60 b6 c4 87 c6 05 00 38 68 06 01 e8 4d f8 0d fe <0f> 0b eb c1 90 90 90 90 90 90 90 90 90 90 90 55 48 89 e5 41 57 41
RSP: 0018:ffff88804655f368 EFLAGS: 00010086
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 000000000002c7ef RSI: ffffffff815aeaf6 RDI: ffffed1008cabe5f
RBP: ffff88804655f378 R08: ffff88808c096100 R09: ffffed1015d240f1
R10: ffffed1015d240f0 R11: ffff8880ae920787 R12: ffff88809a643018
R13: ffff88804655f440 R14: ffff88809a642ff8 R15: 1ffff11008cabe78
 css_task_iter_next+0x141/0x1f0 kernel/cgroup/cgroup.c:4572
 mem_cgroup_scan_tasks+0xbb/0x180 mm/memcontrol.c:1168
 select_bad_process mm/oom_kill.c:374 [inline]
 out_of_memory mm/oom_kill.c:1088 [inline]
 out_of_memory+0x6b2/0x1280 mm/oom_kill.c:1035
 mem_cgroup_out_of_memory+0x1ca/0x230 mm/memcontrol.c:1573
 mem_cgroup_oom mm/memcontrol.c:1905 [inline]
 try_charge+0xfbe/0x1480 mm/memcontrol.c:2468
 __memcg_kmem_charge_memcg+0x7c/0x130 mm/memcontrol.c:2775
 __memcg_kmem_charge+0x136/0x300 mm/memcontrol.c:2808
 __alloc_pages_nodemask+0x4bd/0x8d0 mm/page_alloc.c:4697
 alloc_pages_current+0x107/0x210 mm/mempolicy.c:2132
 alloc_pages include/linux/gfp.h:509 [inline]
 __get_free_pages+0xc/0x40 mm/page_alloc.c:4717
 _pgd_alloc arch/x86/mm/pgtable.c:411 [inline]
 pgd_alloc+0x8b/0x3f0 arch/x86/mm/pgtable.c:427
 mm_alloc_pgd kernel/fork.c:618 [inline]
 mm_init+0x590/0x9b0 kernel/fork.c:1022
 dup_mm+0xde/0x13b0 kernel/fork.c:1340
 copy_mm kernel/fork.c:1399 [inline]
 copy_process.part.0+0x2baa/0x6720 kernel/fork.c:2057
 copy_process kernel/fork.c:1828 [inline]
 _do_fork+0x25d/0xfe0 kernel/fork.c:2394
 __do_sys_clone kernel/fork.c:2501 [inline]
 __se_sys_clone kernel/fork.c:2495 [inline]
 __x64_sys_clone+0xbf/0x150 kernel/fork.c:2495
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459279
Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f1b9cc44c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000459279
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1b9cc456d4
R13: 00000000004bf6c2 R14: 00000000004d0d98 R15: 00000000ffffffff
Shutting down cpus with NMI
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/10 21:45 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/10 17:53 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/10 16:32 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/09 14:02 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/08 14:39 linux-next 3f310e51ceb1 0159583c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/08 02:35 linux-next 3f310e51ceb1 cf9c3a50 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/08 02:14 linux-next 3f310e51ceb1 cf9c3a50 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/08 01:35 linux-next 3f310e51ceb1 ce9107d0 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/07 09:46 linux-next 3f310e51ceb1 698773cb .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/07 03:37 linux-next 8b4d1d574048 698773cb .config console log report ci-upstream-linux-next-kasan-gce-root
2019/06/05 23:51 linux-next b2924447b98a bfb4a51e .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.