syzbot
KASAN: use-after-free Read in l2tp_tunnel_get_session
Status:
premoderation: reported on 2026/07/23 21:14
Reported-by: syzbot+a15cb6458385a5d7a36b@syzkaller.appspotmail.com
First crash: 59d, last: 1d15h
Sample crash report:
==================================================================
BUG: KASAN: use-after-free in l2tp_tunnel_get_session+0xd2/0x170 net/l2tp/l2tp_core.c:270
Read of size 4 at addr ffff888130561c18 by task syz.1.1933/8297
CPU: 1 PID: 8297 Comm: syz.1.1933 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
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
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350
l2tp_tunnel_get_session+0xd2/0x170 net/l2tp/l2tp_core.c:270
pppol2tp_connect+0xb3c/0x1640 net/l2tp/l2tp_ppp.c:746
__sys_connect_file net/socket.c:2001 [inline]
__sys_connect+0x3da/0x460 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:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1d06f9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1d07dab028 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007f1d07225fa0 RCX: 00007f1d06f9e159
RDX: 000000000000002e RSI: 0000200000000000 RDI: 000000000000000b
RBP: 00007f1d0703506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1d07226038 R14: 00007f1d07225fa0 R15: 00007ffd16c1fc98
</TASK>
Allocated by task 8297:
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:1614
pppol2tp_connect+0xbf5/0x1640 net/l2tp/l2tp_ppp.c:771
__sys_connect_file net/socket.c:2001 [inline]
__sys_connect+0x3da/0x460 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:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
Freed by task 8297:
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_ioctl+0x748/0x960 net/l2tp/l2tp_ppp.c:-1
pppox_ioctl+0x1f6/0x330 drivers/net/ppp/pppox.c:93
sock_do_ioctl+0x114/0x330 net/socket.c:1192
sock_ioctl+0x475/0x700 net/socket.c:1311
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0x12f/0x1b0 fs/ioctl.c:856
__x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:856
x64_sys_call+0x58b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17
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
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
fib6_info_release include/net/ip6_fib.h:350 [inline]
ip6_route_info_create+0xaa8/0x14d0 net/ipv6/route.c:3881
ip6_route_add+0x27/0x130 net/ipv6/route.c:3895
addrconf_add_mroute net/ipv6/addrconf.c:2530 [inline]
addrconf_add_dev+0x388/0x4a0 net/ipv6/addrconf.c:2548
inet6_addr_add+0x1a8/0x9c0 net/ipv6/addrconf.c:3007
inet6_rtm_newaddr+0x74a/0xa10 net/ipv6/addrconf.c:4999
rtnetlink_rcv_msg+0xb28/0xde0 net/core/rtnetlink.c:6154
netlink_rcv_skb+0x200/0x450 net/netlink/af_netlink.c:2526
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6172
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x8c1/0xa60 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x8b9/0xbd0 net/netlink/af_netlink.c:1878
sock_sendmsg_nosec net/socket.c:716 [inline]
__sock_sendmsg net/socket.c:728 [inline]
__sys_sendto+0x4ac/0x660 net/socket.c:2143
__do_sys_sendto net/socket.c:2155 [inline]
__se_sys_sendto net/socket.c:2151 [inline]
__x64_sys_sendto+0xe5/0x100 net/socket.c:2151
x64_sys_call+0x83/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45
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
The buggy address belongs to the object at ffff888130561c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 24 bytes inside of
512-byte region [ffff888130561c00, ffff888130561e00)
The buggy address belongs to the physical page:
page:ffffea0004c15800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130560
head:ffffea0004c15800 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 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6, tgid 6 (kworker/0:0), ts 317010900042, free_ts 312660494302
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2673
prep_new_page+0x1c/0x110 mm/page_alloc.c:2680
get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4587
__alloc_pages+0x1fa/0x610 mm/page_alloc.c:5931
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]
nlmsg_new include/net/netlink.h:987 [inline]
inet6_ifa_notify net/ipv6/addrconf.c:5569 [inline]
__ipv6_ifa_notify+0x200/0xe80 net/ipv6/addrconf.c:6227
ipv6_ifa_notify net/ipv6/addrconf.c:6279 [inline]
addrconf_dad_completed+0x192/0xe80 net/ipv6/addrconf.c:4283
addrconf_dad_work+0xc1b/0x14a0 net/ipv6/addrconf.c:-1
process_one_work+0x717/0xc30 kernel/workqueue.c:2302
worker_thread+0xa4d/0x11d0 kernel/workqueue.c:2449
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1581 [inline]
free_pcp_prepare mm/page_alloc.c:1655 [inline]
free_unref_page_prepare+0x81b/0x820 mm/page_alloc.c:3622
free_unref_page+0x93/0x530 mm/page_alloc.c:3720
free_the_page mm/page_alloc.c:863 [inline]
__free_pages+0x67/0x100 mm/page_alloc.c:6021
__vunmap+0xa3c/0xc00 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+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
exit_task_work include/linux/task_work.h:39 [inline]
do_exit+0xb0d/0x29f0 kernel/exit.c:896
do_group_exit+0x21b/0x2e0 kernel/exit.c:1040
__do_sys_exit_group kernel/exit.c:1051 [inline]
__se_sys_exit_group kernel/exit.c:1049 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1049
x64_sys_call+0x7b4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232
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
Memory state around the buggy address:
ffff888130561b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888130561b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888130561c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888130561c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888130561d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 8297 at lib/refcount.c:25 refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25
Modules linked in:
CPU: 1 PID: 8297 Comm: syz.1.1933 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:refcount_warn_saturate+0x104/0x1a0 lib/refcount.c:25
Code: 05 01 48 c7 c7 80 12 ca 85 e8 58 c8 d8 fe 0f 0b eb df e8 8f 42 08 ff c6 05 9f 81 26 05 01 48 c7 c7 c0 11 ca 85 e8 3c c8 d8 fe <0f> 0b eb c3 e8 73 42 08 ff c6 05 84 81 26 05 01 48 c7 c7 20 12 ca
RSP: 0018:ffffc9000b7f7ba8 EFLAGS: 00010246
RAX: 886bc071c4c3ac00 RBX: 0000000000000002 RCX: 0000000000080000
RDX: ffffc90004606000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc9000b7f7bb8 R08: ffffc9000b7f78a7 R09: 1ffff920016fef14
R10: dffffc0000000000 R11: fffff520016fef15 R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000002 R15: ffff888130561c88
FS: 00007f1d07dab6c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c33022c CR3: 00000001496f3000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
<TASK>
__refcount_add include/linux/refcount.h:-1 [inline]
__refcount_inc include/linux/refcount.h:250 [inline]
refcount_inc include/linux/refcount.h:267 [inline]
l2tp_session_inc_refcount net/l2tp/l2tp_core.c:211 [inline]
l2tp_tunnel_get_session+0x16b/0x170 net/l2tp/l2tp_core.c:271
pppol2tp_connect+0xb3c/0x1640 net/l2tp/l2tp_ppp.c:746
__sys_connect_file net/socket.c:2001 [inline]
__sys_connect+0x3da/0x460 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:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1d06f9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1d07dab028 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007f1d07225fa0 RCX: 00007f1d06f9e159
RDX: 000000000000002e RSI: 0000200000000000 RDI: 000000000000000b
RBP: 00007f1d0703506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1d07226038 R14: 00007f1d07225fa0 R15: 00007ffd16c1fc98
</TASK>
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
refcount_t: underflow; use-after-free.
WARNING: CPU: 1 PID: 8297 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 1 PID: 8297 Comm: syz.1.1933 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 05 01 48 c7 c7 c0 11 ca 85 e8 3c c8 d8 fe 0f 0b eb c3 e8 73 42 08 ff c6 05 84 81 26 05 01 48 c7 c7 20 12 ca 85 e8 20 c8 d8 fe <0f> 0b eb a7 e8 57 42 08 ff c6 05 65 81 26 05 01 48 c7 c7 60 11 ca
RSP: 0018:ffffc9000b7f7bb8 EFLAGS: 00010246
RAX: 886bc071c4c3ac00 RBX: 0000000000000003 RCX: 0000000000080000
RDX: ffffc90004606000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc9000b7f7bc8 R08: ffff8881f6f2759b R09: 1ffff1103ede4eb3
R10: dffffc0000000000 R11: ffffed103ede4eb4 R12: ffff888130563400
R13: 1ffff920016fef8c R14: 0000000000000003 R15: 00000000c0000000
FS: 00007f1d07dab6c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c33022c CR3: 00000001496f3000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
<TASK>
__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_put+0xc8/0x1a0 net/l2tp/l2tp_core.c:192
pppol2tp_connect+0xa33/0x1640 net/l2tp/l2tp_ppp.c:842
__sys_connect_file net/socket.c:2001 [inline]
__sys_connect+0x3da/0x460 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:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1d06f9e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1d07dab028 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007f1d07225fa0 RCX: 00007f1d06f9e159
RDX: 000000000000002e RSI: 0000200000000000 RDI: 000000000000000b
RBP: 00007f1d0703506b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1d07226038 R14: 00007f1d07225fa0 R15: 00007ffd16c1fc98
</TASK>
---[ end trace 0000000000000000 ]---
* Struck through repros no longer work on HEAD.