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

Status: upstream: reported on 2026/09/08 09:02
Reported-by: syzbot+d1099579de3f264bc8d3@syzkaller.appspotmail.com
First crash: 2d10h, last: 2d10h
Similar bugs (15)
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 688d 712d 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 488d 588d 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 244d 360d 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 201d 201d 0/2 auto-obsoleted due to no activity on 2026/05/22 02:12
android-6-1 KASAN: use-after-free Write in l2tp_session_delete (3) 22 6 38d 78d 0/2 premoderation: reported on 2026/06/24 03:10
linux-6.1 KASAN: use-after-free Write in l2tp_session_delete (2) 22 1 233d 233d 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 720d 742d 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 805d 819d 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 31 2d18h 546d 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 1137d 1226d 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 633d 720d 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 13 9d18h 74d 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 298d 702d 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 412d 412d 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 787d 807d 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+0x20/0x5b0 net/l2tp/l2tp_core.c:1566
Write of size 8 at addr ffff88801f310808 by task kworker/u4:3/47

CPU: 1 PID: 47 Comm: kworker/u4:3 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: l2tp l2tp_tunnel_del_work
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:420
 kasan_report+0x10b/0x140 mm/kasan/report.c:524
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x235/0x290 mm/kasan/generic.c:189
 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+0x20/0x5b0 net/l2tp/l2tp_core.c:1566
 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1221 [inline]
 l2tp_tunnel_del_work+0x19a/0x3c0 net/l2tp/l2tp_core.c:1259
 process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 5202:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc+0xb3/0x240 mm/slab_common.c:949
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 l2tp_session_create+0x37/0xae0 net/l2tp/l2tp_core.c:1602
 pppol2tp_connect+0xbfa/0x1700 net/l2tp/l2tp_ppp.c:771
 __sys_connect_file net/socket.c:2011 [inline]
 __sys_connect+0x3cb/0x450 net/socket.c:2028
 __do_sys_connect net/socket.c:2038 [inline]
 __se_sys_connect net/socket.c:2035 [inline]
 __x64_sys_connect+0x76/0x80 net/socket.c:2035
 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 0:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x133/0x1b0 mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xb6/0x200 mm/slub.c:3700
 __sk_destruct+0x4f/0x650 net/core/sock.c:2151
 rcu_do_batch kernel/rcu/tree.c:2297 [inline]
 rcu_core+0x9a3/0x1740 kernel/rcu/tree.c:2557
 handle_softirqs+0x291/0x910 kernel/softirq.c:596
 __do_softirq kernel/softirq.c:630 [inline]
 invoke_softirq kernel/softirq.c:470 [inline]
 __irq_exit_rcu+0x13b/0x230 kernel/softirq.c:679
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
 sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:46
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 call_rcu+0x14f/0x950 kernel/rcu/tree.c:2849
 pppol2tp_release+0x23c/0x330 net/l2tp/l2tp_ppp.c:446
 __sock_release net/socket.c:654 [inline]
 sock_close+0xbf/0x210 net/socket.c:1400
 __fput+0x20a/0x8b0 fs/file_table.c:320
 task_work_run+0x1d0/0x260 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88801f310800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 8 bytes inside of
 1024-byte region [ffff88801f310800, ffff88801f310c00)

The buggy address belongs to the physical page:
page:ffffea00007cc400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f310
head:ffffea00007cc400 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017441dc0
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4278, tgid 4278 (syz-executor), ts 85429630895, free_ts 85428056782
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560
 prep_new_page mm/page_alloc.c:2567 [inline]
 get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358
 __alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658
 alloc_slab_page+0x5d/0x180 mm/slub.c:1799
 allocate_slab mm/slub.c:1944 [inline]
 new_slab+0x87/0x2d0 mm/slub.c:1997
 ___slab_alloc+0xbc5/0x1240 mm/slub.c:3154
 __slab_alloc mm/slub.c:3240 [inline]
 slab_alloc_node mm/slub.c:3325 [inline]
 __kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3398
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc_node_track_caller+0xa0/0x240 mm/slab_common.c:956
 kmalloc_reserve net/core/skbuff.c:446 [inline]
 __alloc_skb+0x226/0x7d0 net/core/skbuff.c:515
 alloc_skb include/linux/skbuff.h:1303 [inline]
 nlmsg_new include/net/netlink.h:998 [inline]
 rtmsg_fib+0xd7/0x440 net/ipv4/fib_semantics.c:553
 fib_table_insert+0xd52/0x1af0 net/ipv4/fib_trie.c:1385
 fib_magic+0x2ca/0x3b0 net/ipv4/fib_frontend.c:1118
 fib_add_ifaddr+0x135/0x5c0 net/ipv4/fib_frontend.c:1140
 fib_inetaddr_event+0x13c/0x1c0 net/ipv4/fib_frontend.c:1454
 notifier_call_chain kernel/notifier.c:87 [inline]
 blocking_notifier_call_chain+0x103/0x1b0 kernel/notifier.c:382
 __inet_insert_ifa+0x9c4/0xb80 net/ipv4/devinet.c:568
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1487 [inline]
 free_pcp_prepare mm/page_alloc.c:1537 [inline]
 free_unref_page_prepare+0x8e5/0x9e0 mm/page_alloc.c:3414
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3509
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:306
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x4b/0x490 mm/slab.h:737
 slab_alloc_node mm/slub.c:3359 [inline]
 __kmem_cache_alloc_node+0x19d/0x270 mm/slub.c:3398
 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 mca_alloc net/ipv6/mcast.c:887 [inline]
 __ipv6_dev_mc_inc+0x47b/0xb20 net/ipv6/mcast.c:942
 addrconf_join_solict net/ipv6/addrconf.c:2204 [inline]
 addrconf_dad_begin net/ipv6/addrconf.c:4046 [inline]
 addrconf_dad_work+0x3b8/0x1500 net/ipv6/addrconf.c:4171
 process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
 worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
 ffff88801f310700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88801f310780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801f310800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88801f310880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801f310900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/08 09:01 linux-6.1.y cf82dcca9634 680aa3e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Write in l2tp_session_delete
* Struck through repros no longer work on HEAD.