================================================================== BUG: KASAN: use-after-free in css_task_iter_advance+0x49b/0x540 kernel/cgroup/cgroup.c:4507 Read of size 4 at addr ffff8880699a8fe4 by task syz-executor.4/17163 CPU: 0 PID: 17163 Comm: syz-executor.4 Not tainted 5.2.0-rc3-next-20190605 #9 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 pidlist_array_load+0x181/0xa80 kernel/cgroup/cgroup-v1.c:372 cgroup_pidlist_start+0x37e/0x4c0 kernel/cgroup/cgroup-v1.c:442 cgroup_seqfile_start+0xa4/0xd0 kernel/cgroup/cgroup.c:3752 kernfs_seq_start+0xdc/0x190 fs/kernfs/file.c:118 seq_read+0x2a7/0x1110 fs/seq_file.c:224 kernfs_fop_read+0xed/0x560 fs/kernfs/file.c:252 do_loop_readv_writev fs/read_write.c:714 [inline] do_loop_readv_writev fs/read_write.c:701 [inline] do_iter_read+0x4a4/0x660 fs/read_write.c:935 vfs_readv+0xf0/0x160 fs/read_write.c:997 do_preadv+0x1c4/0x280 fs/read_write.c:1089 __do_sys_preadv fs/read_write.c:1139 [inline] __se_sys_preadv fs/read_write.c:1134 [inline] __x64_sys_preadv+0x9a/0xf0 fs/read_write.c:1134 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:00007febff114c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000459279 RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007febff1156d4 R13: 00000000004c614c R14: 00000000004da9a8 R15: 00000000ffffffff Allocated by task 10993: 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_kmalloc+0x9/0x10 mm/kasan/common.c:503 __do_kmalloc_node mm/slab.c:3614 [inline] __kmalloc_node+0x4e/0x70 mm/slab.c:3621 kmalloc_node include/linux/slab.h:590 [inline] kvmalloc_node+0x68/0x100 mm/util.c:506 kvmalloc include/linux/mm.h:637 [inline] seq_buf_alloc fs/seq_file.c:32 [inline] seq_read+0x817/0x1110 fs/seq_file.c:204 kernfs_fop_read+0xed/0x560 fs/kernfs/file.c:252 __vfs_read+0x8a/0x110 fs/read_write.c:425 vfs_read+0x1f0/0x440 fs/read_write.c:461 ksys_read+0x14f/0x290 fs/read_write.c:587 __do_sys_read fs/read_write.c:597 [inline] __se_sys_read fs/read_write.c:595 [inline] __x64_sys_read+0x73/0xb0 fs/read_write.c:595 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 10993: 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] kfree+0x106/0x2a0 mm/slab.c:3753 kvfree+0x61/0x70 mm/util.c:535 seq_release+0x54/0x80 fs/seq_file.c:360 kernfs_fop_release+0xf7/0x1a0 fs/kernfs/file.c:781 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:168 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x58e/0x680 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880699a8ec0 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 292 bytes inside of 4096-byte region [ffff8880699a8ec0, ffff8880699a9ec0) The buggy address belongs to the page: page:ffffea0001a66a00 refcount:1 mapcount:0 mapping:ffff8880aa400dc0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000233e308 ffffea0002460c88 ffff8880aa400dc0 raw: 0000000000000000 ffff8880699a8ec0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880699a8e80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8880699a8f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880699a8f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880699a9000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880699a9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================