==================================================================
BUG: KASAN: use-after-free in pppol2tp_sock_to_session+0x1a0/0x1b0 net/l2tp/l2tp_ppp.c:156
Read of size 4 at addr ffff888128f23000 by task syz.4.5161/17402
CPU: 0 PID: 17402 Comm: syz.4.5161 Tainted: G W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
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_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350
pppol2tp_sock_to_session+0x1a0/0x1b0 net/l2tp/l2tp_ppp.c:156
pppol2tp_release+0x150/0x2b0 net/l2tp/l2tp_ppp.c:434
__sock_release net/socket.c:652 [inline]
sock_close+0xc9/0x220 net/socket.c:1390
__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
get_signal+0x167c/0x1700 kernel/signal.c:2904
arch_do_signal_or_restart+0xd1/0x11c0 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
irqentry_exit_to_user_mode+0x9/0x10 kernel/entry/common.c:316
irqentry_exit+0x12/0x40 kernel/entry/common.c:419
exc_page_fault+0x5e/0xb0 arch/x86/mm/fault.c:1520
asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:608
RIP: 0033:0x7f163f5a94e1
Code: Unable to access opcode bytes at 0x7f163f5a94b7.
RSP: 002b:ffffffffffffff30 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f163f825fa0 RCX: 00007f163f5a94d9
RDX: 0000000000000000 RSI: ffffffffffffff30 RDI: 00000000950ae480
RBP: 00007f163f63804e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007f163f826038 R14: 00007f163f825fa0 R15: 00007fffe05be628
Allocated by task 17399:
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 6365:
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
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
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_close_many+0x325/0x4d0 net/core/dev.c:1622
unregister_netdevice_many+0x43f/0x1910 net/core/dev.c:10980
default_device_exit_batch+0x951/0x9f0 net/core/dev.c:11519
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x630/0xb10 net/core/net_namespace.c:604
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
The buggy address belongs to the object at ffff888128f23000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 0 bytes inside of
512-byte region [ffff888128f23000, ffff888128f23200)
The buggy address belongs to the physical page:
page:ffffea0004a3c800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x128f20
head:ffffea0004a3c800 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea0004c0a600 dead000000000002 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4325, tgid 4325 (syz-executor), ts 335054840628, free_ts 329241011854
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]
netlink_ack+0x373/0x1160 net/netlink/af_netlink.c:2463
netlink_rcv_skb+0x27e/0x450 net/netlink/af_netlink.c:2532
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
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
htable_put+0x5fb/0x650 net/netfilter/xt_hashlimit.c:432
hashlimit_mt_destroy+0x5c/0x70 net/netfilter/xt_hashlimit.c:977
cleanup_match net/ipv6/netfilter/ip6_tables.c:479 [inline]
cleanup_entry+0x165/0x370 net/ipv6/netfilter/ip6_tables.c:663
translate_table+0x1e17/0x2030 net/ipv6/netfilter/ip6_tables.c:746
do_replace net/ipv6/netfilter/ip6_tables.c:1154 [inline]
do_ip6t_set_ctl+0x9e9/0xe00 net/ipv6/netfilter/ip6_tables.c:1643
nf_setsockopt+0x284/0x2b0 net/netfilter/nf_sockopt.c:101
ipv6_setsockopt+0x170/0x1a0 net/ipv6/ipv6_sockglue.c:1030
tcp_setsockopt+0xeb/0x100 net/ipv4/tcp.c:3860
sock_common_setsockopt+0xb1/0xc0 net/core/sock.c:3723
__sys_setsockopt+0x2ff/0x4e0 net/socket.c:2278
__do_sys_setsockopt net/socket.c:2289 [inline]
__se_sys_setsockopt net/socket.c:2286 [inline]
__x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2286
Memory state around the buggy address:
ffff888128f22f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888128f22f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888128f23000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888128f23080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888128f23100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
------------[ cut here ]------------
WARNING: CPU: 0 PID: 17402 at net/l2tp/l2tp_ppp.c:156 pppol2tp_sock_to_session+0x167/0x1b0 net/l2tp/l2tp_ppp.c:156
Modules linked in:
CPU: 0 PID: 17402 Comm: syz.4.5161 Tainted: G B W syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:pppol2tp_sock_to_session+0x167/0x1b0 net/l2tp/l2tp_ppp.c:156
Code: 5d c3 e8 6c b0 d4 fc be 02 00 00 00 eb 0a e8 60 b0 d4 fc be 01 00 00 00 4c 89 f7 e8 33 b6 cc fd e9 0f ff ff ff e8 49 b0 d4 fc <0f> 0b 48 89 df e8 ff 00 00 00 eb bd e8 38 b0 d4 fc 4c 89 f7 be 03
RSP: 0018:ffffc900018c7770 EFLAGS: 00010293
RAX: ffffffff849cc1d7 RBX: ffff88812c08e000 RCX: ffff88811315a880
RDX: 0000000000000000 RSI: 0000000034948ec0 RDI: 000000000c04eb7d
RBP: ffffc900018c7790 R08: ffffffff87b777e7 R09: 1ffffffff0f6eefc
R10: dffffc0000000000 R11: fffffbfff0f6eefd R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000034948ec0 R15: ffff888128f23000
FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f487cdf0ce0 CR3: 000000010fe32000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
pppol2tp_release+0x150/0x2b0 net/l2tp/l2tp_ppp.c:434
__sock_release net/socket.c:652 [inline]
sock_close+0xc9/0x220 net/socket.c:1390
__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
get_signal+0x167c/0x1700 kernel/signal.c:2904
arch_do_signal_or_restart+0xd1/0x11c0 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
irqentry_exit_to_user_mode+0x9/0x10 kernel/entry/common.c:316
irqentry_exit+0x12/0x40 kernel/entry/common.c:419
exc_page_fault+0x5e/0xb0 arch/x86/mm/fault.c:1520
asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:608
RIP: 0033:0x7f163f5a94e1
Code: Unable to access opcode bytes at 0x7f163f5a94b7.
RSP: 002b:ffffffffffffff30 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f163f825fa0 RCX: 00007f163f5a94d9
RDX: 0000000000000000 RSI: ffffffffffffff30 RDI: 00000000950ae480
RBP: 00007f163f63804e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000
R13: 00007f163f826038 R14: 00007f163f825fa0 R15: 00007fffe05be628
---[ end trace 0000000000000000 ]---