BUG: KASAN: use-after-free in atomic_long_read include/linux/compiler.h:276 [inline] BUG: KASAN: use-after-free in packet_getsockopt+0xc72/0xe00 net/packet/af_packet.c:3932 Read of size 8 at addr ffff88006d0bbd98 by task syz-executor0/3067 CPU: 1 PID: 3067 Comm: syz-executor0 Not tainted 4.14.0-rc5-next-20171018+ #8 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+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 atomic_long_read include/linux/compiler.h:276 [inline] packet_getsockopt+0xc72/0xe00 net/packet/af_packet.c:3932 SYSC_getsockopt net/socket.c:1882 [inline] SyS_getsockopt+0x178/0x340 net/socket.c:1864 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x447c89 RSP: 002b:00007f428feb7bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007f428feb86cc RCX: 0000000000447c89 RDX: 0000000000000015 RSI: 0000000000000107 RDI: 000000000000000b RBP: 0000000000000082 R08: 00000000208a5000 R09: 0000000000000000 R10: 0000000020ec8000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f428feb89c0 R15: 00007f428feb8700 Allocated by task 3066: 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:3614 kzalloc include/linux/slab.h:502 [inline] fanout_add+0x27e/0x1480 net/packet/af_packet.c:1692 packet_setsockopt+0xfdc/0x1e80 net/packet/af_packet.c:3803 SYSC_setsockopt net/socket.c:1851 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1830 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 3066: 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:3492 [inline] kfree+0xca/0x250 mm/slab.c:3807 fanout_add+0x432/0x1480 net/packet/af_packet.c:1770 packet_setsockopt+0xfdc/0x1e80 net/packet/af_packet.c:3803 SYSC_setsockopt net/socket.c:1851 [inline] SyS_setsockopt+0x189/0x360 net/socket.c:1830 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff88006d0bbd80 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff88006d0bbd80, ffff88006d0bbe00) The buggy address belongs to the page: page:ffffea0001b42ec0 count:1 mapcount:0 mapping:ffff88006d0bb000 index:0xffff88006d0bb0c0 flags: 0x500000000000100(slab) raw: 0500000000000100 ffff88006d0bb000 ffff88006d0bb0c0 0000000100000010 raw: ffffea0001b34820 ffffea0001b42b60 ffff88003e800640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88006d0bbc80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff88006d0bbd00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88006d0bbd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88006d0bbe00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff88006d0bbe80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================