dev_remove_pack: ffff8801c48df240 not found ================================================================== BUG: KASAN: use-after-free in fanout_demux_rollover+0x49b/0x4d0 net/packet/af_packet.c:1392 Read of size 8 at addr ffff8801cc9687f0 by task syz-executor5/5970 CPU: 0 PID: 5970 Comm: syz-executor5 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 fanout_demux_rollover+0x49b/0x4d0 net/packet/af_packet.c:1392 packet_rcv_fanout+0x52e/0x7d0 net/packet/af_packet.c:1478 deliver_skb net/core/dev.c:1859 [inline] deliver_ptype_list_skb net/core/dev.c:1874 [inline] __netif_receive_skb_core+0xc12/0x33d0 net/core/dev.c:4406 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4461 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4534 napi_skb_finish net/core/dev.c:4895 [inline] napi_gro_receive+0x3d0/0x500 net/core/dev.c:4926 receive_buf+0xcc5/0x51f0 drivers/net/virtio_net.c:841 virtnet_receive drivers/net/virtio_net.c:1087 [inline] virtnet_poll+0x304/0xad0 drivers/net/virtio_net.c:1168 napi_poll net/core/dev.c:5537 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5603 __do_softirq+0x2bb/0xbd0 kernel/softirq.c:284 invoke_softirq kernel/softirq.c:364 [inline] irq_exit+0x1d3/0x210 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:638 [inline] do_IRQ+0xf6/0x190 arch/x86/kernel/irq.c:253 common_interrupt+0x9d/0x9d arch/x86/entry/entry_64.S:598 RIP: 0010:trace_kmalloc include/trace/events/kmem.h:45 [inline] RIP: 0010:kmem_cache_alloc_trace+0x459/0x750 mm/slab.c:3628 RSP: 0018:ffff8801c8b175a0 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff6e RAX: 0000000000000001 RBX: 00000000000000c0 RCX: 0000000000000000 RDX: 1ffffffff0b592fd RSI: ffffffff85b38120 RDI: 0000000000000282 RBP: ffff8801c8b17618 R08: 0000000000000000 R09: 1ffff10039162e22 R10: 00000000a13caab6 R11: 00000000af0f781c R12: ffff8801c63390c0 R13: ffffffff84413b45 R14: ffff8801dac00640 R15: 00000000014080c0 kmalloc include/linux/slab.h:493 [inline] kzalloc include/linux/slab.h:666 [inline] fanout_add+0x345/0x1190 net/packet/af_packet.c:1698 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 RIP: 0033:0x4520a9 RSP: 002b:00007fc494dc9c08 EFLAGS: 00000216 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000718000 RCX: 00000000004520a9 RDX: 0000000000000012 RSI: 0000000000000107 RDI: 0000000000000004 RBP: 0000000000000082 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000020cdeffc R11: 0000000000000216 R12: 00000000004bb52e R13: 00000000ffffffff R14: 0000000000000003 R15: 0000000000000107 Allocated by task 3293: 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 __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x162/0x760 mm/slab.c:3734 kmalloc include/linux/slab.h:498 [inline] sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1469 sk_alloc+0x89/0x700 net/core/sock.c:1525 packet_create+0x169/0xb00 net/packet/af_packet.c:3211 __sock_create+0x4d4/0x850 net/socket.c:1262 sock_create net/socket.c:1302 [inline] SYSC_socket net/socket.c:1332 [inline] SyS_socket+0xeb/0x200 net/socket.c:1312 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 3299: 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 sk_prot_free net/core/sock.c:1508 [inline] __sk_destruct+0x74a/0x910 net/core/sock.c:1587 sk_destruct+0x47/0x80 net/core/sock.c:1595 __sk_free+0x57/0x230 net/core/sock.c:1603 sk_free+0x2a/0x40 net/core/sock.c:1614 sock_put include/net/sock.h:1649 [inline] packet_release+0x859/0xd70 net/packet/af_packet.c:3047 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