================================================================== BUG: KASAN: use-after-free in pppol2tp_connect+0x160a/0x1910 net/l2tp/l2tp_ppp.c:735 Read of size 8 at addr ffff8801cef14410 by task syz-executor1/2566 CPU: 1 PID: 2566 Comm: syz-executor1 Not tainted 4.4.147-ga5fc665 #16 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 994640c7dc5c6da3 ffff8800b69a7ab0 ffffffff81e12a4d ffffea00073bc500 ffff8801cef14410 0000000000000000 ffff8801cef14410 ffff8800b69a7cd8 ffff8800b69a7ae8 ffffffff81517fd6 ffff8801cef14410 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_address_description+0x6c/0x216 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report.cold.7+0x175/0x2f7 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] pppol2tp_connect+0x160a/0x1910 net/l2tp/l2tp_ppp.c:735 [] SYSC_connect+0x1b8/0x300 net/socket.c:1558 [] SyS_connect+0x24/0x30 net/socket.c:1539 [] do_syscall_32_irqs_on arch/x86/entry/common.c:393 [inline] [] do_fast_syscall_32+0x324/0x8b0 arch/x86/entry/common.c:460 [] sysenter_flags_fixed+0xd/0x1a Allocated by task 2572: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:616 [] __kmalloc+0x124/0x310 mm/slub.c:3613 [] kmalloc include/linux/slab.h:481 [inline] [] kzalloc include/linux/slab.h:620 [inline] [] l2tp_session_create+0x39/0x1030 net/l2tp/l2tp_core.c:1748 [] pppol2tp_connect+0x10f0/0x1910 net/l2tp/l2tp_ppp.c:725 [] SYSC_connect+0x1b8/0x300 net/socket.c:1558 [] SyS_connect+0x24/0x30 net/socket.c:1539 [] do_syscall_32_irqs_on arch/x86/entry/common.c:393 [inline] [] do_fast_syscall_32+0x324/0x8b0 arch/x86/entry/common.c:460 [] sysenter_flags_fixed+0xd/0x1a Freed by task 2562: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:589 [] slab_free_hook mm/slub.c:1383 [inline] [] slab_free_freelist_hook mm/slub.c:1405 [inline] [] slab_free mm/slub.c:2859 [inline] [] kfree+0xf4/0x310 mm/slub.c:3749 [] l2tp_session_free+0x170/0x200 net/l2tp/l2tp_core.c:1676 [] l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:293 [inline] [] pppol2tp_session_destruct+0xd7/0x110 net/l2tp/l2tp_ppp.c:477 [] sk_destruct+0x4c/0x4c0 net/core/sock.c:1447 [] __sk_free+0x4f/0x220 net/core/sock.c:1480 [] sk_free+0x30/0x40 net/core/sock.c:1491 [] sock_put include/net/sock.h:1639 [inline] [] pppol2tp_release+0x26a/0x310 net/l2tp/l2tp_ppp.c:518 [] sock_release+0x96/0x1c0 net/socket.c:587 [] sock_close+0x16/0x20 net/socket.c:1038 [] __fput+0x235/0x6f0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x10f/0x190 kernel/task_work.c:115 [] tracehook_notify_resume include/linux/tracehook.h:191 [inline] [] exit_to_usermode_loop+0x13d/0x160 arch/x86/entry/common.c:253 [] prepare_exit_to_usermode arch/x86/entry/common.c:284 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:349 [inline] [] do_syscall_32_irqs_on arch/x86/entry/common.c:399 [inline] [] do_fast_syscall_32+0x61e/0x8b0 arch/x86/entry/common.c:460 [] sysenter_flags_fixed+0xd/0x1a The buggy address belongs to the object at ffff8801cef14280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 400 bytes inside of 512-byte region [ffff8801cef14280, ffff8801cef14480) The buggy address belongs to the page: kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 2600 Comm: syz-executor6 Not tainted 4.4.147-ga5fc665 #16 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d2408000 task.stack: ffff8801d4800000 RIP: 0010:[] [] __debug_check_no_obj_freed lib/debugobjects.c:689 [inline] RIP: 0010:[] [] debug_check_no_obj_freed+0x1a6/0x940 lib/debugobjects.c:726 RSP: 0018:ffff8801d4807468 EFLAGS: 00010803 RAX: 0000000000000282 RBX: c8cfe8df89480b0f RCX: 0000000000000000 RDX: 1919fd1bf1290161 RSI: 0000000000000002 RDI: ffffffff8148f50f RBP: ffff8801d4807550 R08: ffff8801d48074e8 R09: dead000000000200 R10: 0000000000000001 R11: ffff8801d2408000 R12: c8cfe8df89480b0f R13: dffffc0000000000 R14: ffffffff85a46c28 R15: 495441e589485500 FS: 0000000000000000(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000f5762db0 CR3: 00000001da2c9000 CR4: 00000000001606f0 Stack: 0000000000000046 ffff8801d2408000 ffffffff85a46c20 ffff8800b0d4b000 ffff8800b0d4b000 0000000000000001 ffff8801d48074d8 00000000000b12c0 1ffff1003a900e99 ffff8800b0d4a000 fffffbfff0b48d84 ffff8800b0d4a000 Call Trace: [] free_pages_prepare+0x51e/0xad0 mm/page_alloc.c:1049 [] free_hot_cold_page+0x3f/0x3a0 mm/page_alloc.c:2112 [] free_hot_cold_page_list+0x98/0x3c0 mm/page_alloc.c:2160 [] release_pages+0x1f7/0x4f0 mm/swap.c:970 [] free_pages_and_swap_cache+0x106/0x140 mm/swap_state.c:266 [] tlb_flush_mmu_free+0xb4/0x150 mm/memory.c:255 [] zap_pte_range mm/memory.c:1217 [inline] [] zap_pmd_range mm/memory.c:1262 [inline] [] zap_pud_range mm/memory.c:1283 [inline] [] unmap_page_range mm/memory.c:1307 [inline] [] unmap_single_vma+0xd65/0x1250 mm/memory.c:1352 [] unmap_vmas+0x81/0xd0 mm/memory.c:1382 [] exit_mmap+0x1c9/0x3a0 mm/mmap.c:2958 [] __mmput kernel/fork.c:717 [inline] [] mmput+0xf8/0x2d0 kernel/fork.c:737 [] exit_mm kernel/exit.c:440 [inline] [] do_exit+0x8d8/0x26b0 kernel/exit.c:742 [] do_group_exit+0x111/0x330 kernel/exit.c:885 [] get_signal+0x4ec/0x14b0 kernel/signal.c:2321 [] do_signal+0x8b/0x1d30 arch/x86/kernel/signal.c:712 [] exit_to_usermode_loop+0x11a/0x160 arch/x86/entry/common.c:249 [] prepare_exit_to_usermode arch/x86/entry/common.c:284 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:349 [inline] [] do_syscall_32_irqs_on arch/x86/entry/common.c:399 [inline] [] do_fast_syscall_32+0x61e/0x8b0 arch/x86/entry/common.c:460 [] sysenter_flags_fixed+0xd/0x1a Code: 48 c7 c6 60 59 99 85 4c 8b 24 3e 4d 85 e4 0f 84 f8 03 00 00 49 b9 00 02 00 00 00 00 ad de 31 f6 4c 8d 45 98 4c 89 e2 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 e5 03 00 00 49 8d 7c 24 18 83 c6 01 49 8b RIP [] __debug_check_no_obj_freed lib/debugobjects.c:689 [inline] RIP [] debug_check_no_obj_freed+0x1a6/0x940 lib/debugobjects.c:726 RSP ---[ end trace d89f3a3fdcbd97fd ]---