================================================================== BUG: KASAN: use-after-free in pppol2tp_connect+0x18d2/0x1930 net/l2tp/l2tp_ppp.c:728 Read of size 8 at addr ffff8801cd4d6410 by task syzkaller411127/5858 CPU: 1 PID: 5858 Comm: syzkaller411127 Not tainted 4.4.113-g202e079 #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 0ac80ef5ec8a36f1 ffff8801cd4b7ab0 ffffffff81d0278d ffffea0007353580 ffff8801cd4d6410 0000000000000000 ffff8801cd4d6410 1ffff10039a96f73 ffff8801cd4b7ae8 ffffffff814fd053 ffff8801cd4d6410 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_address_description+0x73/0x260 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report+0x285/0x370 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] pppol2tp_connect+0x18d2/0x1930 net/l2tp/l2tp_ppp.c:728 [] SYSC_connect+0x1b6/0x310 net/socket.c:1557 [] SyS_connect+0x24/0x30 net/socket.c:1538 [] do_syscall_32_irqs_on arch/x86/entry/common.c:390 [inline] [] do_fast_syscall_32+0x314/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 Allocated by task 5842: [] 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+0xad/0xe0 mm/kasan/kasan.c:616 [] __kmalloc+0x124/0x320 mm/slub.c:3613 [] kmalloc include/linux/slab.h:481 [inline] [] kzalloc include/linux/slab.h:620 [inline] [] l2tp_session_create+0x39/0x10f0 net/l2tp/l2tp_core.c:1744 [] pppol2tp_connect+0x10fc/0x1930 net/l2tp/l2tp_ppp.c:718 [] SYSC_connect+0x1b6/0x310 net/socket.c:1557 [] SyS_connect+0x24/0x30 net/socket.c:1538 [] do_syscall_32_irqs_on arch/x86/entry/common.c:390 [inline] [] do_fast_syscall_32+0x314/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 Freed by task 5842: [] 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+0xfc/0x300 mm/slub.c:3749 [] l2tp_session_free+0x170/0x200 net/l2tp/l2tp_core.c:1672 [] l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:293 [inline] [] pppol2tp_session_destruct+0xd3/0x110 net/l2tp/l2tp_ppp.c:477 [] sk_destruct+0x4a/0x4c0 net/core/sock.c:1447 [] __sk_free+0x57/0x230 net/core/sock.c:1480 [] sk_free+0x30/0x40 net/core/sock.c:1491 [] sock_put include/net/sock.h:1639 [inline] [] pppol2tp_release+0x27a/0x310 net/l2tp/l2tp_ppp.c:518 [] sock_release+0x8d/0x1e0 net/socket.c:586 [] sock_close+0x16/0x20 net/socket.c:1037 [] __fput+0x233/0x6d0 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x104/0x180 kernel/task_work.c:115 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x82a/0x2a10 kernel/exit.c:755 [] do_group_exit+0x108/0x320 kernel/exit.c:885 [] get_signal+0x4f2/0x1550 kernel/signal.c:2317 [] do_signal+0x8b/0x1d40 arch/x86/kernel/signal.c:712 [] exit_to_usermode_loop+0x11a/0x160 arch/x86/entry/common.c:247 [] prepare_exit_to_usermode arch/x86/entry/common.c:282 [inline] [] syscall_return_slowpath arch/x86/entry/common.c:347 [inline] [] do_syscall_32_irqs_on arch/x86/entry/common.c:396 [inline] [] do_fast_syscall_32+0x607/0x890 arch/x86/entry/common.c:457 [] sysenter_flags_fixed+0xd/0x17 The buggy address belongs to the object at ffff8801cd4d6280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 400 bytes inside of 512-byte region [ffff8801cd4d6280, ffff8801cd4d6480) The buggy address belongs to the page: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 5978 Comm: Not tainted 4.4.113-g202e079 #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 ae9b4083dca48453 ffff8801ce5df650 ffffffff81d0278d ffffffff85159520 0000000000000000 ffff8801cc93c740 ffff8801cd124c00 0000000000000000 ffff8801ce5df660 ffffffff81419df3 ffff8801ce5df808 Call Trace: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 5978 at lib/list_debug.c:29 __list_add+0x120/0x1c0 lib/list_debug.c:26() list_add corruption. next->prev should be prev (ffff8801db21fe70), but was ffff8801cc93dfd0. (next=ffff8801cc93df88).