KASAN: use-after-free Write in l2tp_session_delete (3)

Status: premoderation: reported on 2026/06/24 03:10
Reported-by: syzbot+132a8a4f164715afe387@syzkaller.appspotmail.com
First crash: 40d, last: 37m
Similar bugs (14)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Write in l2tp_session_delete 22 2 650d 674d 0/2 auto-obsoleted due to no activity on 2025/01/19 22:14
android-5-10 KASAN: use-after-free Write in l2tp_session_delete (2) 22 3 450d 550d 0/2 auto-obsoleted due to no activity on 2025/08/08 12:20
android-5-10 KASAN: use-after-free Write in l2tp_session_delete (3) 22 5 206d 322d 0/2 auto-obsoleted due to no activity on 2026/04/09 06:46
android-6-1 KASAN: use-after-free Write in l2tp_session_delete (2) 22 1 163d 163d 0/2 auto-obsoleted due to no activity on 2026/05/22 02:12
linux-6.1 KASAN: use-after-free Write in l2tp_session_delete (2) 22 1 195d 195d 0/3 auto-obsoleted due to no activity on 2026/04/29 20:48
linux-6.1 KASAN: use-after-free Write in l2tp_session_delete 22 2 682d 704d 0/3 auto-obsoleted due to no activity on 2024/12/29 03:40
android-5-15 KASAN: use-after-free Write in l2tp_session_delete 22 2 767d 780d 0/2 auto-obsoleted due to no activity on 2024/09/25 05:09
android-5-15 KASAN: use-after-free Write in l2tp_session_delete (2) origin:downstream 22 syz, C error 29 12d 508d 0/2 upstream: reported C repro on 2025/03/13 02:24
linux-5.15 KASAN: use-after-free Write in l2tp_session_delete 22 2 1099d 1188d 0/3 auto-obsoleted due to no activity on 2023/11/08 00:22
linux-5.15 KASAN: use-after-free Write in l2tp_session_delete (2) 22 2 595d 682d 0/3 auto-obsoleted due to no activity on 2025/03/26 11:58
android-5-10 KASAN: use-after-free Write in l2tp_session_delete (4) 22 syz, C 7 26d 36d 0/2 upstream: reported C repro on 2026/06/28 05:46
android-6-1 KASAN: use-after-free Write in l2tp_session_delete origin:downstream 22 syz error 20 259d 664d 0/2 auto-obsoleted due to no activity on 2026/02/14 16:29
linux-5.15 KASAN: use-after-free Write in l2tp_session_delete (3) 22 1 374d 374d 0/3 auto-obsoleted due to no activity on 2025/11/02 00:17
upstream KASAN: slab-use-after-free Write in l2tp_session_delete net 22 syz, C done 1286 749d 769d 27/29 fixed on 2024/08/14 03:44

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
BUG: KASAN: use-after-free in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
BUG: KASAN: use-after-free in l2tp_session_delete+0x23/0x4d0 net/l2tp/l2tp_core.c:1573
Write of size 8 at addr ffff888136c1c808 by task syz.6.1001/4381

CPU: 0 PID: 4381 Comm: syz.6.1001 Not tainted 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
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37
 instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
 test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
 l2tp_session_delete+0x23/0x4d0 net/l2tp/l2tp_core.c:1573
 pppol2tp_release+0x169/0x2b0 net/l2tp/l2tp_ppp.c:438
 __sock_release net/socket.c:652 [inline]
 sock_close+0xc9/0x220 net/socket.c:1389
 __fput+0x1fd/0x8f0 fs/file_table.c:320
 ____fput+0x15/0x20 fs/file_table.c:348
 task_work_run+0x1e1/0x250 kernel/task_work.c:203
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0xaf2/0x2850 kernel/exit.c:887
 __do_sys_exit kernel/exit.c:996 [inline]
 __se_sys_exit kernel/exit.c:994 [inline]
 __x64_sys_exit+0x40/0x40 kernel/exit.c:994
 x64_sys_call+0x67/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:61
 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:0x7f992339e019
Code: Unable to access opcode bytes at 0x7f992339dfef.
RSP: 002b:00007f99242f1ef8 EFLAGS: 00000246 ORIG_RAX: 000000000000003c
RAX: ffffffffffffffda RBX: 0000000000000058 RCX: 00007f992339e019
RDX: 00007f99242f29c8 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007f992343500c R08: 0000000000000000 R09: 0000000000000058
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9923626038 R14: 00007f9923625fa0 R15: 00007ffc58a8e0a8
 </TASK>

