================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline] BUG: KASAN: use-after-free in enqueue_timer+0xb7/0x300 kernel/time/timer.c:541 Write of size 8 at addr ffff8881e67b31c8 by task syz.5.304/1592 CPU: 1 PID: 1592 Comm: syz.5.304 Not tainted 5.4.290-syzkaller-00017-g6b07fcd94a6a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 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_add_head include/linux/list.h:814 [inline] enqueue_timer+0xb7/0x300 kernel/time/timer.c:541 __internal_add_timer kernel/time/timer.c:554 [inline] internal_add_timer+0x240/0x430 kernel/time/timer.c:604 __mod_timer+0x6f1/0x13e0 kernel/time/timer.c:1065 call_timer_fn+0x36/0x390 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x879/0xbe0 kernel/time/timer.c:1817 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:539 [inline] smp_apic_timer_interrupt+0x11a/0x490 arch/x86/kernel/apic/apic.c:1161 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834 RIP: 0010:__dev_notify_flags+0x3c6/0x510 net/core/dev.c:8012 Code: 01 48 8b 5c 24 18 75 6a e8 f7 0f e3 fd be 04 00 00 00 48 c7 c7 20 73 76 87 4c 89 fa e8 c3 1c c2 fd 48 c7 44 24 20 0e 36 e0 45 <48> b8 00 00 00 00 00 fc ff df 48 c7 04 18 00 00 00 00 48 c7 44 18 RSP: 0018:ffff8881e1257820 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: 1ffff1103c24af08 RCX: ffff8881d58d2f40 RDX: 0000000000000000 RSI: 00000000ffffffdf RDI: 0000000000000000 RBP: ffff8881e1257940 R08: ffffffff814358a4 R09: ffffed103e97880a R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8881e12578b0 R13: 0000000000008080 R14: 1ffff1103e978843 R15: ffff8881e12578a0 dev_change_flags+0xe7/0x190 net/core/dev.c:8034 dev_ifsioc+0x104/0xa60 net/core/dev_ioctl.c:226 dev_ioctl+0x505/0xb40 net/core/dev_ioctl.c:483 sock_do_ioctl+0x295/0x3a0 net/socket.c:1081 sock_ioctl+0x4a4/0x760 net/socket.c:1198 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 RIP: 0033:0x7f341b4f0169 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:00007f3419b5a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f341b708fa0 RCX: 00007f341b4f0169 RDX: 0000400000000800 RSI: 0000000000008914 RDI: 0000000000000007 RBP: 00007f341b5712a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f341b708fa0 R15: 00007ffee829b3d8 The buggy address belongs to the page: page:ffffea000799ecc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea0007238ac8 ffffea0007740b08 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 0, migratetype Unmovable, gfp_mask 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT) 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] __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x1b/0xb0 arch/x86/mm/pgtable.c:26 __pte_alloc+0x1d/0x1c0 mm/memory.c:440 copy_pte_range mm/memory.c:830 [inline] copy_pmd_range mm/memory.c:906 [inline] copy_pud_range mm/memory.c:940 [inline] copy_p4d_range mm/memory.c:962 [inline] copy_page_range+0x1c24/0x26f0 mm/memory.c:1024 dup_mmap kernel/fork.c:608 [inline] dup_mm kernel/fork.c:1379 [inline] copy_mm+0xb23/0x10d0 kernel/fork.c:1435 copy_process+0x1291/0x3230 kernel/fork.c:2052 _do_fork+0x197/0x900 kernel/fork.c:2399 __do_sys_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2538 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_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:538 [inline] do_exit+0xc08/0x2bc0 kernel/exit.c:848 do_group_exit+0x138/0x300 kernel/exit.c:984 get_signal+0xdb1/0x1440 kernel/signal.c:2738 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 Memory state around the buggy address: ffff8881e67b3080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881e67b3100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881e67b3180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881e67b3200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881e67b3280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page PGD 1e7510067 P4D 1e7510067 PUD 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 1 PID: 1499 Comm: syz.6.281 Tainted: G B 5.4.290-syzkaller-00017-g6b07fcd94a6a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6f09d18 EFLAGS: 00010202 RAX: ffffffff8154e8ca RBX: 0000000000000101 RCX: ffff8881e69e4ec0 RDX: 0000000000000101 RSI: 0000000000000000 RDI: ffff8881e67b31c0 RBP: ffff8881f6f09ec8 R08: ffffffff8154e50e R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000000ffffa180 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e67b31c0 FS: 00007ff5ffca26c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001e51c7000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: call_timer_fn+0x36/0x390 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x879/0xbe0 kernel/time/timer.c:1817 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:539 [inline] smp_apic_timer_interrupt+0x11a/0x490 arch/x86/kernel/apic/apic.c:1161 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834 RIP: 0010:__orc_find arch/x86/kernel/unwind_orc.c:47 [inline] RIP: 0010:orc_find arch/x86/kernel/unwind_orc.c:175 [inline] RIP: 0010:unwind_next_frame+0x5ea/0x1ea0 arch/x86/kernel/unwind_orc.c:438 Code: 08 00 00 a9 00 04 00 00 0f 84 1e 12 00 00 e9 41 12 00 00 49 89 d6 49 89 d5 4c 89 f8 4c 29 e8 48 89 c1 48 c1 f9 02 48 c1 e8 3f <48> 01 c8 48 83 e0 fe 49 8d 5c 45 00 48 89 d8 48 c1 e8 03 48 b9 00 RSP: 0018:ffff8881c921eb20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: ffffffff86ba1d00 RCX: 0000000000000000 RDX: ffffffff8656e3f0 RSI: ffffffff86847888 RDI: ffffffff812fbdbc RBP: ffff8881c921ee10 R08: 0000000000000001 R09: ffff8881c921ee70 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffff818fe9f6 R13: ffffffff8656e3f0 R14: ffffffff8656e3f0 R15: ffffffff8656e3f0 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 __pagevec_release+0xc3/0x150 mm/swap.c:862 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x8a5/0x1ad0 mm/shmem.c:875 shmem_truncate_range mm/shmem.c:997 [inline] shmem_evict_inode+0x218/0x9a0 mm/shmem.c:1097 evict+0x4ea/0x960 fs/inode.c:610 __dentry_kill+0x429/0x630 fs/dcache.c:583 dentry_kill+0xb8/0x280 fs/dcache.c:677 dput+0x3c/0x80 fs/dcache.c:864 __fput+0x443/0x680 fs/file_table.c:294 task_work_run+0x140/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xcaf/0x2bc0 kernel/exit.c:861 do_group_exit+0x138/0x300 kernel/exit.c:984 get_signal+0xdb1/0x1440 kernel/signal.c:2738 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 ret_from_intr+0x1c/0x1c RIP: 0033:0xe6 Code: Bad RIP value. RSP: 002b:0000400000000198 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007ff601850fa0 RCX: 00007ff601638169 RDX: 0000400000000040 RSI: 0000400000000190 RDI: 0000000000006200 RBP: 00007ff6016b92a0 R08: 0000400000000280 R09: 0000400000000280 R10: 0000400000000240 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff601850fa0 R15: 00007ffdccc3d968 Modules linked in: CR2: 0000000000000000 ---[ end trace 652373d647fb2d23 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6f09d18 EFLAGS: 00010202 RAX: ffffffff8154e8ca RBX: 0000000000000101 RCX: ffff8881e69e4ec0 RDX: 0000000000000101 RSI: 0000000000000000 RDI: ffff8881e67b31c0 RBP: ffff8881f6f09ec8 R08: ffffffff8154e50e R09: 0000000000000003 R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000000ffffa180 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e67b31c0 FS: 00007ff5ffca26c0(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001e51c7000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: 01 48 8b add %ecx,-0x75(%rax) 3: 5c pop %rsp 4: 24 18 and $0x18,%al 6: 75 6a jne 0x72 8: e8 f7 0f e3 fd call 0xfde31004 d: be 04 00 00 00 mov $0x4,%esi 12: 48 c7 c7 20 73 76 87 mov $0xffffffff87767320,%rdi 19: 4c 89 fa mov %r15,%rdx 1c: e8 c3 1c c2 fd call 0xfdc21ce4 21: 48 c7 44 24 20 0e 36 movq $0x45e0360e,0x20(%rsp) 28: e0 45 * 2a: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax <-- trapping instruction 31: fc ff df 34: 48 c7 04 18 00 00 00 movq $0x0,(%rax,%rbx,1) 3b: 00 3c: 48 rex.W 3d: c7 .byte 0xc7 3e: 44 rex.R 3f: 18 .byte 0x18