syzbot


KASAN: use-after-free Write in l2tp_session_delete

Status: premoderation: reported syz repro on 2024/10/08 10:15
Bug presence: origin:downstream
[Documentation on labels]
Reported-by: syzbot+5d024d4d686f39096399@syzkaller.appspotmail.com
First crash: 411d, last: 7d13h
Bug presence (3)
Date Name Commit Repro Result
2025/06/03 android14-6.1 (ToT) 5b87067cdd87 syz [report] KASAN: use-after-free Write in l2tp_session_delete
2025/06/03 lts (merge base) 02b72ccb5f9d syz Didn't crash
2025/06/03 upstream (ToT) 2043ae9019e0 syz Didn't crash
Similar bugs (10)
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 24 2 398d 422d 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) 24 3 197d 298d 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) 24 2 26d 70d 0/2 premoderation: reported on 2025/09/15 04:31
linux-6.1 KASAN: use-after-free Write in l2tp_session_delete 24 2 430d 452d 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 24 2 515d 528d 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 24 C 19 10d 256d 0/2 upstream: reported C repro on 2025/03/13 02:24
linux-5.15 KASAN: use-after-free Write in l2tp_session_delete 24 2 847d 935d 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) 24 2 342d 430d 0/3 auto-obsoleted due to no activity on 2025/03/26 11:58
linux-5.15 KASAN: use-after-free Write in l2tp_session_delete (3) 24 1 122d 122d 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 24 C done 1286 497d 516d 27/29 fixed on 2024/08/14 03:44
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/08/13 06:23 13m retest repro android14-6.1 OK log

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+0x27/0x4e0 net/l2tp/l2tp_core.c:1561
Write of size 8 at addr ffff88812d7f1808 by task kworker/u4:12/15476

CPU: 1 PID: 15476 Comm: kworker/u4:12 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Workqueue: l2tp l2tp_tunnel_del_work
Call Trace:
 <TASK>
 __dump_stack+0x21/0x24 lib/dump_stack.c:88
 dump_stack_lvl+0xee/0x150 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+0x280/0x290 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+0x27/0x4e0 net/l2tp/l2tp_core.c:1561
 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1216 [inline]
 l2tp_tunnel_del_work+0x201/0x420 net/l2tp/l2tp_core.c:1256
 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302
 worker_thread+0xa29/0x11f0 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 19063:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:379 [inline]
 __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:388
 kasan_kmalloc include/linux/kasan.h:212 [inline]
 __do_kmalloc_node mm/slab_common.c:938 [inline]
 __kmalloc+0xb1/0x1e0 mm/slab_common.c:951
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 l2tp_session_create+0x38/0xbe0 net/l2tp/l2tp_core.c:1597
 pppol2tp_connect+0xb35/0x1570 net/l2tp/l2tp_ppp.c:781
 __sys_connect_file net/socket.c:2001 [inline]
 __sys_connect+0x398/0x420 net/socket.c:2018
 __do_sys_connect net/socket.c:2028 [inline]
 __se_sys_connect net/socket.c:2025 [inline]
 __x64_sys_connect+0x7a/0x90 net/socket.c:2025
 x64_sys_call+0x88d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:43
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 19075:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x31/0x50 mm/kasan/generic.c:516
 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:241
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249
 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_dec_refcount+0xaf/0x1a0 net/l2tp/l2tp_core.c:205
 pppol2tp_session_destruct+0xb1/0xf0 net/l2tp/l2tp_ppp.c:418
 __sk_destruct+0x64/0x600 net/core/sock.c:2153
 sk_destruct net/core/sock.c:2198 [inline]
 __sk_free+0x313/0x410 net/core/sock.c:2209
 sk_free+0x54/0x90 net/core/sock.c:2220
 sock_put include/net/sock.h:2085 [inline]
 pppol2tp_put_sk+0x7a/0xb0 net/l2tp/l2tp_ppp.c:401
 rcu_do_batch+0x515/0xb90 kernel/rcu/tree.c:2297
 rcu_core+0x5a5/0xe70 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+0xa9/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:45
 __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+0xd4/0xf90 kernel/rcu/tree.c:2926
 pppol2tp_release+0x208/0x2d0 net/l2tp/l2tp_ppp.c:457
 __sock_release net/socket.c:652 [inline]
 sock_close+0xf1/0x290 net/socket.c:1390
 __fput+0x1fc/0x8f0 fs/file_table.c:320
 ____fput+0x15/0x20 fs/file_table.c:348
 task_work_run+0x1db/0x240 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:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

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

