================================================================== BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:773 [inline] BUG: KASAN: use-after-free in detach_timer kernel/time/timer.c:824 [inline] BUG: KASAN: use-after-free in detach_if_pending kernel/time/timer.c:841 [inline] BUG: KASAN: use-after-free in try_to_del_timer_sync+0x2ad/0x460 kernel/time/timer.c:1238 Write of size 8 at addr ffff8881d5e531c8 by task syz-executor.1/1146 CPU: 1 PID: 1146 Comm: syz-executor.1 Not tainted 5.4.190-syzkaller-00008-g330fa791a029 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1d5 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 __hlist_del include/linux/list.h:773 [inline] detach_timer kernel/time/timer.c:824 [inline] detach_if_pending kernel/time/timer.c:841 [inline] try_to_del_timer_sync+0x2ad/0x460 kernel/time/timer.c:1238 del_timer_sync+0x74/0xd0 kernel/time/timer.c:1379 tun_flow_uninit drivers/net/tun.c:1387 [inline] tun_free_netdev+0x99/0x3b0 drivers/net/tun.c:2328 netdev_run_todo+0xa3c/0xc80 net/core/dev.c:9445 tun_detach drivers/net/tun.c:751 [inline] tun_chr_close+0xc0/0xd0 drivers/net/tun.c:3523 __fput+0x261/0x680 fs/file_table.c:281 task_work_run+0x186/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x1ba/0x1d0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f658d5f6199 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f658c76c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 00007f658d708f60 RCX: 00007f658d5f6199 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f658d65013b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff5fa893ef R14: 00007f658c76c300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea00075794c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea0007504a48 ffffea0007579488 0000000000000000 raw: 0000000000000000 0000000000140000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857 alloc_slab_page+0x39/0x3e0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x450 mm/slub.c:1749 new_slab_objects mm/slub.c:2506 [inline] ___slab_alloc+0x320/0x4b0 mm/slub.c:2667 __slab_alloc+0x5a/0x90 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x100/0x210 mm/slub.c:2842 kmem_cache_zalloc include/linux/slab.h:680 [inline] __kernfs_new_node+0x8b/0x650 fs/kernfs/dir.c:631 kernfs_new_node+0x95/0x160 fs/kernfs/dir.c:697 __kernfs_create_file+0x45/0x260 fs/kernfs/file.c:1001 sysfs_add_file_mode_ns+0x292/0x340 fs/sysfs/file.c:306 create_files fs/sysfs/group.c:63 [inline] internal_create_group+0x4a4/0xe00 fs/sysfs/group.c:148 internal_create_groups fs/sysfs/group.c:188 [inline] sysfs_create_groups+0x5d/0x130 fs/sysfs/group.c:214 device_add_groups drivers/base/core.c:2004 [inline] device_add_attrs+0x138/0x370 drivers/base/core.c:2163 device_add+0x505/0xbc0 drivers/base/core.c:2859 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+0x1a4/0x290 mm/page_alloc.c:1233 free_unref_page_prepare mm/page_alloc.c:3085 [inline] free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4917 [inline] __free_pages+0x52/0x1e0 mm/page_alloc.c:4925 __free_slab+0x22b/0x2e0 mm/slub.c:1774 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch+0x41c/0x910 kernel/rcu/tree.c:2167 rcu_core+0x448/0xbc0 kernel/rcu/tree.c:2387 __do_softirq+0x23e/0x643 kernel/softirq.c:292 run_ksoftirqd+0x1f/0x30 kernel/softirq.c:603 smpboot_thread_fn+0x4d7/0x880 kernel/smpboot.c:165 kthread+0x2d8/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 Memory state around the buggy address: ffff8881d5e53080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881d5e53100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881d5e53180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881d5e53200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881d5e53280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================