syzbot


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: 4d06h, last: 4d06h
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 614d 638d 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 413d 514d 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 170d 286d 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 127d 127d 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 159d 159d 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 646d 668d 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 731d 744d 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 C error 27 8d01h 472d 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 1063d 1151d 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 558d 646d 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 C 5 3h43m 3h41m 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 223d 627d 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 338d 338d 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 C done 1286 713d 732d 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 ffff888119f31c08 by task kworker/u4:14/12464

CPU: 0 PID: 12464 Comm: kworker/u4:14 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Workqueue: l2tp l2tp_tunnel_del_work
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
 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
 </TASK>

Allocated by task 13250:
 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 13247:
 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_session_destruct+0xb1/0xf0 net/l2tp/l2tp_ppp.c:407
 __sk_destruct+0x60/0x5e0 net/core/sock.c:2153
 sk_destruct net/core/sock.c:2198 [inline]
 __sk_free+0x30a/0x400 net/core/sock.c:2209
 sk_free+0x54/0x90 net/core/sock.c:2220
 sock_put include/net/sock.h:2098 [inline]
 pppol2tp_put_sk+0x7a/0xb0 net/l2tp/l2tp_ppp.c:390
 rcu_do_batch+0x52b/0xc30 kernel/rcu/tree.c:2297
 rcu_core+0x486/0xf00 kernel/rcu/tree.c:2557
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2574
 handle_softirqs+0x1d7/0x600 kernel/softirq.c:642
 __do_softirq kernel/softirq.c:680 [inline]
 invoke_softirq kernel/softirq.c:497 [inline]
 __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:729
 irq_exit_rcu+0x9/0x10 kernel/softirq.c:741
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
 sysvec_apic_timer_interrupt+0x58/0xc0 arch/x86/kernel/apic/apic.c:1118
 asm_sysvec_apic_timer_interrupt+0x1b/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+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
 pppol2tp_release+0x1e3/0x2b0 net/l2tp/l2tp_ppp.c:446
 __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
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0x9b/0xb0 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x1a/0x30 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 ffff888119f31c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 8 bytes inside of
 512-byte region [ffff888119f31c00, ffff888119f31e00)

The buggy address belongs to the physical page:
page:ffffea000467cc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x119f30
head:ffffea000467cc00 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 12769, tgid 12764 (syz.8.3427), ts 753217481632, free_ts 721717178239
 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]
 sock_wmalloc+0xb5/0x130 net/core/sock.c:2610
 pppol2tp_sendmsg+0x185/0x5d0 net/l2tp/l2tp_ppp.c:280
 sock_sendmsg_nosec net/socket.c:716 [inline]
 __sock_sendmsg net/socket.c:728 [inline]
 ____sys_sendmsg+0x5fb/0x9c0 net/socket.c:2508
 ___sys_sendmsg+0x2a2/0x360 net/socket.c:2562
 __sys_sendmmsg+0x2cc/0x4e0 net/socket.c:2648
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1580 [inline]
 free_pcp_prepare mm/page_alloc.c:1654 [inline]
 free_unref_page_prepare+0x80c/0x820 mm/page_alloc.c:3621
 free_unref_page+0x93/0x530 mm/page_alloc.c:3719
 __folio_put_small mm/swap.c:100 [inline]
 __folio_put+0xac/0xe0 mm/swap.c:123
 folio_put include/linux/mm.h:1442 [inline]
 put_page include/linux/mm.h:1494 [inline]
 aio_free_ring+0x280/0x370 fs/aio.c:345
 free_ioctx+0x1b/0x70 fs/aio.c:630
 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

Memory state around the buggy address:
 ffff888119f31b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888119f31b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888119f31c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888119f31c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888119f31d00: 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/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.