IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready ================================================================== BUG: KASAN: use-after-free in l2tp_session_queue_purge+0xf4/0x100 net/l2tp/l2tp_core.c:917 Read of size 4 at addr ffff8801d4a18a00 by task syz-executor0/6682 CPU: 0 PID: 6682 Comm: syz-executor0 Not tainted 4.9.110-g00a0bcb #7 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c5defaf0 ffffffff81eb2329 ffffea0007528600 ffff8801d4a18a00 0000000000000000 ffff8801d4a18a00 ffffffff83011be0 ffff8801c5defb28 ffffffff81567a89 ffff8801d4a18a00 0000000000000004 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x6c/0x234 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412 [] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 [] l2tp_session_queue_purge+0xf4/0x100 net/l2tp/l2tp_core.c:917 [] pppol2tp_release+0x1fb/0x2e0 net/l2tp/l2tp_ppp.c:492 [] sock_release+0x96/0x1c0 net/socket.c:599 [] sock_close+0x16/0x20 net/socket.c:1046 [] __fput+0x263/0x700 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x10c/0x180 kernel/task_work.c:116 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x9e1/0x27c0 kernel/exit.c:837 [] do_group_exit+0x111/0x340 kernel/exit.c:941 [] SYSC_exit_group kernel/exit.c:952 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:950 [] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] [] do_fast_syscall_32+0x2f7/0x870 arch/x86/entry/common.c:387 [] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 Allocated by task 6675: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609 __kmalloc+0x11d/0x300 mm/slub.c:3741 kmalloc include/linux/slab.h:495 [inline] kzalloc include/linux/slab.h:636 [inline] l2tp_session_create+0x38/0x16f0 net/l2tp/l2tp_core.c:1843 pppol2tp_connect+0x10d7/0x18f0 net/l2tp/l2tp_ppp.c:718 SYSC_connect+0x1b8/0x300 net/socket.c:1562 SyS_connect+0x24/0x30 net/socket.c:1543 do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] do_fast_syscall_32+0x2f7/0x870 arch/x86/entry/common.c:387 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 Freed by task 6659: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xfb/0x310 mm/slub.c:3878 l2tp_session_free+0x166/0x200 net/l2tp/l2tp_core.c:1770 l2tp_session_dec_refcount_1 net/l2tp/l2tp_core.h:297 [inline] l2tp_tunnel_closeall+0x284/0x350 net/l2tp/l2tp_core.c:1373 l2tp_udp_encap_destroy+0x87/0xe0 net/l2tp/l2tp_core.c:1394 udpv6_destroy_sock+0xb1/0xd0 net/ipv6/udp.c:1336 sk_common_release+0x6d/0x300 net/core/sock.c:2727 udp_lib_close+0x15/0x20 include/net/udp.h:203 inet_release+0xff/0x1d0 net/ipv4/af_inet.c:434 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:440 sock_release+0x96/0x1c0 net/socket.c:599 sock_close+0x16/0x20 net/socket.c:1046 __fput+0x263/0x700 fs/file_table.c:208 ____fput+0x15/0x20 fs/file_table.c:244 task_work_run+0x10c/0x180 kernel/task_work.c:116 exit_task_work include/linux/task_work.h:21 [inline] do_exit+0x9e1/0x27c0 kernel/exit.c:837 do_group_exit+0x111/0x340 kernel/exit.c:941 SYSC_exit_group kernel/exit.c:952 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:950 do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] do_fast_syscall_32+0x2f7/0x870 arch/x86/entry/common.c:387 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 The buggy address belongs to the object at ffff8801d4a18a00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff8801d4a18a00, ffff8801d4a18c00) The buggy address belongs to the page: page:ffffea0007528600 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d4a18900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d4a18980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d4a18a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d4a18a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d4a18b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ kernel BUG at net/l2tp/l2tp_core.c:917! invalid opcode: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 6695 Comm: syz-executor0 Tainted: G B 4.9.110-g00a0bcb #7 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801c9361800 task.stack: ffff8801c4d18000 RIP: 0010:[] [] l2tp_session_queue_purge+0xe0/0x100 net/l2tp/l2tp_core.c:917 RSP: 0018:ffff8801c4d1fb90 EFLAGS: 00010293 RAX: ffff8801c9361800 RBX: ffff8801d4ad8280 RCX: ffffffff836b9994 RDX: 0000000000000000 RSI: ffffffff836b9980 RDI: ffff8801d4ad8280 RBP: ffff8801c4d1fbb8 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801d4ad8280 R13: ffff8801b6795560 R14: ffff8801cfe87158 R15: ffffffff83011be0 FS: 0000000000000000(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 0000000008350004 CR3: 00000001d506a000 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffff8801cfe86e80 ffff8801d4ad8280 ffff8801b6795560 ffff8801cfe87158 ffffffff83011be0 ffff8801c4d1fbe8 ffffffff836c561b ffff8801b6795540 ffffffff8417a320 ffff8801b6795568 0000000000000000 ffff8801c4d1fc18 Call Trace: [] pppol2tp_release+0x1fb/0x2e0 net/l2tp/l2tp_ppp.c:492 [] sock_release+0x96/0x1c0 net/socket.c:599 [] sock_close+0x16/0x20 net/socket.c:1046 [] __fput+0x263/0x700 fs/file_table.c:208 [] ____fput+0x15/0x20 fs/file_table.c:244 [] task_work_run+0x10c/0x180 kernel/task_work.c:116 [] exit_task_work include/linux/task_work.h:21 [inline] [] do_exit+0x9e1/0x27c0 kernel/exit.c:837 [] do_group_exit+0x111/0x340 kernel/exit.c:941 [] SYSC_exit_group kernel/exit.c:952 [inline] [] SyS_exit_group+0x1d/0x20 kernel/exit.c:950 [] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline] [] do_fast_syscall_32+0x2f7/0x870 arch/x86/entry/common.c:387 [] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 Code: 4f ca fd 31 c0 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 d6 4f ca fd 48 89 df e8 ee 7b 34 00 eb ca e8 c7 4f ca fd 0f 0b e8 c0 4f ca fd <0f> 0b 4c 89 ff e8 46 21 e8 fd eb a6 48 89 df e8 1c 21 e8 fd e9 RIP [] l2tp_session_queue_purge+0xe0/0x100 net/l2tp/l2tp_core.c:917 RSP ---[ end trace f21431d354c72bbb ]---