================================================================== BUG: KASAN: use-after-free in __dev_remove_pack+0x305/0x3b0 net/core/dev.c:436 Read of size 8 at addr ffff880039105728 by task syzkaller567251/3748 CPU: 0 PID: 3748 Comm: syzkaller567251 Not tainted 4.13.0-next-20170907+ #17 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_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __dev_remove_pack+0x305/0x3b0 net/core/dev.c:436 __fanout_unlink net/packet/af_packet.c:1525 [inline] __unregister_prot_hook+0x211/0x280 net/packet/af_packet.c:367 unregister_prot_hook net/packet/af_packet.c:385 [inline] packet_release+0x8bb/0xd70 net/packet/af_packet.c:3006 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 SYSC_exit_group kernel/exit.c:979 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:977 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x43bc69 RSP: 002b:00007ffcee409a68 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000000b RCX: 000000000043bc69 RDX: 000000000043a341 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000082 R08: 00000000006d01e0 R09: 0000000000000000 R10: 00000000006d01d8 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2f0a2999c0 R15: 00007f2f0a299700 Allocated by task 3840: 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 3748: 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 SYSC_exit_group kernel/exit.c:979 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:977 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff880039104e80 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2216 bytes inside of 4096-byte region [ffff880039104e80, ffff880039105e80) The buggy address belongs to the page: page:ffffea0000e44100 count:1 mapcount:0 mapping:ffff880039104e80 index:0x0 compound_mapcount: 0 flags: 0x100000000008100(slab|head) raw: 0100000000008100 ffff880039104e80 0000000000000000 0000000100000001 raw: ffffea0000e60220 ffffea0000e444a0 ffff88003e800dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880039105600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff880039105680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff880039105700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff880039105780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff880039105800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================