================================================================== BUG: KASAN: use-after-free in deliver_ptype_list_skb net/core/dev.c:1871 [inline] BUG: KASAN: use-after-free in __netif_receive_skb_core+0x2be3/0x33d0 net/core/dev.c:4401 Read of size 2 at addr ffff880038c5e900 by task syz-executor1/17830 CPU: 1 PID: 17830 Comm: syz-executor1 Not tainted 4.13.0-next-20170904+ #14 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:16 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:52 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x24e/0x340 mm/kasan/report.c:409 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:428 deliver_ptype_list_skb net/core/dev.c:1871 [inline] __netif_receive_skb_core+0x2be3/0x33d0 net/core/dev.c:4401 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4456 process_backlog+0x203/0x740 net/core/dev.c:5132 napi_poll net/core/dev.c:5530 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5596 __do_softirq+0x2bb/0xbd0 kernel/softirq.c:284 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:957 do_softirq.part.20+0x14d/0x190 kernel/softirq.c:328 do_softirq kernel/softirq.c:176 [inline] __local_bh_enable_ip+0x135/0x160 kernel/softirq.c:181 local_bh_enable include/linux/bottom_half.h:31 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:726 [inline] ip_finish_output2+0x8ad/0x1460 net/ipv4/ip_output.c:231 ip_finish_output+0x85e/0xd10 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:238 [inline] ip_output+0x1cc/0x860 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:472 [inline] ip_local_out+0x95/0x160 net/ipv4/ip_output.c:124 ip_queue_xmit+0x8c6/0x18e0 net/ipv4/ip_output.c:504 tcp_transmit_skb+0x1947/0x3300 net/ipv4/tcp_output.c:1123 tcp_connect+0x2b20/0x3c50 net/ipv4/tcp_output.c:3464 tcp_v4_connect+0x15f5/0x1e80 net/ipv4/tcp_ipv4.c:255 __inet_stream_connect+0x2d4/0xf00 net/ipv4/af_inet.c:618 inet_stream_connect+0x58/0xa0 net/ipv4/af_inet.c:682 SYSC_connect+0x20a/0x480 net/socket.c:1642 SyS_connect+0x24/0x30 net/socket.c:1623 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x447299 RSP: 002b:00007fac54964c08 EFLAGS: 00000282 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 000000000000001e RCX: 0000000000447299 RDX: 0000000000000010 RSI: 0000000020f57000 RDI: 000000000000001e RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000282 R12: 00000000ffffffff R13: 0000000000005190 R14: 00000000006e8250 R15: 0000000000000001 Allocated by task 17818: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3627 kmalloc include/linux/slab.h:493 [inline] kzalloc include/linux/slab.h:666 [inline] fanout_add+0xa50/0x1190 net/packet/af_packet.c:1733 packet_setsockopt+0xfdc/0x1e80 net/packet/af_packet.c:3795 SYSC_setsockopt net/socket.c:1852 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1831 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 17823: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3503 [inline] kfree+0xca/0x250 mm/slab.c:3820 packet_release+0xa8f/0xd70 net/packet/af_packet.c:3033 sock_release+0x8d/0x1e0 net/socket.c:597 sock_close+0x16/0x20 net/socket.c:1126 __fput+0x333/0x7f0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:246 task_work_run+0x199/0x270 kernel/task_work.c:112 exit_task_work include/linux/task_work.h:21 [inline] do_exit+0xa52/0x1b40 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:968 get_signal+0x7e8/0x17e0 kernel/signal.c:2334 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:808 exit_to_usermode_loop+0x224/0x300 arch/x86/entry/common.c:158 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath+0x42f/0x500 arch/x86/entry/common.c:266 entry_SYSCALL_64_fastpath+0xbc/0xbe The buggy address belongs to the object at ffff880038c5e080 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2176 bytes inside of 4096-byte region [ffff880038c5e080, ffff880038c5f080) The buggy address belongs to the page: page:ffffea0000e31780 count:1 mapcount:0 mapping:ffff880038c5e080 index:0x0 compound_mapcount: 0 flags: 0x100000000008100(slab|head) raw: 0100000000008100 ffff880038c5e080 0000000000000000 0000000100000001 raw: ffffea0000c9efa0 ffff88003e801a50 ffff88003e800dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880038c5e800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff880038c5e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff880038c5e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff880038c5e980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff880038c5ea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================