================================================================== 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+0x27/0x4e0 net/l2tp/l2tp_core.c:1561 Write of size 8 at addr ffff88811b970008 by task kworker/u4:0/8 CPU: 0 PID: 8 Comm: kworker/u4:0 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Workqueue: l2tp l2tp_tunnel_del_work Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x210 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:427 kasan_report+0x122/0x150 mm/kasan/report.c:531 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 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+0x27/0x4e0 net/l2tp/l2tp_core.c:1561 l2tp_tunnel_closeall net/l2tp/l2tp_core.c:1216 [inline] l2tp_tunnel_del_work+0x201/0x420 net/l2tp/l2tp_core.c:1256 process_one_work+0x71f/0xc40 kernel/workqueue.c:2302 worker_thread+0xa29/0x11f0 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 23733: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:938 [inline] __kmalloc+0xb1/0x1e0 mm/slab_common.c:951 kmalloc include/linux/slab.h:568 [inline] kzalloc include/linux/slab.h:699 [inline] l2tp_session_create+0x38/0xbe0 net/l2tp/l2tp_core.c:1597 pppol2tp_connect+0xb35/0x1570 net/l2tp/l2tp_ppp.c:781 __sys_connect_file net/socket.c:2001 [inline] __sys_connect+0x398/0x420 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:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 23743: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x31/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1771 slab_free mm/slub.c:3686 [inline] __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3702 kfree+0x6f/0xf0 mm/slab_common.c:990 l2tp_session_free net/l2tp/l2tp_core.c:168 [inline] l2tp_session_dec_refcount+0xaf/0x1a0 net/l2tp/l2tp_core.c:205 pppol2tp_session_destruct+0xb1/0xf0 net/l2tp/l2tp_ppp.c:418 __sk_destruct+0x64/0x600 net/core/sock.c:2148 sk_destruct net/core/sock.c:2193 [inline] __sk_free+0x313/0x410 net/core/sock.c:2204 sk_free+0x54/0x90 net/core/sock.c:2215 sock_put include/net/sock.h:2049 [inline] pppol2tp_put_sk+0x7a/0xb0 net/l2tp/l2tp_ppp.c:401 rcu_do_batch+0x515/0xb90 kernel/rcu/tree.c:2297 rcu_core+0x5a5/0xe70 kernel/rcu/tree.c:2557 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2574 handle_softirqs+0x1d7/0x600 kernel/softirq.c:642 __do_softirq kernel/softirq.c:680 [inline] invoke_softirq kernel/softirq.c:497 [inline] __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:729 irq_exit_rcu+0x9/0x10 kernel/softirq.c:741 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline] sysvec_apic_timer_interrupt+0xa9/0xc0 arch/x86/kernel/apic/apic.c:1118 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:691 Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45 __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+0xd4/0xf90 kernel/rcu/tree.c:2926 pppol2tp_release+0x208/0x2d0 net/l2tp/l2tp_ppp.c:457 __sock_release net/socket.c:652 [inline] sock_close+0xf1/0x290 net/socket.c:1390 __fput+0x1fc/0x8f0 fs/file_table.c:320 ____fput+0x15/0x20 fs/file_table.c:348 task_work_run+0x1db/0x240 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+0x5a/0xa0 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:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Second to last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb6/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 kvfree_call_rcu+0x95/0x7a0 kernel/rcu/tree.c:3445 put_css_set_locked+0x9dc/0xa10 kernel/cgroup/cgroup.c:994 cgroup_migrate_finish+0x155/0x300 kernel/cgroup/cgroup.c:2758 cgroup_attach_task+0x383/0x550 kernel/cgroup/cgroup.c:2959 cgroup_attach_task_all+0x9b/0xe0 kernel/cgroup/cgroup-v1.c:71 kvm_vm_worker_thread+0xd8/0x3c0 virt/kvm/kvm_main.c:6088 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 ffff88811b970000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff88811b970000, ffff88811b970200) The buggy address belongs to the physical page: page:ffffea00046e5c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11b970 head:ffffea00046e5c00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea00042a8200 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 11065, tgid 11065 (syz-executor), ts 730894797915, free_ts 729281045786 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2637 prep_new_page+0x1c/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4544 __alloc_pages+0x1c3/0x450 mm/page_alloc.c:5858 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1962 [inline] new_slab+0x98/0x3d0 mm/slub.c:2015 ___slab_alloc+0x6f6/0xb50 mm/slub.c:3203 __slab_alloc+0x5e/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] __kmem_cache_alloc_node+0x203/0x2c0 mm/slub.c:3462 __do_kmalloc_node mm/slab_common.c:937 [inline] __kmalloc_node+0xa1/0x1e0 mm/slab_common.c:945 kmalloc_node include/linux/slab.h:589 [inline] kzalloc_node include/linux/slab.h:710 [inline] qdisc_alloc+0x79/0x780 net/sched/sch_generic.c:948 qdisc_create_dflt+0x6b/0x3b0 net/sched/sch_generic.c:1006 attach_one_default_qdisc net/sched/sch_generic.c:1169 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2504 [inline] attach_default_qdiscs net/sched/sch_generic.c:1187 [inline] dev_activate+0x2cf/0x1040 net/sched/sch_generic.c:1246 __dev_open+0x3ce/0x4f0 net/core/dev.c:1505 __dev_change_flags+0x21b/0x6b0 net/core/dev.c:8642 dev_change_flags+0x88/0x1a0 net/core/dev.c:8713 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1545 [inline] free_pcp_prepare mm/page_alloc.c:1619 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3581 free_unref_page+0x8f/0x530 mm/page_alloc.c:3677 free_the_page mm/page_alloc.c:830 [inline] __free_pages+0x67/0x100 mm/page_alloc.c:5947 __free_slab+0xca/0x1a0 mm/slub.c:2039 free_slab mm/slub.c:2054 [inline] discard_slab mm/slub.c:2060 [inline] __unfreeze_partials+0x160/0x190 mm/slub.c:2609 put_cpu_partial+0xa9/0x100 mm/slub.c:2685 __slab_free+0x1c4/0x280 mm/slub.c:3563 do_slab_free mm/slub.c:3640 [inline] ___cache_free+0xbf/0xd0 mm/slub.c:3696 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0xc6/0x140 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14a/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x24/0x80 mm/kasan/common.c:310 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x16e/0x330 mm/slub.c:3447 getname_flags+0xb9/0x500 fs/namei.c:139 vfs_fstatat fs/stat.c:266 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat+0xdf/0x380 fs/stat.c:431 __x64_sys_newfstatat+0x9b/0xb0 fs/stat.c:431 Memory state around the buggy address: ffff88811b96ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811b96ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811b970000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811b970080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811b970100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================