Allocated by task 4379:
 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 314:
 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
 l2tp_session_delete+0x3df/0x4d0 net/l2tp/l2tp_core.c:1582
 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1228 [inline]
 l2tp_tunnel_del_work+0x199/0x410 net/l2tp/l2tp_core.c:1266
 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

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_info_create+0xaa8/0x14d0 net/ipv6/route.c:3878
 ip6_route_add+0x27/0x130 net/ipv6/route.c:3892
 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
 neigh_destroy+0x476/0x5b0 net/core/neighbour.c:918
 neigh_release include/net/neighbour.h:455 [inline]
 neigh_cleanup_and_release+0x76/0x1a0 net/core/neighbour.c:103
 neigh_flush_dev+0x79a/0x950 net/core/neighbour.c:429
 __neigh_ifdown+0x3f/0x400 net/core/neighbour.c:446
 neigh_ifdown+0x1f/0x30 net/core/neighbour.c:464
 rt6_disable_ip+0x878/0x8e0 net/ipv6/route.c:4930
 addrconf_ifdown+0x15d/0x1950 net/ipv6/addrconf.c:3824
 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]
 dev_close_many+0x325/0x4d0 net/core/dev.c:1622
 unregister_netdevice_many+0x43f/0x1910 net/core/dev.c:10979
 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 ffff888136c1c800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 8 bytes inside of
 512-byte region [ffff888136c1c800, ffff888136c1ca00)

The buggy address belongs to the physical page:
page:ffffea0004db0700 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x136c1c
head:ffffea0004db0700 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 0000000000000000 dead000000000001 ffff888100042f00
raw: 0000000000000000 0000000000100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 392, tgid 391 (syz.1.19), ts 30390631754, 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_track_caller+0xa1/0x1e0 mm/slab_common.c:958
 kmalloc_reserve net/core/skbuff.c:449 [inline]
 __alloc_skb+0x226/0x4a0 net/core/skbuff.c:518
 alloc_skb include/linux/skbuff.h:1322 [inline]
 alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6176
 sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2761
 sock_alloc_send_skb include/net/sock.h:1988 [inline]
 __ip6_append_data+0x2858/0x3c30 net/ipv6/ip6_output.c:1714
 ip6_make_skb+0x3a5/0x6d0 net/ipv6/ip6_output.c:2096
 udpv6_sendmsg+0x1bc0/0x2510 net/ipv6/udp.c:1593
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888136c1c700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888136c1c780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888136c1c800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888136c1c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888136c1c900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 4381 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 4381 Comm: syz.6.1001 Tainted: G    B              syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 05 01 48 c7 c7 80 0c ca 85 e8 bc 28 d9 fe 0f 0b eb c3 e8 13 9a 08 ff c6 05 f4 c9 26 05 01 48 c7 c7 e0 0c ca 85 e8 a0 28 d9 fe <0f> 0b eb a7 e8 f7 99 08 ff c6 05 d5 c9 26 05 01 48 c7 c7 20 0c ca
RSP: 0018:ffffc90000ad7b40 EFLAGS: 00010246
RAX: 320386c3c18fac00 RBX: 0000000000000003 RCX: ffff888113d43cc0
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002
RBP: ffffc90000ad7b50 R08: ffffc90000ad7727 R09: 1ffff9200015aee4
R10: dffffc0000000000 R11: fffff5200015aee5 R12: 1ffff11026d83910
R13: dffffc0000000000 R14: 0000000000000003 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f99235ef2f8 CR3: 0000000139ba7000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __refcount_sub_and_test include/linux/refcount.h:283 [inline]
 __refcount_dec_and_test include/linux/refcount.h:315 [inline]
 refcount_dec_and_test include/linux/refcount.h:333 [inline]
 l2tp_session_put+0xc8/0x1a0 net/l2tp/l2tp_core.c:192
 l2tp_session_delete+0x3df/0x4d0 net/l2tp/l2tp_core.c:1582
 pppol2tp_release+0x169/0x2b0 net/l2tp/l2tp_ppp.c:438
 __sock_release net/socket.c:652 [inline]
 sock_close+0xc9/0x220 net/socket.c:1389
 __fput+0x1fd/0x8f0 fs/file_table.c:320
 ____fput+0x15/0x20 fs/file_table.c:348
 task_work_run+0x1e1/0x250 kernel/task_work.c:203
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0xaf2/0x2850 kernel/exit.c:887
 __do_sys_exit kernel/exit.c:996 [inline]
 __se_sys_exit kernel/exit.c:994 [inline]
 __x64_sys_exit+0x40/0x40 kernel/exit.c:994
 x64_sys_call+0x67/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:61
 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:0x7f992339e019
Code: Unable to access opcode bytes at 0x7f992339dfef.
RSP: 002b:00007f99242f1ef8 EFLAGS: 00000246 ORIG_RAX: 000000000000003c
RAX: ffffffffffffffda RBX: 0000000000000058 RCX: 00007f992339e019
RDX: 00007f99242f29c8 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007f992343500c R08: 0000000000000000 R09: 0000000000000058
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9923626038 R14: 00007f9923625fa0 R15: 00007ffc58a8e0a8
 </TASK>
---[ end trace 0000000000000000 ]---

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/03 15:10 android14-6.1 92668decd5e0 6b7c9f71 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2026/07/29 02:08 android14-6.1 92668decd5e0 19622d9d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2026/07/28 02:20 android14-6.1 92668decd5e0 45ae1df4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2026/06/30 13:12 android14-6.1 c98298656777 fff8d0a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2026/06/28 18:14 android14-6.1 83f1262811ad fb92f11c .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2026/06/24 03:09 android14-6.1 de145cc20dc6 042555ff .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
* Struck through repros no longer work on HEAD.