[v6.1] KASAN: use-after-free Write in l2tp_session_delete (2)

0 views
Skip to first unread message

syzbot

unread,
Jan 19, 2026, 3:49:22 PM (23 hours ago) Jan 19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cd9b81672742 Linux 6.1.161
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1163d3fa580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e608db5e3125a45d
dashboard link: https://syzkaller.appspot.com/bug?extid=0a32c3c38f5558c5e534
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/48e3a4ac56fe/disk-cd9b8167.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b349f08c63b3/vmlinux-cd9b8167.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7eaf532578c7/bzImage-cd9b8167.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0a32c3...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
BUG: KASAN: use-after-free in test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
BUG: KASAN: use-after-free in l2tp_session_delete+0x21/0x5b0 net/l2tp/l2tp_core.c:1561
Write of size 8 at addr ffff888028b1d008 by task kworker/u4:8/4460

CPU: 1 PID: 4460 Comm: kworker/u4:8 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: l2tp l2tp_tunnel_del_work
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x235/0x290 mm/kasan/generic.c:189
instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
test_and_set_bit include/asm-generic/bitops/instrumented-atomic.h:71 [inline]
l2tp_session_delete+0x21/0x5b0 net/l2tp/l2tp_core.c:1561
l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1216 [inline]
l2tp_tunnel_del_work+0x203/0x3e0 net/l2tp/l2tp_core.c:1256
process_one_work+0x8a2/0x1160 kernel/workqueue.c:2292
worker_thread+0xaa2/0x1270 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
</TASK>

Allocated by task 5462:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:936 [inline]
__kmalloc+0xb0/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
l2tp_session_create+0x37/0xaf0 net/l2tp/l2tp_core.c:1597
pppol2tp_connect+0xb95/0x15e0 net/l2tp/l2tp_ppp.c:781
__sys_connect_file net/socket.c:2010 [inline]
__sys_connect+0x3cb/0x450 net/socket.c:2027
__do_sys_connect net/socket.c:2037 [inline]
__se_sys_connect net/socket.c:2034 [inline]
__x64_sys_connect+0x76/0x80 net/socket.c:2034
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 5461:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
__sk_destruct+0x50/0x650 net/core/sock.c:2147
rcu_do_batch kernel/rcu/tree.c:2297 [inline]
rcu_core+0xa99/0x1740 kernel/rcu/tree.c:2557
handle_softirqs+0x2a1/0x930 kernel/softirq.c:596
__do_softirq kernel/softirq.c:630 [inline]
invoke_softirq kernel/softirq.c:470 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:679
irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691

Last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:46
__kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
call_rcu+0x14f/0x990 kernel/rcu/tree.c:2849
pppol2tp_release+0x23c/0x330 net/l2tp/l2tp_ppp.c:457
__sock_release net/socket.c:654 [inline]
sock_close+0xd5/0x240 net/socket.c:1399
__fput+0x22c/0x920 fs/file_table.c:320
task_work_run+0x1d0/0x260 kernel/task_work.c:203
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888028b1d000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 8 bytes inside of
1024-byte region [ffff888028b1d000, ffff888028b1d400)

The buggy address belongs to the physical page:
page:ffffea0000a2c600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28b18
head:ffffea0000a2c600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888017441dc0
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4273, tgid 4273 (syz-executor), ts 63511960537, free_ts 63488366201
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a1e/0x1ab0 mm/page_alloc.c:4328
__alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5614
alloc_slab_page+0x5d/0x160 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1997
___slab_alloc+0xbc6/0x1240 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node_track_caller+0x9e/0x230 mm/slab_common.c:956
kmalloc_reserve net/core/skbuff.c:446 [inline]
__alloc_skb+0x22a/0x7e0 net/core/skbuff.c:515
alloc_skb include/linux/skbuff.h:1271 [inline]
nlmsg_new include/net/netlink.h:991 [inline]
rtmsg_fib+0xe7/0x4b0 net/ipv4/fib_semantics.c:522
fib_table_insert+0xd7b/0x1b20 net/ipv4/fib_trie.c:1385
fib_magic+0x2e1/0x3c0 net/ipv4/fib_frontend.c:1118
fib_add_ifaddr+0x140/0x5e0 net/ipv4/fib_frontend.c:1140
fib_inetaddr_event+0x13c/0x1c0 net/ipv4/fib_frontend.c:1454
notifier_call_chain kernel/notifier.c:87 [inline]
blocking_notifier_call_chain+0x103/0x1b0 kernel/notifier.c:382
__inet_insert_ifa+0x9b8/0xb80 net/ipv4/devinet.c:568
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:306
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3359 [inline]
__kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node+0xa0/0x240 mm/slab_common.c:943
kmalloc_node include/linux/slab.h:589 [inline]
kvmalloc_node+0x6c/0x180 mm/util.c:581
kvmalloc include/linux/slab.h:716 [inline]
seq_buf_alloc fs/seq_file.c:38 [inline]
seq_read_iter+0x1f6/0xd50 fs/seq_file.c:210
proc_reg_read_iter+0x1a9/0x270 fs/proc/inode.c:305
call_read_iter include/linux/fs.h:2259 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x4a7/0xa00 fs/read_write.c:470
ksys_read+0x14c/0x250 fs/read_write.c:613
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:
ffff888028b1cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888028b1cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888028b1d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888028b1d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888028b1d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages