syzbot


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

Status: premoderation: reported on 2026/05/14 22:38
Reported-by: syzbot+09e262e757f03d241023@syzkaller.appspotmail.com
First crash: 30d, last: 5d19h
Similar bugs (13)
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 600d 624d 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 400d 500d 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 156d 272d 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 113d 113d 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 145d 145d 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 632d 654d 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 717d 730d 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 26 26d 458d 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 1049d 1138d 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 545d 632d 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 22 syz error 20 210d 614d 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 324d 324d 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 699d 719d 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 ffff88811f046c08 by task kworker/u4:5/813

CPU: 0 PID: 813 Comm: kworker/u4:5 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:
 __dump_stack+0x21/0x24 lib/dump_stack.c:77
 dump_stack_lvl+0x1a7/0x208 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+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: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+0x17e/0x3d0 net/l2tp/l2tp_core.c:1256
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13c0 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 3740:
 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+0x1a4/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+0xb91/0x15b0 net/l2tp/l2tp_ppp.c:772
 __sys_connect_file net/socket.c:1866 [inline]
 __sys_connect+0x3ce/0x450 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 3744:
 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:408
 __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:1907 [inline]
 pppol2tp_put_sk+0x7a/0xb0 net/l2tp/l2tp_ppp.c:391
 rcu_do_batch+0x4ef/0xab0 kernel/rcu/tree.c:2494
 rcu_core+0x577/0xd80 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+0x11a/0x10b0 kernel/rcu/tree.c:3054
 pppol2tp_release+0x208/0x2d0 net/l2tp/l2tp_ppp.c:447
 __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

The buggy address belongs to the object at ffff88811f046c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 8 bytes inside of
 512-byte region [ffff88811f046c00, ffff88811f046e00)
The buggy address belongs to the page:
page:ffffea00047c1100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f044
head:ffffea00047c1100 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 dead000000000100 dead000000000122 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 3740, ts 149284053161, free_ts 149226647370
 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+0x223b/0x23d0 mm/page_alloc.c:4254
 __alloc_pages_nodemask+0x290/0x620 mm/page_alloc.c:5384
 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]
 __kmalloc+0x1fe/0x330 mm/slub.c:4034
 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+0xb91/0x15b0 net/l2tp/l2tp_ppp.c:772
 __sys_connect_file net/socket.c:1866 [inline]
 __sys_connect+0x3ce/0x450 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
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+0x80b/0x830 mm/page_alloc.c:1629
 free_the_page mm/page_alloc.c:5445 [inline]
 __free_pages+0xd8/0x3b0 mm/page_alloc.c:5454
 kfree+0x1e4/0x270 mm/slub.c:4193
 kvfree+0x35/0x40 mm/util.c:647
 bpf_check+0x8369/0xdb10 kernel/bpf/verifier.c:12789
 bpf_prog_load+0xfca/0x14a0 kernel/bpf/syscall.c:2234
 __do_sys_bpf kernel/bpf/syscall.c:4435 [inline]
 __se_sys_bpf+0x49a/0x740 kernel/bpf/syscall.c:4391
 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:4391
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Memory state around the buggy address:
 ffff88811f046b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88811f046b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811f046c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff88811f046c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811f046d00: 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: 813 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:

CPU: 1 PID: 813 Comm: kworker/u4:5 Tainted: G    B             syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Workqueue: l2tp l2tp_tunnel_del_work
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 04 01 48 c7 c7 20 76 40 85 e8 cc 96 3b 02 0f 0b eb c3 e8 b3 3b 26 ff c6 05 c2 1d 82 04 01 48 c7 c7 80 76 40 85 e8 b0 96 3b 02 <0f> 0b eb a7 e8 97 3b 26 ff c6 05 a3 1d 82 04 01 48 c7 c7 a0 75 40
RSP: 0018:ffffc90000d97c58 EFLAGS: 00010246
RAX: 29e19ad9709ec500 RBX: 0000000000000003 RCX: ffff888110cb93c0
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc90000d97c68 R08: ffff8881f7152fbf R09: 1ffff1103ee2a5f7
R10: dffffc0000000000 R11: ffffed103ee2a5f8 R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000003 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007faa9fcb42f8 CR3: 000000013877b000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __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_dec_refcount+0xcb/0x1a0 net/l2tp/l2tp_core.c:204
 l2tp_session_delete+0x3ab/0x4a0 net/l2tp/l2tp_core.c:1572
 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1218 [inline]
 l2tp_tunnel_del_work+0x17e/0x3d0 net/l2tp/l2tp_core.c:1256
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13c0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
---[ end trace 4932e91afa83ba2b ]---

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/06/08 23:58 android13-5.10-lts 4a079a5d30eb 656e94c6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Write in l2tp_session_delete
2026/05/14 22:37 android13-5.10-lts 1b32327554da 6ccb967e .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.