================================================================== BUG: KASAN: use-after-free in l2tp_session_queue_purge+0xf4/0x100 net/l2tp/l2tp_core.c:830 Read of size 4 at addr ffff8801d8ae6280 by task syz-executor091/5434 CPU: 1 PID: 5434 Comm: syz-executor091 Not tainted 4.4.138-g226f96b #63 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 3e237e3ca7d753a9 ffff8800ac04fb50 ffffffff81e0ed0d ffffea000762b980 ffff8801d8ae6280 0000000000000000 ffff8801d8ae6280 ffffffff82f1a2b0 ffff8800ac04fb88 ffffffff81515a16 ffff8801d8ae6280 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+0x96/0x1c0 net/socket.c:586 [] sock_close+0x16/0x20 net/socket.c:1037 [] __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 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x9e5/0x26b0 kernel/exit.c:759 [] do_group_exit+0x111/0x330 kernel/exit.c:889 [] SYSC_exit_group kernel/exit.c:900 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:898 [] entry_SYSCALL_64_fastpath+0x22/0x9e Allocated by task 5432: [] 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:1557 [] SyS_connect+0x24/0x30 net/socket.c:1538 [] entry_SYSCALL_64_fastpath+0x22/0x9e Freed by task 5399: [] 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 [] udpv6_destroy_sock+0xb1/0xd0 net/ipv6/udp.c:1421 [] 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 [] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:424 [] sock_release+0x96/0x1c0 net/socket.c:586 [] sock_close+0x16/0x20 net/socket.c:1037 [] __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 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x9e5/0x26b0 kernel/exit.c:759 [] do_group_exit+0x111/0x330 kernel/exit.c:889 [] SYSC_exit_group kernel/exit.c:900 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:898 [] entry_SYSCALL_64_fastpath+0x22/0x9e The buggy address belongs to the object at ffff8801d8ae6280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff8801d8ae6280, ffff8801d8ae6480) 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: 1 Comm: init Not tainted 4.4.138-g226f96b #63 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d99a8000 task.stack: ffff8801d99b0000 RIP: 0010:[] [] __hlist_del include/linux/list.h:621 [inline] RIP: 0010:[] [] hlist_del include/linux/list.h:626 [inline] RIP: 0010:[] [] alloc_object lib/debugobjects.c:146 [inline] RIP: 0010:[] [] __debug_object_init+0x2df/0xa90 lib/debugobjects.c:320 RSP: 0018:ffff8801d99b7950 EFLAGS: 00010806 RAX: ffffffff85992760 RBX: ffff8800ab610ed0 RCX: 0000000000000000 RDX: ffffea000762b980 RSI: ffffea000762b988 RDI: 8000000000004088 RBP: ffff8801d99b7a18 R08: ffffea000762b990 R09: dffffc0000000000 R10: 1000000000000811 R11: ffff8801d99a8000 R12: 1ffff1003b336f32 R13: ffffffff859f6960 R14: 8000000000004080 R15: 00000000000641c0 FS: 00007fa61863c7a0(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa617fc6834 CR3: 00000000b6567000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8801d99a88b8 0000000000000000 ffff8801d99b7a20 0000000000000046 ffff880100000000 0000000000000296 ffffffff859f6968 ffffffff844bdb00 0000000041b58ab3 ffffffff842092c4 ffffffff81e6f720 0000000000000000 Call Trace: [] debug_object_init+0x16/0x20 lib/debugobjects.c:364 [] rcuhead_fixup_activate+0x1f/0x40 kernel/rcu/update.c:381 [] debug_object_fixup lib/debugobjects.c:279 [inline] [] debug_object_activate+0x238/0x480 lib/debugobjects.c:439 [] debug_rcu_head_queue kernel/rcu/rcu.h:75 [inline] [] __call_rcu.constprop.66+0x35/0x930 kernel/rcu/tree.c:3059 [] call_rcu+0x12/0x20 kernel/rcu/tree_plugin.h:662 [] dentry_free+0xb7/0x150 fs/dcache.c:335 [] __dentry_kill+0x4ac/0x5f0 fs/dcache.c:576 [] dentry_kill fs/dcache.c:603 [inline] [] dput.part.26+0x4ce/0x760 fs/dcache.c:818 [] dput+0x1f/0x30 fs/dcache.c:782 [] path_put fs/namei.c:506 [inline] [] terminate_walk+0x1ae/0x450 fs/namei.c:625 [] path_lookupat.isra.36+0x1cb/0x410 fs/namei.c:2172 [] filename_lookup.part.53+0x177/0x370 fs/namei.c:2188 [] filename_lookup fs/namei.c:2181 [inline] [] user_path_at_empty+0x53/0x70 fs/namei.c:2362 [] user_path_at include/linux/namei.h:52 [inline] [] SYSC_faccessat fs/open.c:378 [inline] [] SyS_faccessat fs/open.c:346 [inline] [] SYSC_access fs/open.c:426 [inline] [] SyS_access+0x20e/0x680 fs/open.c:424 [] entry_SYSCALL_64_fastpath+0x22/0x9e Code: c1 e9 03 41 80 3c 39 00 0f 85 02 07 00 00 4d 85 f6 4c 89 30 74 24 49 8d 7e 08 49 b9 00 00 00 00 00 fc ff df 49 89 fa 49 c1 ea 03 <43> 80 3c 0a 00 0f 85 3f 06 00 00 49 89 46 08 48 b8 00 00 00 00 RIP [] __hlist_del include/linux/list.h:621 [inline] RIP [] hlist_del include/linux/list.h:626 [inline] RIP [] alloc_object lib/debugobjects.c:146 [inline] RIP [] __debug_object_init+0x2df/0xa90 lib/debugobjects.c:320 RSP ---[ end trace 9e91629d3e5aece7 ]---