================================================================== BUG: KASAN: use-after-free in hlist_move_list include/linux/list.h:870 [inline] BUG: KASAN: use-after-free in __collect_expired_timers kernel/time/timer.c:1514 [inline] BUG: KASAN: use-after-free in collect_expired_timers kernel/time/timer.c:1749 [inline] BUG: KASAN: use-after-free in __run_timers+0x521/0xbe0 kernel/time/timer.c:1813 Write of size 8 at addr ffff8881eaa071c8 by task syz-executor.3/1548 CPU: 1 PID: 1548 Comm: syz-executor.3 Tainted: G W 5.4.274-syzkaller-00002-g6f97bd951d82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 hlist_move_list include/linux/list.h:870 [inline] __collect_expired_timers kernel/time/timer.c:1514 [inline] collect_expired_timers kernel/time/timer.c:1749 [inline] __run_timers+0x521/0xbe0 kernel/time/timer.c:1813 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830 __do_softirq+0x23b/0x6b7 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x195/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:538 [inline] smp_apic_timer_interrupt+0x11a/0x460 arch/x86/kernel/apic/apic.c:1149 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834 RIP: 0010:deref_stack_reg arch/x86/kernel/unwind_orc.c:350 [inline] RIP: 0010:unwind_next_frame+0xf8a/0x1ea0 arch/x86/kernel/unwind_orc.c:526 Code: 7c 82 f7 ff 85 c0 0f 85 80 08 00 00 4c 8d ac 24 40 01 00 00 4c 89 eb 48 c1 eb 03 49 bf 00 00 00 00 00 fc ff df 42 80 3c 3b 00 <74> 08 4c 89 ef e8 cc 53 64 00 48 c7 84 24 40 01 00 00 00 00 00 00 RSP: 0018:ffff8881eac6f000 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffff8881eac6fbe0 RBX: 1ffff1103d58de28 RCX: 1ffff1103d58de60 RDX: ffffffff867c1344 RSI: 0000000000000000 RDI: ffff8881eac6f310 RBP: ffff8881eac6f2f0 R08: 0000000000000001 R09: ffff8881eac6f350 R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffffffff0cf8268 R13: ffff8881eac6f140 R14: ffff8881eac6fbd8 R15: dffffc0000000000 arch_stack_walk+0x111/0x140 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x118/0x1c0 kernel/stacktrace.c:123 save_stack+0x95/0x880 mm/page_owner.c:122 __reset_page_owner+0x1f/0x100 mm/page_owner.c:149 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+0x297/0x380 mm/page_alloc.c:3085 free_unref_page_list+0x10a/0x590 mm/page_alloc.c:3154 release_pages+0xad8/0xb20 mm/swap.c:842 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:189 [inline] tlb_flush_mmu mm/mmu_gather.c:196 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:277 exit_mmap+0x2dc/0x520 mm/mmap.c:3193 __mmput+0x8e/0x2c0 kernel/fork.c:1101 exit_mm kernel/exit.c:536 [inline] do_exit+0xc08/0x2bc0 kernel/exit.c:846 do_group_exit+0x138/0x300 kernel/exit.c:982 get_signal+0xdb1/0x1440 kernel/signal.c:2735 do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f1641f72f29 Code: Bad RIP value. RSP: 002b:00007f16412cc0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: fffffffffffffff4 RBX: 00007f16420aa050 RCX: 00007f1641f72f29 RDX: 0000000020000180 RSI: 00000000400454ca RDI: 0000000000000005 RBP: 00007f1641fe2074 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f16420aa050 R15: 00007ffc33f2af48 The buggy address belongs to the page: page:ffffea0007aa81c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 0000000000000000 ffffea0007aa8188 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x146dc0(GFP_USER|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP|__GFP_ZERO) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 __alloc_pages include/linux/gfp.h:503 [inline] __alloc_pages_node include/linux/gfp.h:516 [inline] alloc_pages_node include/linux/gfp.h:530 [inline] kmalloc_order mm/slab_common.c:1342 [inline] kmalloc_order_trace+0x2a/0x100 mm/slab_common.c:1358 __kmalloc_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0x7e/0xf0 mm/util.c:596 kvmalloc include/linux/mm.h:761 [inline] kvzalloc include/linux/mm.h:769 [inline] alloc_netdev_mqs+0x85/0xc70 net/core/dev.c:9610 tun_set_iff+0x51f/0xdc0 drivers/net/tun.c:2888 __tun_chr_ioctl+0x8a9/0x1d00 drivers/net/tun.c:3182 do_vfs_ioctl+0x742/0x1720 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 do_syscall_64+0xca/0x1c0 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_pages_ok+0x847/0x950 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4955 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4961 device_release+0x6b/0x190 drivers/base/core.c:1776 kobject_cleanup lib/kobject.c:716 [inline] kobject_release lib/kobject.c:747 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1e6/0x2f0 lib/kobject.c:764 tun_set_iff+0x870/0xdc0 drivers/net/tun.c:2919 __tun_chr_ioctl+0x8a9/0x1d00 drivers/net/tun.c:3182 do_vfs_ioctl+0x742/0x1720 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881eaa07080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881eaa07100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881eaa07180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881eaa07200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881eaa07280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: 7c 82 jl 0xffffff84 2: f7 ff idiv %edi 4: 85 c0 test %eax,%eax 6: 0f 85 80 08 00 00 jne 0x88c c: 4c 8d ac 24 40 01 00 lea 0x140(%rsp),%r13 13: 00 14: 4c 89 eb mov %r13,%rbx 17: 48 c1 eb 03 shr $0x3,%rbx 1b: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15 22: fc ff df 25: 42 80 3c 3b 00 cmpb $0x0,(%rbx,%r15,1) * 2a: 74 08 je 0x34 <-- trapping instruction 2c: 4c 89 ef mov %r13,%rdi 2f: e8 cc 53 64 00 call 0x645400 34: 48 c7 84 24 40 01 00 movq $0x0,0x140(%rsp) 3b: 00 00 00 00 00