==================================================================
BUG: KASAN: use-after-free in hlist_unhashed include/linux/list.h:854 [inline]
BUG: KASAN: use-after-free in hlist_del_init_rcu include/linux/rculist.h:183 [inline]
BUG: KASAN: use-after-free in l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1230 [inline]
BUG: KASAN: use-after-free in l2tp_tunnel_del_work+0xd8/0x410 net/l2tp/l2tp_core.c:1271
Read of size 8 at addr ffff888128260480 by task kworker/u4:1/10
CPU: 1 PID: 10 Comm: kworker/u4:1 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Workqueue: l2tp l2tp_tunnel_del_work
Call Trace:
__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_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351
hlist_unhashed include/linux/list.h:854 [inline]
hlist_del_init_rcu include/linux/rculist.h:183 [inline]
l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1230 [inline]
l2tp_tunnel_del_work+0xd8/0x410 net/l2tp/l2tp_core.c:1271
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
Allocated by task 6273:
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 6272:
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
insert_work+0x51/0x300 kernel/workqueue.c:1368
__queue_work+0x9d0/0xd50 kernel/workqueue.c:1527
queue_work_on+0xde/0x150 kernel/workqueue.c:1555
queue_work include/linux/workqueue.h:510 [inline]
__bpf_map_put kernel/bpf/syscall.c:661 [inline]
bpf_map_put+0x1cf/0x240 kernel/bpf/syscall.c:667
bpf_map_put_with_uref kernel/bpf/syscall.c:674 [inline]
bpf_map_release+0x134/0x150 kernel/bpf/syscall.c:684
__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
Second to 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]
fib6_del_route net/ipv6/ip6_fib.c:2004 [inline]
fib6_del+0xbda/0xef0 net/ipv6/ip6_fib.c:2037
fib6_clean_node+0x2af/0x550 net/ipv6/ip6_fib.c:2199
fib6_walk_continue+0x55d/0x760 net/ipv6/ip6_fib.c:2121
fib6_walk+0x153/0x290 net/ipv6/ip6_fib.c:2169
fib6_clean_tree net/ipv6/ip6_fib.c:2249 [inline]
__fib6_clean_all net/ipv6/ip6_fib.c:2265 [inline]
fib6_clean_all+0x1a1/0x270 net/ipv6/ip6_fib.c:2276
rt6_sync_down_dev net/ipv6/route.c:4926 [inline]
rt6_disable_ip+0x123/0x8e0 net/ipv6/route.c:4931
addrconf_ifdown+0x15d/0x1950 net/ipv6/addrconf.c:3824
addrconf_notify+0x39f/0xe30 net/ipv6/addrconf.c:-1
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xa1/0x110 kernel/notifier.c:455
call_netdevice_notifiers_info net/core/dev.c:2022 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2060 [inline]
call_netdevice_notifiers net/core/dev.c:2074 [inline]
__dev_notify_flags+0x276/0x5b0 net/core/dev.c:8733
dev_change_flags+0xe3/0x1a0 net/core/dev.c:8769
do_setlink+0xc02/0x2a10 net/core/rtnetlink.c:2845
rtnl_group_changelink net/core/rtnetlink.c:3373 [inline]
__rtnl_newlink net/core/rtnetlink.c:3630 [inline]
rtnl_newlink+0x10b3/0x20d0 net/core/rtnetlink.c:3667
rtnetlink_rcv_msg+0xb28/0xde0 net/core/rtnetlink.c:6162
netlink_rcv_skb+0x200/0x450 net/netlink/af_netlink.c:2526
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6180
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_sendmsg+0x5fb/0x9c0 net/socket.c:2509
___sys_sendmsg+0x2a2/0x360 net/socket.c:2563
__sys_sendmsg net/socket.c:2592 [inline]
__do_sys_sendmsg net/socket.c:2601 [inline]
__se_sys_sendmsg net/socket.c:2599 [inline]
__x64_sys_sendmsg+0x20d/0x2e0 net/socket.c:2599
x64_sys_call+0x171/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
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 ffff888128260400
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 128 bytes inside of
512-byte region [ffff888128260400, ffff888128260600)
The buggy address belongs to the physical page:
page:ffffea0004a09800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x128260
head:ffffea0004a09800 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00
raw: 0000000000000000 0000000080100010 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 5065, tgid 5064 (syz.5.1215), ts 495445550257, free_ts 495428135704
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]
alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6189
sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2770
unix_dgram_sendmsg+0x5c1/0x1710 net/unix/af_unix.c:1959
sock_sendmsg_nosec net/socket.c:716 [inline]
__sock_sendmsg net/socket.c:728 [inline]
____sys_sendmsg+0x5fb/0x9c0 net/socket.c:2509
___sys_sendmsg+0x2a2/0x360 net/socket.c:2563
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
free_large_kmalloc+0xae/0xf0 mm/slab_common.c:915
kfree+0x8b/0xf0 mm/slab_common.c:984
kvfree+0x35/0x40 mm/util.c:639
netdev_freemem+0x3f/0x60 net/core/dev.c:10701
netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1904
device_release+0xa4/0x1d0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:681 [inline]
kobject_release lib/kobject.c:712 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x19d/0x280 lib/kobject.c:729
netdev_run_todo+0xb48/0xc30 net/core/dev.c:10521
rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:147
tun_detach drivers/net/tun.c:704 [inline]
tun_chr_close+0xc4/0x140 drivers/net/tun.c:3495
__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
Memory state around the buggy address:
ffff888128260380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888128260400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888128260480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888128260500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888128260580: 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: 0 PID: 10 at lib/refcount.c:28 refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Modules linked in:
CPU: 0 PID: 10 Comm: kworker/u4:1 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Workqueue: l2tp l2tp_tunnel_del_work
RIP: 0010:refcount_warn_saturate+0x120/0x1a0 lib/refcount.c:28
Code: 05 01 48 c7 c7 00 18 ca 85 e8 dc 78 d8 fe 0f 0b eb c3 e8 13 f9 07 ff c6 05 25 34 26 05 01 48 c7 c7 60 18 ca 85 e8 c0 78 d8 fe <0f> 0b eb a7 e8 f7 f8 07 ff c6 05 06 34 26 05 01 48 c7 c7 a0 17 ca
RSP: 0018:ffffc900000a7c38 EFLAGS: 00010246
RAX: 4cd823ba1249c300 RBX: 0000000000000003 RCX: ffff88810029d100
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000002
RBP: ffffc900000a7c48 R08: ffffc900000a7947 R09: 1ffff92000014f28
R10: dffffc0000000000 R11: fffff52000014f29 R12: 1ffff1102504c090
R13: dffffc0000000000 R14: 0000000000000003 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000001400 CR3: 000000011557d000 CR4: 00000000003506b0
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_put+0xc8/0x1a0 net/l2tp/l2tp_core.c:192
l2tp_session_delete+0x3df/0x4d0 net/l2tp/l2tp_core.c:1587
l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1233 [inline]
l2tp_tunnel_del_work+0x199/0x410 net/l2tp/l2tp_core.c:1271
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
---[ end trace 0000000000000000 ]---