================================================================== BUG: KASAN: use-after-free in css_task_iter_advance+0x49b/0x540 kernel/cgroup/cgroup.c:4507 Read of size 4 at addr ffff88806abe1d9c by task syz-executor.1/25830 CPU: 0 PID: 25830 Comm: syz-executor.1 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 mem_cgroup_try_charge+0x24d/0x5e0 mm/memcontrol.c:6073 mem_cgroup_try_charge_delay+0x1f/0xa0 mm/memcontrol.c:6088 do_anonymous_page mm/memory.c:3036 [inline] handle_pte_fault mm/memory.c:3890 [inline] __handle_mm_fault+0x1e1a/0x3eb0 mm/memory.c:4016 handle_mm_fault+0x3b7/0xa90 mm/memory.c:4053 faultin_page mm/gup.c:654 [inline] __get_user_pages+0x7b6/0x1a40 mm/gup.c:857 populate_vma_page_range+0x20d/0x2a0 mm/gup.c:1560 __mm_populate+0x204/0x380 mm/gup.c:1608 mm_populate include/linux/mm.h:2387 [inline] __do_sys_mlockall mm/mlock.c:819 [inline] __se_sys_mlockall mm/mlock.c:795 [inline] __x64_sys_mlockall+0x373/0x510 mm/mlock.c:795 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:00007fa3340afc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000097 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000459279 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa3340b06d4 R13: 00000000004c5325 R14: 00000000004d9418 R15: 00000000ffffffff Allocated by task 16: 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 tso_fragment net/ipv4/tcp_output.c:1858 [inline] tcp_write_xmit+0x815/0x57c0 net/ipv4/tcp_output.c:2391 __tcp_push_pending_frames+0xb4/0x350 net/ipv4/tcp_output.c:2573 tcp_push_pending_frames include/net/tcp.h:1793 [inline] tcp_data_snd_check net/ipv4/tcp_input.c:5153 [inline] tcp_rcv_state_process+0xe16/0x4deb net/ipv4/tcp_input.c:6285 tcp_v4_do_rcv+0x351/0x8c0 net/ipv4/tcp_ipv4.c:1558 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 process_backlog+0x206/0x750 net/core/dev.c:5906 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 Freed by task 24800: 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_shifted_skb+0x7a3/0x1140 net/ipv4/tcp_input.c:1350 tcp_shift_skb_data net/ipv4/tcp_input.c:1478 [inline] tcp_sacktag_walk+0x655/0x11c0 net/ipv4/tcp_input.c:1542 tcp_sacktag_write_queue+0x1677/0x2fa0 net/ipv4/tcp_input.c:1804 tcp_ack+0x2d5c/0x5870 net/ipv4/tcp_input.c:3646 tcp_rcv_state_process+0xb85/0x4deb net/ipv4/tcp_input.c:6130 tcp_v4_do_rcv+0x351/0x8c0 net/ipv4/tcp_ipv4.c:1558 sk_backlog_rcv include/net/sock.h:945 [inline] __release_sock+0x129/0x390 net/core/sock.c:2412 release_sock+0x59/0x1c0 net/core/sock.c:2928 sk_wait_data+0x16f/0x460 net/core/sock.c:2454 tcp_recvmsg+0xdc2/0x2900 net/ipv4/tcp.c:2077 inet_recvmsg+0x136/0x620 net/ipv4/af_inet.c:830 sock_recvmsg_nosec net/socket.c:877 [inline] sock_recvmsg net/socket.c:894 [inline] sock_recvmsg+0xce/0x110 net/socket.c:890 ___sys_recvmsg+0x271/0x5a0 net/socket.c:2456 __sys_recvmsg+0x102/0x1d0 net/socket.c:2513 __do_sys_recvmsg net/socket.c:2523 [inline] __se_sys_recvmsg net/socket.c:2520 [inline] __x64_sys_recvmsg+0x78/0xb0 net/socket.c:2520 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 ffff88806abe1b00 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 668 bytes inside of 1024-byte region [ffff88806abe1b00, ffff88806abe1f00) The buggy address belongs to the page: page:ffffea0001aaf800 refcount:1 mapcount:0 mapping:ffff8880aa400ac0 index:0xffff88806abe0480 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001b22588 ffffea000285dc08 ffff8880aa400ac0 raw: ffff88806abe0480 ffff88806abe0000 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88806abe1c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806abe1d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806abe1d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806abe1e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806abe1e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================