================================================================== BUG: KASAN: use-after-free in css_task_iter_advance+0x49b/0x540 kernel/cgroup/cgroup.c:4507 Read of size 4 at addr ffff88809a40421c by task syz-executor.3/6698 CPU: 1 PID: 6698 Comm: syz-executor.3 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 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+0x205/0x270 kernel/cgroup/cpuset.c:2265 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:00007f491abbdc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459279 RDX: 0000000000000012 RSI: 00000000200000c0 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f491abbe6d4 R13: 00000000004c8eb1 R14: 00000000004dfb68 R15: 00000000ffffffff Allocated by task 8770: 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:1104 [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 sock_write_iter+0x27c/0x3e0 net/socket.c:994 call_write_iter include/linux/fs.h:1870 [inline] new_sync_write+0x4d3/0x770 fs/read_write.c:483 __vfs_write+0xe1/0x110 fs/read_write.c:496 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 Freed by task 9: 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_rtx_queue_unlink_and_free include/net/tcp.h:1785 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3143 [inline] tcp_ack+0x1c28/0x5870 net/ipv4/tcp_input.c:3670 tcp_rcv_established+0x18c7/0x1fa0 net/ipv4/tcp_input.c:5560 tcp_v4_do_rcv+0x610/0x8c0 net/ipv4/tcp_ipv4.c:1536 tcp_v4_rcv+0x2dc8/0x3870 net/ipv4/tcp_ipv4.c:1917 ip_protocol_deliver_rcu+0x5a/0x8e0 net/ipv4/ip_input.c:204 ip_local_deliver_finish+0x23b/0x390 net/ipv4/ip_input.c:231 NF_HOOK include/linux/netfilter.h:305 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ip_local_deliver+0x1e9/0x520 net/ipv4/ip_input.c:252 dst_input include/net/dst.h:439 [inline] ip_rcv_finish+0x1d9/0x2f0 net/ipv4/ip_input.c:413 NF_HOOK include/linux/netfilter.h:305 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ip_rcv+0xe8/0x3f0 net/ipv4/ip_input.c:523 __netif_receive_skb_one_core+0x113/0x1a0 net/core/dev.c:4981 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5095 netif_receive_skb_internal+0x108/0x390 net/core/dev.c:5185 napi_skb_finish net/core/dev.c:5648 [inline] napi_gro_receive+0x52d/0x740 net/core/dev.c:5681 receive_buf+0xf8a/0x57c0 drivers/net/virtio_net.c:1061 virtnet_receive drivers/net/virtio_net.c:1323 [inline] virtnet_poll+0x5f8/0xe82 drivers/net/virtio_net.c:1428 napi_poll net/core/dev.c:6329 [inline] net_rx_action+0x4f5/0x1070 net/core/dev.c:6395 __do_softirq+0x25c/0x94c kernel/softirq.c:293 The buggy address belongs to the object at ffff88809a404040 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 476 bytes inside of 1024-byte region [ffff88809a404040, ffff88809a404440) The buggy address belongs to the page: page:ffffea0002690100 refcount:1 mapcount:0 mapping:ffff8880aa400ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0002818188 ffffea000238af08 ffff8880aa400ac0 raw: 0000000000000000 ffff88809a404040 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809a404100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809a404180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809a404200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809a404280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809a404300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================