KASAN: use-after-free Read in l2tp_tunnel_get_session

Status: premoderation: reported on 2026/07/23 21:14
Reported-by: syzbot+a15cb6458385a5d7a36b@syzkaller.appspotmail.com
First crash: 29d, last: 3d16h
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Read in l2tp_tunnel_get_session 19 2 13d 48d 0/2 premoderation: reported on 2026/07/05 05:21
android-5-15 KASAN: use-after-free Read in l2tp_tunnel_get_session 19 4 28d 57d 0/2 premoderation: reported on 2026/06/26 07:57

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in l2tp_tunnel_get_session+0xd2/0x170 net/l2tp/l2tp_core.c:270
Read of size 4 at addr ffff888132f19018 by task syz.1.1818/7406

CPU: 0 PID: 7406 Comm: syz.1.1818 Tainted: G        W          syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x71/0x200 mm/kasan/report.c:316
 print_report+0x4a/0x60 mm/kasan/report.c:420
 kasan_report+0x122/0x150 mm/kasan/report.c:524
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350
 l2tp_tunnel_get_session+0xd2/0x170 net/l2tp/l2tp_core.c:270
 pppol2tp_connect+0xb3c/0x1640 net/l2tp/l2tp_ppp.c:746
 __sys_connect_file net/socket.c:2000 [inline]
 __sys_connect+0x3da/0x460 net/socket.c:2017
 __do_sys_connect net/socket.c:2027 [inline]
 __se_sys_connect net/socket.c:2024 [inline]
 __x64_sys_connect+0x7a/0x90 net/socket.c:2024
 x64_sys_call+0x88d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:43
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fc3e979e0d9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc3ea5ba028 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007fc3e9a25fa0 RCX: 00007fc3e979e0d9
RDX: 000000000000002e RSI: 0000200000000040 RDI: 0000000000000005
RBP: 00007fc3e9835024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc3e9a26038 R14: 00007fc3e9a25fa0 R15: 00007ffedb27d728
 </TASK>

Allocated by task 7406:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:380 [inline]
 __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:389
 kasan_kmalloc include/linux/kasan.h:212 [inline]
 __do_kmalloc_node mm/slab_common.c:938 [inline]
 __kmalloc+0xb4/0x1e0 mm/slab_common.c:951
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 l2tp_session_create+0x38/0xbd0 net/l2tp/l2tp_core.c:1609
 pppol2tp_connect+0xbf5/0x1640 net/l2tp/l2tp_ppp.c:771
 __sys_connect_file net/socket.c:2000 [inline]
 __sys_connect+0x3da/0x460 net/socket.c:2017
 __do_sys_connect net/socket.c:2027 [inline]
 __se_sys_connect net/socket.c:2024 [inline]
 __x64_sys_connect+0x7a/0x90 net/socket.c:2024
 x64_sys_call+0x88d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:43
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 7406:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:242
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:250
 kasan_slab_free include/linux/kasan.h:178 [inline]
 slab_free_hook mm/slub.c:1750 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1776
 slab_free mm/slub.c:3712 [inline]
 __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3728
 kfree+0x6f/0xf0 mm/slab_common.c:990
 l2tp_session_free net/l2tp/l2tp_core.c:168 [inline]
 l2tp_session_put+0xaf/0x1a0 net/l2tp/l2tp_core.c:193
 pppol2tp_ioctl+0x748/0x960 net/l2tp/l2tp_ppp.c:-1
 pppox_ioctl+0x1f6/0x330 drivers/net/ppp/pppox.c:93
 sock_do_ioctl+0x114/0x330 net/socket.c:1191
 sock_ioctl+0x475/0x700 net/socket.c:1310
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0x12f/0x1b0 fs/ioctl.c:856
 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856
 x64_sys_call+0x58b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:46
 __kasan_record_aux_stack+0xb6/0xc0 mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496
 __call_rcu_common kernel/rcu/tree.c:2807 [inline]
 call_rcu+0xcf/0xf50 kernel/rcu/tree.c:2926
 fib6_info_release include/net/ip6_fib.h:350 [inline]
 ip6_route_add+0xe4/0x130 net/ipv6/route.c:3897
 addrconf_add_mroute net/ipv6/addrconf.c:2530 [inline]
 addrconf_add_dev+0x388/0x4a0 net/ipv6/addrconf.c:2548
 inet6_addr_add+0x1a8/0x9c0 net/ipv6/addrconf.c:3007
 inet6_rtm_newaddr+0x74a/0xa10 net/ipv6/addrconf.c:4999
 rtnetlink_rcv_msg+0xb28/0xde0 net/core/rtnetlink.c:6153
 netlink_rcv_skb+0x200/0x450 net/netlink/af_netlink.c:2521
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6171
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x8c1/0xa60 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x8b9/0xbd0 net/netlink/af_netlink.c:1873
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 __sys_sendto+0x4ac/0x660 net/socket.c:2142
 __do_sys_sendto net/socket.c:2154 [inline]
 __se_sys_sendto net/socket.c:2150 [inline]
 __x64_sys_sendto+0xe5/0x100 net/socket.c:2150
 x64_sys_call+0x83/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:46
 __kasan_record_aux_stack+0xb6/0xc0 mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496
 kvfree_call_rcu+0x8b/0x7a0 kernel/rcu/tree.c:3445
 drop_sysctl_table+0x2f5/0x430 fs/proc/proc_sysctl.c:1731
 drop_sysctl_table+0x2e4/0x430 fs/proc/proc_sysctl.c:1734
 unregister_sysctl_table+0x75/0x120 fs/proc/proc_sysctl.c:1769
 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:175
 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7221 [inline]
 addrconf_sysctl_unregister net/ipv6/addrconf.c:7249 [inline]
 addrconf_ifdown+0x15ff/0x1950 net/ipv6/addrconf.c:3977
 addrconf_notify+0x39f/0xe30 net/ipv6/addrconf.c:-1
 notifier_call_chain kernel/notifier.c:87 [inline]
 raw_notifier_call_chain+0xa1/0x110 kernel/notifier.c:455
 call_netdevice_notifiers_info net/core/dev.c:2022 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2060 [inline]
 call_netdevice_notifiers net/core/dev.c:2074 [inline]
 unregister_netdevice_many+0x104a/0x1910 net/core/dev.c:11005
 default_device_exit_batch+0x951/0x9f0 net/core/dev.c:11518
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x630/0xb10 net/core/net_namespace.c:604
 process_one_work+0x717/0xc30 kernel/workqueue.c:2302
 worker_thread+0xa4d/0x11d0 kernel/workqueue.c:2449
 kthread+0x281/0x320 kernel/kthread.c:386
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888132f19000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
 512-byte region [ffff888132f19000, ffff888132f19200)

