BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:276 [inline] BUG: KASAN: use-after-free in atomic64_read arch/x86/include/asm/atomic64_64.h:21 [inline] BUG: KASAN: use-after-free in atomic_long_read include/asm-generic/atomic-long.h:44 [inline] BUG: KASAN: use-after-free in packet_getsockopt+0xc72/0xe00 net/packet/af_packet.c:3930 Read of size 8 at addr ffff8801cbcc3498 by task syz-executor4/3386 CPU: 1 PID: 3386 Comm: syz-executor4 Not tainted 4.14.0-rc3+ #22 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+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __read_once_size include/linux/compiler.h:276 [inline] atomic64_read arch/x86/include/asm/atomic64_64.h:21 [inline] atomic_long_read include/asm-generic/atomic-long.h:44 [inline] packet_getsockopt+0xc72/0xe00 net/packet/af_packet.c:3930 C_SYSC_getsockopt net/compat.c:526 [inline] compat_SyS_getsockopt+0x2ed/0x420 net/compat.c:506 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline] do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:124 RIP: 0023:0xf7fdbc79 RSP: 002b:00000000f7fb605c EFLAGS: 00000296 ORIG_RAX: 000000000000016d RAX: ffffffffffffffda RBX: 000000000000000c RCX: 0000000000000107 RDX: 0000000000000015 RSI: 0000000020ec8000 RDI: 00000000208a5000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3380: 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+0x27e/0x1480 net/packet/af_packet.c:1694 packet_setsockopt+0xfdc/0x1e80 net/packet/af_packet.c:3801 compat_packet_setsockopt+0xe1/0x140 net/packet/af_packet.c:3973 C_SYSC_setsockopt net/compat.c:403 [inline] compat_SyS_setsockopt+0x17c/0x410 net/compat.c:386 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline] do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:124 Freed by task 3380: 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 fanout_add+0x432/0x1480 net/packet/af_packet.c:1772 packet_setsockopt+0xfdc/0x1e80 net/packet/af_packet.c:3801 compat_packet_setsockopt+0xe1/0x140 net/packet/af_packet.c:3973 C_SYSC_setsockopt net/compat.c:403 [inline] compat_SyS_setsockopt+0x17c/0x410 net/compat.c:386 do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline] do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391 entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:124 The buggy address belongs to the object at ffff8801cbcc3480 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of 128-byte region [ffff8801cbcc3480, ffff8801cbcc3500) The buggy address belongs to the page: page:ffffea00072f30c0 count:1 mapcount:0 mapping:ffff8801cbcc3000 index:0x0 flags: 0x200000000000100(slab) raw: 0200000000000100 ffff8801cbcc3000 0000000000000000 0000000100000015 raw: ffffea00073313a0 ffffea00073377a0 ffff8801dac00640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cbcc3380: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8801cbcc3400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff8801cbcc3480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cbcc3500: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8801cbcc3580: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================