The buggy address belongs to the physical page:
page:ffffea0004b5fc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12d7f0
head:ffffea0004b5fc00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 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 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 1864, tgid 1864 (kworker/u4:7), ts 300845462575, free_ts 293527972650
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2643
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2650
 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4554
 __alloc_pages+0x1c3/0x450 mm/page_alloc.c:5868
 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1
 allocate_slab mm/slub.c:1967 [inline]
 new_slab+0x98/0x3d0 mm/slub.c:2020
 ___slab_alloc+0x6bd/0xb20 mm/slub.c:3177
 __slab_alloc+0x5e/0xa0 mm/slub.c:3263
 slab_alloc_node mm/slub.c:3348 [inline]
 __kmem_cache_alloc_node+0x203/0x2c0 mm/slub.c:3423
 __do_kmalloc_node mm/slab_common.c:937 [inline]
 __kmalloc+0xa1/0x1e0 mm/slab_common.c:951
 kmalloc include/linux/slab.h:568 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 fib6_info_alloc+0x34/0xe0 net/ipv6/ip6_fib.c:156
 ip6_route_info_create+0x526/0x1510 net/ipv6/route.c:3797
 ip6_route_add+0x27/0x130 net/ipv6/route.c:3893
 addrconf_prefix_route net/ipv6/addrconf.c:2466 [inline]
 addrconf_add_linklocal+0x3d4/0x620 net/ipv6/addrconf.c:3285
 addrconf_addr_gen+0x48e/0x5a0 net/ipv6/addrconf.c:3414
 addrconf_init_auto_addrs+0x84b/0xb80 net/ipv6/addrconf.c:-1
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1551 [inline]
 free_pcp_prepare mm/page_alloc.c:1625 [inline]
 free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3589
 free_unref_page+0x8f/0x530 mm/page_alloc.c:3687
 free_the_page mm/page_alloc.c:836 [inline]
 __free_pages+0x67/0x100 mm/page_alloc.c:5957
 __vunmap+0x9af/0xb70 mm/vmalloc.c:2739
 __vfree mm/vmalloc.c:2788 [inline]
 vfree+0x61/0x90 mm/vmalloc.c:2819
 kcov_put kernel/kcov.c:437 [inline]
 kcov_close+0x2b/0x50 kernel/kcov.c:533
 __fput+0x1fc/0x8f0 fs/file_table.c:320
 ____fput+0x15/0x20 fs/file_table.c:348
 task_work_run+0x1db/0x240 kernel/task_work.c:203
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0xa25/0x2650 kernel/exit.c:886
 do_group_exit+0x210/0x2d0 kernel/exit.c:1028
 get_signal+0x13b5/0x1520 kernel/signal.c:2889
 arch_do_signal_or_restart+0xb0/0x1030 arch/x86/kernel/signal.c:871
 exit_to_user_mode_loop+0x7a/0xb0 kernel/entry/common.c:174
 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

Memory state around the buggy address:
 ffff88812d7f1700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88812d7f1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88812d7f1800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88812d7f1880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88812d7f1900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/16 16:28 android14-6.1 f090d4b083a9 f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/10/16 18:05 android14-6.1 24be8a7dde14 19568248 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/08/31 08:02 android14-6.1 02ca81000485 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/08/30 02:28 android14-6.1 376207d1f3e2 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/08/30 01:41 android14-6.1 376207d1f3e2 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/08/23 04:24 android14-6.1 397bc5b3eca0 bf27483f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/07/08 01:08 android14-6.1 fa7e0538663e 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/06/03 16:14 android14-6.1 5b87067cdd87 a30356b7 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/06/01 06:29 android14-6.1 db710ea87c32 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/05/30 00:31 android14-6.1 db710ea87c32 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/05/10 11:27 android14-6.1 646380b087a5 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/05/08 09:47 android14-6.1 646380b087a5 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/02/28 22:01 android14-6.1 6b227a1f7460 67cf5345 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/02/17 08:33 android14-6.1 ccc915784332 40a34ec9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2025/02/03 07:07 android14-6.1 2055772eada0 568559e4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2024/11/21 23:48 android14-6.1 51bee181735e 4b25d554 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2024/11/11 00:55 android14-6.1 eef3d33656ce 6b856513 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2024/10/15 00:26 android14-6.1 4d8187d2c8fa b01b6661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2024/10/09 19:14 android14-6.1 80e851bf0d46 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 KASAN: use-after-free Write in l2tp_session_delete
2024/10/08 10:14 android14-6.1 0e8b65e41ffd 402f1df0 .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.