================================================================== BUG: KASAN: use-after-free in css_task_iter_advance+0x49b/0x540 kernel/cgroup/cgroup.c:4507 Read of size 4 at addr ffff888090686ae4 by task syz-executor.3/30155 CPU: 1 PID: 30155 Comm: syz-executor.3 Not tainted 5.2.0-rc3-next-20190604 #8 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 update_tasks_flags+0x85/0x100 kernel/cgroup/cpuset.c:1836 update_flag+0x232/0x470 kernel/cgroup/cpuset.c:1886 cpuset_write_u64+0x222/0x270 kernel/cgroup/cpuset.c:2268 cgroup_file_write+0x4db/0x790 kernel/cgroup/cgroup.c:3727 kernfs_fop_write+0x2b8/0x480 fs/kernfs/file.c:316 __vfs_write+0x8a/0x110 fs/read_write.c:494 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x14f/0x290 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:620 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:00007f679838cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459279 RDX: 0000000000000011 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f679838d6d4 R13: 00000000004c8eb1 R14: 00000000004dfb68 R15: 00000000ffffffff Allocated by task 29265: 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_track_caller+0x4e/0x70 mm/slab.c:3628 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:139 __alloc_skb+0x10b/0x5e0 net/core/skbuff.c:207 alloc_skb_fclone include/linux/skbuff.h:1103 [inline] sk_stream_alloc_skb+0x2d2/0xc50 net/ipv4/tcp.c:870 tcp_sendmsg_locked+0xc85/0x3920 net/ipv4/tcp.c:1257 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1415 inet_sendmsg+0x141/0x5d0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:665 __sys_sendto+0x262/0x380 net/socket.c:1958 __do_sys_sendto net/socket.c:1970 [inline] __se_sys_sendto net/socket.c:1966 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1966 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 29265: 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 skb_free_head+0x93/0xb0 net/core/skbuff.c:589 skb_release_data+0x42d/0x7c0 net/core/skbuff.c:609 skb_release_all+0x4d/0x60 net/core/skbuff.c:663 __kfree_skb+0x16/0x30 net/core/skbuff.c:677 sk_wmem_free_skb include/net/sock.h:1476 [inline] tcp_write_queue_purge+0x27b/0x1250 net/ipv4/tcp.c:2522 tcp_v4_destroy_sock+0xe7/0x7d0 net/ipv4/tcp_ipv4.c:2078 inet_csk_destroy_sock+0x19a/0x450 net/ipv4/inet_connection_sock.c:841 tcp_close+0xa58/0x10c0 net/ipv4/tcp.c:2478 inet_release+0xe0/0x1f0 net/ipv4/af_inet.c:427 __sock_release+0xce/0x2a0 net/socket.c:601 sock_close+0x1b/0x30 net/socket.c:1273 __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 get_signal+0x2007/0x2490 kernel/signal.c:2522 do_signal+0x87/0x1990 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:164 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 ffff888090686900 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 484 bytes inside of 1024-byte region [ffff888090686900, ffff888090686d00) The buggy address belongs to the page: page:ffffea000241a180 refcount:1 mapcount:0 mapping:ffff8880aa400ac0 index:0xffff888090687200 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0002504a88 ffffea0002700088 ffff8880aa400ac0 raw: ffff888090687200 ffff888090686000 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888090686980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888090686a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888090686a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888090686b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888090686b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================