================================================================== BUG: KASAN: use-after-free in css_task_iter_advance+0x49b/0x540 kernel/cgroup/cgroup.c:4507 Read of size 4 at addr ffff88805cff38dc by task syz-executor.0/8811 CPU: 0 PID: 8811 Comm: syz-executor.0 Not tainted 5.2.0-rc3-next-20190606 #10 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 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 css_task_iter_advance+0x49b/0x540 kernel/cgroup/cgroup.c:4507 css_task_iter_start+0x18b/0x230 kernel/cgroup/cgroup.c:4543 mem_cgroup_scan_tasks+0xaf/0x180 mm/memcontrol.c:1167 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] __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x1b/0x1a0 arch/x86/mm/pgtable.c:26 __pte_alloc+0x20/0x310 mm/memory.c:408 copy_pte_range mm/memory.c:832 [inline] copy_pmd_range mm/memory.c:908 [inline] copy_pud_range mm/memory.c:942 [inline] copy_p4d_range mm/memory.c:964 [inline] copy_page_range+0x1561/0x1fc0 mm/memory.c:1026 dup_mmap kernel/fork.c:588 [inline] dup_mm+0x9c4/0x13b0 kernel/fork.c:1343 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:0x45784a Code: f7 d8 64 89 04 25 d4 02 00 00 64 4c 8b 0c 25 10 00 00 00 31 d2 4d 8d 91 d0 02 00 00 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 f5 00 00 00 85 c0 41 89 c5 0f 85 fc 00 00 RSP: 002b:00007ffe4dbb49c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007ffe4dbb49c0 RCX: 000000000045784a RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 00007ffe4dbb4a00 R08: 0000000000000001 R09: 000055555571a940 R10: 000055555571ac10 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000000 R15: 00007ffe4dbb4a50 Allocated by task 30925: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497 slab_post_alloc_hook mm/slab.h:444 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3482 getname_flags fs/namei.c:138 [inline] getname_flags+0xd6/0x5b0 fs/namei.c:128 getname+0x1a/0x20 fs/namei.c:209 do_sys_open+0x2c9/0x5d0 fs/open.c:1064 __do_sys_open fs/open.c:1088 [inline] __se_sys_open fs/open.c:1083 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1083 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 30925: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3692 putname+0xef/0x130 fs/namei.c:259 do_sys_open+0x318/0x5d0 fs/open.c:1079 __do_sys_open fs/open.c:1088 [inline] __se_sys_open fs/open.c:1083 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1083 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88805cff2a40 which belongs to the cache names_cache of size 4096 The buggy address is located 3740 bytes inside of 4096-byte region [ffff88805cff2a40, ffff88805cff3a40) The buggy address belongs to the page: page:ffffea000173fc80 refcount:1 mapcount:0 mapping:ffff8880aa594c40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001561f08 ffffea000255cb08 ffff8880aa594c40 raw: 0000000000000000 ffff88805cff2a40 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805cff3780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805cff3800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805cff3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805cff3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805cff3980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================