================================================================== BUG: KASAN: use-after-free in l2tp_session_queue_purge+0xf4/0x100 net/l2tp/l2tp_core.c:830 Read of size 4 at addr ffff8801d395ec80 by task syz-executor0/7031 CPU: 0 PID: 7031 Comm: syz-executor0 Not tainted 4.4.152-ge15716b #88 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 539bb40a994eaa60 ffff8800a9ee7cb8 ffffffff81e15fed ffffea00074e5780 ffff8801d395ec80 0000000000000000 ffff8801d395ec80 0000000000000000 ffff8800a9ee7cf0 ffffffff8151b489 ffff8801d395ec80 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_load4_noabort+0x14/0x20 mm/kasan/report.c:428 [] l2tp_session_queue_purge+0xf4/0x100 net/l2tp/l2tp_core.c:830 [] pppol2tp_release+0x1ff/0x310 net/l2tp/l2tp_ppp.c:509 [] __sock_release+0xd9/0x260 net/socket.c:592 [] sock_close+0x19/0x20 net/socket.c:1050 [] __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+0x1b5/0x1f0 arch/x86/entry/common.c:349 [] int_ret_from_sys_call+0x25/0xa3 Allocated by task 7031: [] 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:1570 [] SyS_connect+0x24/0x30 net/socket.c:1551 [] entry_SYSCALL_64_fastpath+0x22/0x9e Freed by task 7050: [] 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] [] l2tp_tunnel_closeall+0x2b9/0x350 net/l2tp/l2tp_core.c:1279 [] l2tp_udp_encap_destroy+0x8b/0xf0 net/l2tp/l2tp_core.c:1300 [] udp_destroy_sock+0x118/0x1a0 net/ipv4/udp.c:2056 [] sk_common_release+0x6d/0x300 net/core/sock.c:2680 [] udp_lib_close+0x15/0x20 include/net/udp.h:190 [] inet_release+0xff/0x1d0 net/ipv4/af_inet.c:435 [] __sock_release+0xd9/0x260 net/socket.c:592 [] sock_close+0x19/0x20 net/socket.c:1050 [] __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+0x1b5/0x1f0 arch/x86/entry/common.c:349 [] int_ret_from_sys_call+0x25/0xa3 The buggy address belongs to the object at ffff8801d395ec80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff8801d395ec80, ffff8801d395ee80) The buggy address belongs to the page: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [< (null)>] (null) PGD 1d3c1f067 PUD 1d3c1c067 PMD 0 Oops: 0010 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 7043 Comm: syz-executor1 Not tainted 4.4.152-ge15716b #88 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801cc963000 task.stack: ffff8800a9e18000 RIP: 0010:[<0000000000000000>] [< (null)>] (null) RSP: 0018:ffff8800a9e1f380 EFLAGS: 00010046 RAX: 0000000000000007 RBX: ffff8801db3208c0 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8801cc9638a4 RBP: ffffea00074e5780 R08: 0000001991fc6dce R09: 0000000000000004 R10: ffffed0043fffa09 R11: 0000000000000001 R12: ffff8800ba80f280 R13: ffff8800a9e1f398 R14: ffffffff83a457e0 R15: 0000000000000000 FS: 00007fbbc63cb700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000001cd05a000 CR4: 00000000001606f0 Stack: ffffffff83aaae60 ffff8801d395ec80 ffff8801d395ee80 ffff8800a9e1f3d8 ffffffff81490267 ffff8800a9e1f3d0 ffffea00074e5780 0000000000000000 ffffffff83aaae60 ffff8801d395ec80 ffff8801d395ee80 ffff8800a9e1f418 Call Trace: Code: kasan: CONFIG_KASAN_INLINE enabledkasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#2] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 1 PID: 7043 Comm: syz-executor1 Not tainted 4.4.152-ge15716b #88 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801cc963000 task.stack: ffff8800a9e18000 RIP: 0010:[] [] task_curr+0x75/0xe0 kernel/sched/core.c:1025 RSP: 0018:ffff8800a9e1eb28 EFLAGS: 00010006 RAX: dffffc0000000000 RBX: 000000000001f540 RCX: ffffc90001629000 RDX: 00000000c42a1b50 RSI: ffffffff81158f11 RDI: 000000062150da80 RBP: ffff8800a9e1eb40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: ffff8801cc963000 R12: ffff8801cc963000 R13: 00000000d395ee80 R14: 0000000000000000 R15: ffff8800b622bf40 FS: 00007fbbc63cb700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd5 CR3: 00000001cd05a000 CR4: 00000000001606f0 Stack: 0000000000000000 0000000000000000 ffff8801cc963000 ffff8800a9e1eb98 ffffffff81158f19 000000000000000b ffffffff8115aaa6 0000000000000000 0000000b0000000a ffff8801cc963000 0000000000000000 ffff8801cc963798 Call Trace: [] wants_signal kernel/signal.c:877 [inline] [] complete_signal+0x3a9/0x790 kernel/signal.c:891 [] __send_signal+0x4d5/0x11b0 kernel/signal.c:1080 [] send_signal+0x4a/0xc0 kernel/signal.c:1096 [] specific_send_sig_info kernel/signal.c:1141 [inline] [] force_sig_info+0x20a/0x310 kernel/signal.c:1189 [] force_sig_info_fault.constprop.23+0x158/0x1b0 arch/x86/mm/fault.c:187 [] no_context+0x1da/0x7b0 arch/x86/mm/fault.c:687 [] __bad_area_nosemaphore+0x260/0x310 arch/x86/mm/fault.c:815 [] bad_area_nosemaphore+0x2a/0x40 arch/x86/mm/fault.c:822 [] __do_page_fault+0x149/0xa10 arch/x86/mm/fault.c:1187 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1037 [] show_regs.cold.2+0x105/0x124 arch/x86/kernel/dumpstack_64.c:326 [] __die+0xa5/0xdb arch/x86/kernel/dumpstack.c:280 [] no_context+0x343/0x7b0 arch/x86/mm/fault.c:729 [] __bad_area_nosemaphore+0x260/0x310 arch/x86/mm/fault.c:815 [] bad_area_nosemaphore+0x2a/0x40 arch/x86/mm/fault.c:822 [] __do_page_fault+0x149/0xa10 arch/x86/mm/fault.c:1187 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1037 Code: ea 03 0f b6 04 02 84 c0 74 04 3c 03 7e 5c 48 b8 00 00 00 00 00 fc ff df 45 8b 6d 10 4a 8d 3c ed 80 66 a1 84 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 51 4a 03 1c ed 80 66 a1 84 48 b8 00 00 00 00 00 RIP [] task_curr+0x75/0xe0 kernel/sched/core.c:1025 RSP ---[ end trace 59695ccc5c55c1bd ]---