The buggy address belongs to the physical page:
page:ffffea0004cbc600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x132f18
head:ffffea0004cbc600 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 dead000000000001 ffff888100042f00
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 290, tgid 290 (syz-executor), ts 23552125679, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2672
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2679
 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4586
 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5930
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3e0 mm/slub.c:2020
 ___slab_alloc+0x70f/0xb70 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 __kmem_cache_alloc_node+0x204/0x2d0 mm/slub.c:3423
 __do_kmalloc_node mm/slab_common.c:937 [inline]
 __kmalloc_node+0xa2/0x1e0 mm/slab_common.c:945
 kmalloc_node include/linux/slab.h:589 [inline]
 kzalloc_node include/linux/slab.h:710 [inline]
 qdisc_alloc+0x82/0x750 net/sched/sch_generic.c:951
 qdisc_create_dflt+0x6b/0x3a0 net/sched/sch_generic.c:1009
 attach_one_default_qdisc net/sched/sch_generic.c:1172 [inline]
 netdev_for_each_tx_queue include/linux/netdevice.h:2504 [inline]
 attach_default_qdiscs net/sched/sch_generic.c:1190 [inline]
 dev_activate+0x30e/0x1110 net/sched/sch_generic.c:1249
 __dev_open+0x40d/0x520 net/core/dev.c:1518
 __dev_change_flags+0x1f2/0x6b0 net/core/dev.c:8692
 dev_change_flags+0x80/0x1a0 net/core/dev.c:8763
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888132f18f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888132f18f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888132f19000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888132f19080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888132f19100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/19 00:32 android14-6.1 92668decd5e0 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in l2tp_tunnel_get_session
2026/08/06 02:22 android14-6.1 92668decd5e0 cd5b1963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in l2tp_tunnel_get_session
2026/07/23 21:14 android14-6.1 92668decd5e0 71a13572 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in l2tp_tunnel_get_session
2026/07/23 21:13 android14-6.1 92668decd5e0 71a13572 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Read in l2tp_tunnel_get_session
* Struck through repros no longer work on HEAD.