syzbot


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

Status: premoderation: reported on 2025/09/15 04:31
Reported-by: syzbot+88b7cb1ae4dd83641bba@syzkaller.appspotmail.com
First crash: 100d, last: 10d
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 428d 452d 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 228d 328d 0/2 auto-obsoleted due to no activity on 2025/08/08 12:20
linux-6.1 KASAN: use-after-free Write in l2tp_session_delete 24 2 460d 482d 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 545d 558d 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 21 2d05h 286d 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 877d 966d 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 373d 460d 0/3 auto-obsoleted due to no activity on 2025/03/26 11:58
android-6-1 KASAN: use-after-free Write in l2tp_session_delete origin:downstream 24 syz 20 37d 442d 0/2 premoderation: reported syz repro on 2024/10/08 10:15
linux-5.15 KASAN: use-after-free Write in l2tp_session_delete (3) 24 1 152d 152d 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 527d 547d 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:101 [inline]
BUG: KASAN: use-after-free in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:70 [inline]
BUG: KASAN: use-after-free in l2tp_session_delete+0x24/0x4a0 net/l2tp/l2tp_core.c:1563
Write of size 8 at addr ffff888117656c08 by task kworker/u4:5/829

CPU: 1 PID: 829 Comm: kworker/u4:5 Tainted: G        W         syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: l2tp l2tp_tunnel_del_work
Call Trace:
 __dump_stack+0x21/0x24 lib/dump_stack.c:77
 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:435 [inline]
 kasan_report+0xe2/0x130 mm/kasan/report.c:452
 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:101 [inline]
 test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:70 [inline]
 l2tp_session_delete+0x24/0x4a0 net/l2tp/l2tp_core.c:1563
 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1218 [inline]
 l2tp_tunnel_del_work+0x1d2/0x3e0 net/l2tp/l2tp_core.c:1258
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

Allocated by task 15399:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:430 [inline]
 ____kasan_kmalloc mm/kasan/common.c:509 [inline]
 __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518
 kasan_kmalloc include/linux/kasan.h:254 [inline]
 __kmalloc+0x1a7/0x330 mm/slub.c:4038
 kmalloc include/linux/slab.h:560 [inline]
 kzalloc include/linux/slab.h:667 [inline]
 l2tp_session_create+0x39/0xb60 net/l2tp/l2tp_core.c:1599
 pppol2tp_connect+0xb35/0x1570 net/l2tp/l2tp_ppp.c:782
 __sys_connect_file net/socket.c:1866 [inline]
 __sys_connect+0x38c/0x410 net/socket.c:1883
 __do_sys_connect net/socket.c:1893 [inline]
 __se_sys_connect net/socket.c:1890 [inline]
 __x64_sys_connect+0x7a/0x90 net/socket.c:1890
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Freed by task 15409:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370
 kasan_slab_free include/linux/kasan.h:220 [inline]
 slab_free_hook mm/slub.c:1600 [inline]
 slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626
 slab_free mm/slub.c:3208 [inline]
 kfree+0xc0/0x270 mm/slub.c:4196
 l2tp_session_free net/l2tp/l2tp_core.c:168 [inline]
 l2tp_session_dec_refcount+0xb2/0x1a0 net/l2tp/l2tp_core.c:205
 pppol2tp_session_destruct+0xb1/0xf0 net/l2tp/l2tp_ppp.c:419
 __sk_destruct+0x53/0x600 net/core/sock.c:1818
 sk_destruct net/core/sock.c:1863 [inline]
 __sk_free+0x313/0x410 net/core/sock.c:1874
 sk_free+0x54/0x90 net/core/sock.c:1885
 sock_put include/net/sock.h:1894 [inline]
 pppol2tp_put_sk+0x7a/0xb0 net/l2tp/l2tp_ppp.c:402
 rcu_do_batch+0x4df/0xa80 kernel/rcu/tree.c:2494
 rcu_core+0x55f/0xd60 kernel/rcu/tree.c:2735
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2748
 __do_softirq+0x255/0x563 kernel/softirq.c:309

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 __call_rcu kernel/rcu/tree.c:2980 [inline]
 call_rcu+0x10e/0x1050 kernel/rcu/tree.c:3054
 pppol2tp_release+0x208/0x2d0 net/l2tp/l2tp_ppp.c:458
 __sock_release net/socket.c:597 [inline]
 sock_close+0xe0/0x270 net/socket.c:1286
 __fput+0x2fb/0x770 fs/file_table.c:281
 ____fput+0x15/0x20 fs/file_table.c:314
 task_work_run+0x127/0x190 kernel/task_work.c:189
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_user_mode_loop+0xcb/0xe0 kernel/entry/common.c:172
 exit_to_user_mode_prepare+0x76/0xa0 kernel/entry/common.c:199
 syscall_exit_to_user_mode+0x1d/0x40 kernel/entry/common.c:274
 do_syscall_64+0x3d/0x40 arch/x86/entry/common.c:56
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348
 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358
 kvfree_call_rcu+0x10c/0x620 kernel/rcu/tree.c:3539
 drop_sysctl_table+0x2ef/0x410 fs/proc/proc_sysctl.c:1684
 drop_sysctl_table+0x2de/0x410 fs/proc/proc_sysctl.c:1687
 unregister_sysctl_table+0x75/0x120 fs/proc/proc_sysctl.c:1722
 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:127
 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7091 [inline]
 addrconf_sysctl_unregister net/ipv6/addrconf.c:7119 [inline]
 addrconf_ifdown+0x1507/0x1800 net/ipv6/addrconf.c:3940
 addrconf_notify+0x3bd/0xe90 net/ipv6/addrconf.c:-1
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:410
 call_netdevice_notifiers_info net/core/dev.c:2054 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2066 [inline]
 call_netdevice_notifiers net/core/dev.c:2080 [inline]
 unregister_netdevice_many+0xf8b/0x1980 net/core/dev.c:10767
 default_device_exit_batch+0x330/0x390 net/core/dev.c:11287
 ops_exit_list net/core/net_namespace.c:190 [inline]
 cleanup_net+0x5fb/0xb70 net/core/net_namespace.c:609
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

