dev_remove_pack: ffff8801d8d1b200 not found ================================================================== BUG: KASAN: use-after-free in fanout_demux_rollover+0x49b/0x4d0 net/packet/af_packet.c:1387 at addr ffff8801d8d1b1b8 Read of size 8 by task syzkaller664810/16135 CPU: 0 PID: 16135 Comm: syzkaller664810 Not tainted 4.9.51-g9452b2c #49 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db2077e0 ffffffff81d92f89 ffff8801da002000 ffff8801d8d1aa80 ffff8801d8d1b280 ffffed003b1a3637 ffff8801d8d1b1b8 ffff8801db207808 ffffffff8153cb8c ffffed003b1a3637 ffff8801da002000 0000000000000000 Call Trace: [ 122.181823] [] __dump_stack lib/dump_stack.c:15 [inline] [ 122.181823] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x21c/0x500 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:330 [inline] [] __asan_report_load8_noabort+0x29/0x30 mm/kasan/report.c:330 [] fanout_demux_rollover+0x49b/0x4d0 net/packet/af_packet.c:1387 [] packet_rcv_fanout+0x3e6/0x620 net/packet/af_packet.c:1473 [] deliver_skb net/core/dev.c:1834 [inline] [] deliver_ptype_list_skb net/core/dev.c:1849 [inline] [] __netif_receive_skb_core+0x887/0x29e0 net/core/dev.c:4220 [] __netif_receive_skb+0x5b/0x1c0 net/core/dev.c:4275 [] netif_receive_skb_internal+0xff/0x390 net/core/dev.c:4303 [] napi_skb_finish net/core/dev.c:4661 [inline] [] napi_gro_receive+0x1fb/0x400 net/core/dev.c:4691 [] receive_buf drivers/net/virtio_net.c:508 [inline] [] virtnet_receive+0xe1c/0x1cf0 drivers/net/virtio_net.c:723 [] virtnet_poll+0x26/0x140 drivers/net/virtio_net.c:741 [] napi_poll net/core/dev.c:5197 [inline] [] net_rx_action+0x396/0xe00 net/core/dev.c:5262 [] __do_softirq+0x22d/0x964 kernel/softirq.c:284 [] invoke_softirq kernel/softirq.c:364 [inline] [] irq_exit+0x165/0x190 kernel/softirq.c:405 [] exiting_irq arch/x86/include/asm/apic.h:659 [inline] [] do_IRQ+0x107/0x1b0 arch/x86/kernel/irq.c:251 [] common_interrupt+0x8c/0x8c arch/x86/entry/entry_64.S:520 [ 122.405268] [] ? __read_once_size include/linux/compiler.h:243 [inline] [ 122.405268] [] ? compound_head include/linux/page-flags.h:143 [inline] [ 122.405268] [] ? filemap_map_pages+0x265/0xd70 mm/filemap.c:2252 [] do_fault_around mm/memory.c:3109 [inline] [] do_read_fault mm/memory.c:3149 [inline] [] do_fault mm/memory.c:3289 [inline] [] handle_pte_fault mm/memory.c:3490 [inline] [] __handle_mm_fault mm/memory.c:3577 [inline] [] handle_mm_fault+0x1a6d/0x2530 mm/memory.c:3614 [] __do_page_fault+0x4eb/0xbd0 arch/x86/mm/fault.c:1397 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1460 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1012 Object at ffff8801d8d1aa80, in cache kmalloc-2048 size: 2048 Allocated: PID = 16082 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 __kmalloc+0x11d/0x310 mm/slub.c:3741 kmalloc include/linux/slab.h:495 [inline] sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1338 sk_alloc+0x3a/0x3a0 net/core/sock.c:1394 packet_create+0xf0/0x8e0 net/packet/af_packet.c:3211 __sock_create+0x3ab/0x640 net/socket.c:1182 sock_create net/socket.c:1222 [inline] SYSC_socket net/socket.c:1252 [inline] SyS_socket+0xf0/0x1b0 net/socket.c:1232 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 16054 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xf0/0x2f0 mm/slub.c:3878 sk_prot_free net/core/sock.c:1377 [inline] __sk_destruct+0x47f/0x570 net/core/sock.c:1455 sk_destruct+0x47/0x80 net/core/sock.c:1463 __sk_free+0x57/0x230 net/core/sock.c:1471 sk_free+0x23/0x30 net/core/sock.c:1482 sock_put include/net/sock.h:1592 [inline] packet_release+0x732/0xa20 net/packet/af_packet.c:3047 sock_release+0x8d/0x1e0 net/socket.c:599 sock_close+0x16/0x20 net/socket.c:1046 __fput+0x28c/0x6e0 fs/file_table.c:208 ____fput+0x15/0x20 fs/file_table.c:244 task_work_run+0x115/0x190 kernel/task_work.c:116 exit_task_work include/linux/task_work.h:21 [inline] do_exit+0x82e/0x2a50 kernel/exit.c:833 do_group_exit+0x108/0x320 kernel/exit.c:937 SYSC_exit_group kernel/exit.c:948 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:946 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801d8d1b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d8d1b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d8d1b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d8d1b200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d8d1b280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ================================================================== BUG: KASAN: use-after-free in fanout_demux_rollover+0x4bc/0x4d0 net/packet/af_packet.c:1387 at addr ffff8801d53ca000 Read of size 4 by task syzkaller664810/16135 CPU: 0 PID: 16135 Comm: syzkaller664810 Tainted: G B 4.9.51-g9452b2c #49 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801db2077e0 ffffffff81d92f89 ffff8801da001640 ffff8801d53ca000 ffff8801d53ca080 ffffed003aa79400 ffff8801d53ca000 ffff8801db207808 ffffffff8153cb8c ffffed003aa79400 ffff8801da001640 0000000000000000 Call Trace: [ 122.713249] [] __dump_stack lib/dump_stack.c:15 [inline] [ 122.713249] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x21c/0x500 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:329 [inline] [] __asan_report_load4_noabort+0x29/0x30 mm/kasan/report.c:329 [] fanout_demux_rollover+0x4bc/0x4d0 net/packet/af_packet.c:1387 [] packet_rcv_fanout+0x3e6/0x620 net/packet/af_packet.c:1473 [] deliver_skb net/core/dev.c:1834 [inline] [] deliver_ptype_list_skb net/core/dev.c:1849 [inline] [] __netif_receive_skb_core+0x887/0x29e0 net/core/dev.c:4220 [] __netif_receive_skb+0x5b/0x1c0 net/core/dev.c:4275 [] netif_receive_skb_internal+0xff/0x390 net/core/dev.c:4303 [] napi_skb_finish net/core/dev.c:4661 [inline] [] napi_gro_receive+0x1fb/0x400 net/core/dev.c:4691 [] receive_buf drivers/net/virtio_net.c:508 [inline] [] virtnet_receive+0xe1c/0x1cf0 drivers/net/virtio_net.c:723 [] virtnet_poll+0x26/0x140 drivers/net/virtio_net.c:741 [] napi_poll net/core/dev.c:5197 [inline] [] net_rx_action+0x396/0xe00 net/core/dev.c:5262 [] __do_softirq+0x22d/0x964 kernel/softirq.c:284 [] invoke_softirq kernel/softirq.c:364 [inline] [] irq_exit+0x165/0x190 kernel/softirq.c:405 [] exiting_irq arch/x86/include/asm/apic.h:659 [inline] [] do_IRQ+0x107/0x1b0 arch/x86/kernel/irq.c:251 [] common_interrupt+0x8c/0x8c arch/x86/entry/entry_64.S:520 [ 122.931088] [] ? __read_once_size include/linux/compiler.h:243 [inline] [ 122.931088] [] ? compound_head include/linux/page-flags.h:143 [inline] [ 122.931088] [] ? filemap_map_pages+0x265/0xd70 mm/filemap.c:2252 [] do_fault_around mm/memory.c:3109 [inline] [] do_read_fault mm/memory.c:3149 [inline] [] do_fault mm/memory.c:3289 [inline] [] handle_pte_fault mm/memory.c:3490 [inline] [] __handle_mm_fault mm/memory.c:3577 [inline] [] handle_mm_fault+0x1a6d/0x2530 mm/memory.c:3614 [] __do_page_fault+0x4eb/0xbd0 arch/x86/mm/fault.c:1397 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1460 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1012 Object at ffff8801d53ca000, in cache kmalloc-128 size: 128 Allocated: PID = 16086 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kmem_cache_alloc_trace+0xfb/0x2a0 mm/slub.c:2742 kmalloc include/linux/slab.h:490 [inline] kzalloc include/linux/slab.h:636 [inline] fanout_add net/packet/af_packet.c:1662 [inline] packet_setsockopt+0x181c/0x2240 net/packet/af_packet.c:3795 SYSC_setsockopt net/socket.c:1771 [inline] SyS_setsockopt+0x160/0x250 net/socket.c:1750 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 0 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xf0/0x2f0 mm/slub.c:3878 __rcu_reclaim kernel/rcu/rcu.h:113 [inline] rcu_do_batch kernel/rcu/tree.c:2779 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:3043 [inline] __rcu_process_callbacks kernel/rcu/tree.c:3010 [inline] rcu_process_callbacks+0x981/0x12d0 kernel/rcu/tree.c:3027 __do_softirq+0x22d/0x964 kernel/softirq.c:284 Memory state around the buggy address: ffff8801d53c9f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801d53c9f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8801d53ca000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d53ca080: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8801d53ca100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================