================================================================== BUG: KASAN: use-after-free in __dev_remove_pack+0x305/0x3b0 net/core/dev.c:435 Read of size 8 at addr ffff8801d000e8a8 by task syzkaller264060/3194 CPU: 1 PID: 3194 Comm: syzkaller264060 Not tainted 4.13.0-rc7+ #65 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 __dev_remove_pack+0x305/0x3b0 net/core/dev.c:435 __fanout_unlink net/packet/af_packet.c:1527 [inline] __unregister_prot_hook+0x211/0x280 net/packet/af_packet.c:369 unregister_prot_hook net/packet/af_packet.c:387 [inline] packet_release+0x8bb/0xd70 net/packet/af_packet.c:3008 sock_release+0x8d/0x1e0 net/socket.c:597 sock_close+0x16/0x20 net/socket.c:1112 __fput+0x327/0x7e0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:246 task_work_run+0x18a/0x260 kernel/task_work.c:116 exit_task_work include/linux/task_work.h:21 [inline] do_exit+0xa3a/0x1b10 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:969 SYSC_exit_group kernel/exit.c:980 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:978 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x446499 RSP: 002b:00007ffde099e898 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000009 RCX: 0000000000446499 RDX: 0000000000444bf1 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000086 R08: 00000000006da1c0 R09: 0000000000000000 R10: 00000000006da144 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffde099e83f R14: 00007ff23a90c9c0 R15: 0000000000000000 Allocated by task 3253: 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+0x12f/0x740 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:1735 packet_setsockopt+0xfdc/0x1e80 net/packet/af_packet.c:3797 SYSC_setsockopt net/socket.c:1838 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1817 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 3194: 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:3035 sock_release+0x8d/0x1e0 net/socket.c:597 sock_close+0x16/0x20 net/socket.c:1112 __fput+0x327/0x7e0 fs/file_table.c:210 ____fput+0x15/0x20 fs/file_table.c:246 task_work_run+0x18a/0x260 kernel/task_work.c:116 exit_task_work include/linux/task_work.h:21 [inline] do_exit+0xa3a/0x1b10 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:969 SYSC_exit_group kernel/exit.c:980 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:978 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff8801d000e000 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2216 bytes inside of 4096-byte region [ffff8801d000e000, ffff8801d000f000) The buggy address belongs to the page: page:ffffea0007400380 count:1 mapcount:0 mapping:ffff8801d000e000 index:0x0 compound_mapcount: 0 flags: 0x200000000008100(slab|head) raw: 0200000000008100 ffff8801d000e000 0000000000000000 0000000100000001 raw: ffffea0007400320 ffffea00074158a0 ffff8801dac00dc0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d000e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d000e800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d000e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d000e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d000e980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================