================================================================== BUG: KASAN: use-after-free in skb_loop_sk net/core/dev.c:1882 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0xa0c/0xae0 net/core/dev.c:1911 Read of size 8 at addr ffff8801c5a894e0 by task syz-executor7/5097 CPU: 1 PID: 5097 Comm: syz-executor7 Not tainted 4.13.0-mm1+ #7 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 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_load8_noabort+0x14/0x20 mm/kasan/report.c:430 skb_loop_sk net/core/dev.c:1882 [inline] dev_queue_xmit_nit+0xa0c/0xae0 net/core/dev.c:1911 xmit_one net/core/dev.c:2971 [inline] dev_hard_start_xmit+0x16b/0xac0 net/core/dev.c:2991 __dev_queue_xmit+0x16dc/0x1e40 net/core/dev.c:3472 dev_queue_xmit+0x17/0x20 net/core/dev.c:3505 neigh_direct_output+0x15/0x20 net/core/neighbour.c:1390 neigh_output include/net/neighbour.h:481 [inline] ip6_finish_output2+0xad1/0x22a0 net/ipv6/ip6_output.c:120 ip6_finish_output+0x2f9/0x920 net/ipv6/ip6_output.c:146 NF_HOOK_COND include/linux/netfilter.h:238 [inline] ip6_output+0x1f4/0x850 net/ipv6/ip6_output.c:163 dst_output include/net/dst.h:472 [inline] NF_HOOK include/linux/netfilter.h:249 [inline] ip6_xmit+0xf24/0x1f80 net/ipv6/ip6_output.c:261 sctp_v6_xmit+0x409/0x600 net/sctp/ipv6.c:225 sctp_packet_transmit+0x212d/0x3570 net/sctp/output.c:637 sctp_outq_flush+0xaca/0x3f70 net/sctp/outqueue.c:895 sctp_outq_uncork+0x5a/0x70 net/sctp/outqueue.c:760 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1800 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1200 [inline] sctp_do_sm+0x510/0x6dd0 net/sctp/sm_sideeffect.c:1171 sctp_primitive_ASSOCIATE+0x9d/0xd0 net/sctp/primitive.c:88 sctp_sendmsg+0x1e5b/0x3200 net/sctp/socket.c:1956 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 SYSC_sendto+0x358/0x5a0 net/socket.c:1750 SyS_sendto+0x40/0x50 net/socket.c:1718 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x4520a9 RSP: 002b:00007f8e99095c08 EFLAGS: 00000216 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000718210 RCX: 00000000004520a9 RDX: 0000000000001000 RSI: 0000000020ff7000 RDI: 0000000000000019 RBP: 0000000000000082 R08: 0000000020ff7fe4 R09: 000000000000001c R10: 0000000000000080 R11: 0000000000000216 R12: 00000000004b7fd1 R13: 00000000ffffffff R14: 0000000020ff8000 R15: 0000000000001000 Allocated by task 5071: 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 5069: 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:244 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 ffff8801c5a88c40 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2208 bytes inside of 4096-byte region [ffff8801c5a88c40, ffff8801c5a89c40) The buggy address belongs to the page: page:ffffea000716a200 count:1 mapcount:0 mapping:ffff8801c5a88c40 index:0x0 compound_mapcount: 0 flags: 0x200000000008100(slab|head) raw: 0200000000008100 ffff8801c5a88c40 0000000000000000 0000000100000001 raw: ffffea0007184920 ffffea000716a4a0 ffff8801dac00dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c5a89380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c5a89400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c5a89480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c5a89500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c5a89580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================