The buggy address belongs to the object at ffff888117656c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 8 bytes inside of
 512-byte region [ffff888117656c00, ffff888117656e00)
The buggy address belongs to the page:
page:ffffea00045d9500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x117654
head:ffffea00045d9500 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000100000001 ffff888100043080
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 11200, ts 382351822343, free_ts 382295691043
 set_page_owner include/linux/page_owner.h:35 [inline]
 post_alloc_hook mm/page_alloc.c:2456 [inline]
 prep_new_page+0x179/0x180 mm/page_alloc.c:2462
 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254
 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5370
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1813 [inline]
 new_slab+0x84/0x3f0 mm/slub.c:1874
 new_slab_objects mm/slub.c:2632 [inline]
 ___slab_alloc+0x2a6/0x450 mm/slub.c:2796
 __slab_alloc+0x63/0xa0 mm/slub.c:2836
 slab_alloc_node mm/slub.c:2918 [inline]
 slab_alloc mm/slub.c:2960 [inline]
 kmem_cache_alloc_trace+0x1b3/0x2e0 mm/slub.c:2977
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:667 [inline]
 fqdir_init+0x59/0x180 net/ipv4/inet_fragment.c:169
 ipv4_frags_init_net+0x2f/0x2f0 net/ipv4/ip_fragment.c:656
 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:144
 setup_net+0x36d/0xb50 net/core/net_namespace.c:345
 copy_net_ns+0x314/0x520 net/core/net_namespace.c:486
 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110
 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:179
 copy_process+0x11b8/0x32c0 kernel/fork.c:2271
 kernel_clone+0x23f/0x940 kernel/fork.c:2650
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1349 [inline]
 __free_pages_ok+0x7fc/0x820 mm/page_alloc.c:1629
 free_the_page mm/page_alloc.c:5431 [inline]
 __free_pages+0xdd/0x380 mm/page_alloc.c:5440
 __free_slab+0xcf/0x190 mm/slub.c:1899
 free_slab mm/slub.c:1914 [inline]
 discard_slab mm/slub.c:1920 [inline]
 unfreeze_partials+0x15f/0x190 mm/slub.c:2415
 put_cpu_partial+0xc1/0x180 mm/slub.c:2451
 __slab_free+0x2c9/0x3a0 mm/slub.c:3100
 do_slab_free mm/slub.c:3196 [inline]
 ___cache_free+0x111/0x130 mm/slub.c:3215
 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157
 qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x14a/0x160 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xf0 mm/kasan/common.c:440
 kasan_slab_alloc include/linux/kasan.h:244 [inline]
 slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:580
 slab_alloc_node mm/slub.c:2952 [inline]
 slab_alloc mm/slub.c:2960 [inline]
 kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2965
 sock_alloc_inode+0x1b/0xb0 net/socket.c:253
 alloc_inode fs/inode.c:233 [inline]
 new_inode_pseudo+0x62/0x210 fs/inode.c:968
 sock_alloc net/socket.c:574 [inline]
 __sock_create+0x12c/0x770 net/socket.c:1400

Memory state around the buggy address:
 ffff888117656b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888117656b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888117656c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888117656c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888117656d00: 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
2025/12/14 04:01 android13-5.10-lts 9286af17ed5f d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Write in l2tp_session_delete
2025/12/08 03:57 android13-5.10-lts 9286af17ed5f d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Write in l2tp_session_delete
2025/10/28 07:03 android13-5.10-lts 2ece552169c2 fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Write in l2tp_session_delete
2025/09/15 04:30 android13-5.10-lts 911f602c2237 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Write in l2tp_session_delete
* Struck through repros no longer work on HEAD.