================================================================== BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:791 [inline] BUG: KASAN: use-after-free in detach_timer kernel/time/timer.c:824 [inline] BUG: KASAN: use-after-free in detach_if_pending+0x155/0x330 kernel/time/timer.c:841 Write of size 8 at addr ffff8881e4db31c8 by task syz.1.407/1751 CPU: 1 PID: 1751 Comm: syz.1.407 Not tainted 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x1e/0x20 lib/dump_stack.c:77 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384 __kasan_report+0xef/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:137 __hlist_del include/linux/list.h:791 [inline] detach_timer kernel/time/timer.c:824 [inline] detach_if_pending+0x155/0x330 kernel/time/timer.c:841 try_to_del_timer_sync kernel/time/timer.c:1267 [inline] del_timer_sync+0x136/0x1a0 kernel/time/timer.c:1410 tun_flow_uninit+0x2f/0x2b0 drivers/net/tun.c:1452 tun_free_netdev+0x7a/0x1b0 drivers/net/tun.c:2404 netdev_run_todo+0xa45/0xc70 net/core/dev.c:9477 rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112 tun_detach drivers/net/tun.c:766 [inline] tun_chr_close+0xc4/0x140 drivers/net/tun.c:3563 __fput+0x2a3/0x730 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x146/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa43/0x2660 kernel/exit.c:861 __do_sys_exit kernel/exit.c:953 [inline] __se_sys_exit kernel/exit.c:951 [inline] __x64_sys_exit+0x40/0x40 kernel/exit.c:951 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f2d30250969 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2d2e8b8fe8 EFLAGS: 00000246 ORIG_RAX: 000000000000003c RAX: ffffffffffffffda RBX: 00007f2d30477fa0 RCX: 00007f2d30250969 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f2d302d2ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2d30477fa0 R15: 00007ffe02a814b8 Allocated by task 164: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xe2/0x270 mm/slub.c:2842 getname_flags+0xb9/0x500 fs/namei.c:141 getname+0x19/0x20 fs/namei.c:212 do_sys_open+0x26c/0x5d0 fs/open.c:1117 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 164: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kmem_cache_free+0x10c/0x2c0 mm/slub.c:3096 putname+0xfe/0x150 fs/namei.c:262 do_sys_open+0x520/0x5d0 fs/open.c:1132 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881e4db2200 which belongs to the cache names_cache of size 4096 The buggy address is located 4040 bytes inside of 4096-byte region [ffff8881e4db2200, ffff8881e4db3200) The buggy address belongs to the page: page:ffffea0007936c00 refcount:1 mapcount:0 mapping:ffff8881f5d01b80 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5d01b80 raw: 0000000000000000 0000000000070007 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x35e/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x93/0x420 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x29e/0x420 mm/slub.c:2667 __slab_alloc+0x63/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x12c/0x270 mm/slub.c:2842 getname_flags+0xb9/0x500 fs/namei.c:141 getname+0x19/0x20 fs/namei.c:212 do_sys_open+0x26c/0x5d0 fs/open.c:1117 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x2a9/0x3a0 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4954 [inline] __free_pages+0xaa/0x110 mm/page_alloc.c:4962 pcpu_free_pages mm/percpu-vm.c:64 [inline] pcpu_depopulate_chunk mm/percpu-vm.c:328 [inline] pcpu_balance_workfn+0x8c7/0x14b0 mm/percpu.c:1865 process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290 worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436 kthread+0x31e/0x3a0 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Memory state around the buggy address: ffff8881e4db3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e4db3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881e4db3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e4db3200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e4db3280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================