================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline] BUG: KASAN: use-after-free in enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541 Write of size 8 at addr ffff8881e608f1c8 by task ksoftirqd/1/17 CPU: 1 PID: 17 Comm: ksoftirqd/1 Tainted: G W 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_add_head include/linux/list.h:814 [inline] enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541 __internal_add_timer kernel/time/timer.c:554 [inline] internal_add_timer+0x208/0x3e0 kernel/time/timer.c:604 __mod_timer+0x5ab/0x1150 kernel/time/timer.c:1065 mod_timer+0x1f/0x30 kernel/time/timer.c:1117 can_stat_update+0xbab/0xc40 net/can/proc.c:186 call_timer_fn+0x3c/0x380 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x81d/0xb60 kernel/time/timer.c:1817 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1830 __do_softirq+0x236/0x660 kernel/softirq.c:292 run_ksoftirqd+0x23/0x30 kernel/softirq.c:603 smpboot_thread_fn+0x474/0x850 kernel/smpboot.c:165 kthread+0x31e/0x3a0 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 The buggy address belongs to the page: page:ffffea00079823c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 dead000000000100 dead000000000122 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+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_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+0x1f/0xc0 arch/x86/mm/pgtable.c:26 __pte_alloc+0x21/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+0x142a/0x1730 mm/memory.c:1024 dup_mmap kernel/fork.c:608 [inline] dup_mm kernel/fork.c:1379 [inline] copy_mm+0xb65/0x1150 kernel/fork.c:1435 copy_process+0x1163/0x2cf0 kernel/fork.c:2052 _do_fork+0x190/0x860 kernel/fork.c:2399 __do_sys_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x12e/0x160 kernel/fork.c:2538 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_list+0x110/0x4c0 mm/page_alloc.c:3154 release_pages+0xa62/0xaa0 mm/swap.c:842 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:297 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+0x175/0x300 mm/mmu_gather.c:277 exit_mmap+0x2db/0x520 mm/mmap.c:3193 __mmput+0x92/0x2e0 kernel/fork.c:1101 mmput+0x47/0x60 kernel/fork.c:1122 exit_mm kernel/exit.c:538 [inline] do_exit+0x99f/0x2660 kernel/exit.c:848 do_group_exit+0x13e/0x300 kernel/exit.c:984 get_signal+0xdee/0x13d0 kernel/signal.c:2738 do_signal+0xad/0xda0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xc4/0x1b0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x18e/0x1f0 arch/x86/entry/common.c:194 swapgs_restore_regs_and_return_to_usermode+0x0/0x54 Memory state around the buggy address: ffff8881e608f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881e608f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881e608f180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881e608f200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881e608f280: 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 0 P4D 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 1 PID: 4567 Comm: syz-executor Tainted: G B W 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6f09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffff8881e73a2f40 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881e608f1c0 RBP: ffff8881f6f09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103ede1398 R11: 1ffff1103ede1398 R12: 00000000ffffbe00 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e608f1c0 FS: 000055558c788500(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001ebdd0000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000200000000300 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: call_timer_fn+0x3c/0x380 kernel/time/timer.c:1448 expire_timers kernel/time/timer.c:1493 [inline] __run_timers+0x81d/0xb60 kernel/time/timer.c:1817 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1830 __do_softirq+0x236/0x660 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x197/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:539 [inline] smp_apic_timer_interrupt+0x11d/0x490 arch/x86/kernel/apic/apic.c:1161 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834 RIP: 0010:atomic64_read include/asm-generic/atomic-instrumented.h:836 [inline] RIP: 0010:atomic_long_read include/asm-generic/atomic-long.h:28 [inline] RIP: 0010:__mutex_owner kernel/locking/mutex.c:77 [inline] RIP: 0010:mutex_spin_on_owner+0x230/0x2e0 kernel/locking/mutex.c:568 Code: 00 00 e8 23 62 45 00 48 8b 45 a0 42 80 3c 38 00 74 08 4c 89 ef e8 10 88 45 00 49 f7 45 00 01 00 00 00 0f 85 8b 00 00 00 f3 90 <4c> 89 ef be 08 00 00 00 e8 f3 61 45 00 48 8b 45 a0 42 80 3c 38 00 RSP: 0018:ffff8881eeebf460 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffff8881f6e00000 RBX: ffff8881f0dd0000 RCX: ffffffff8147eff9 RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000000 RBP: ffff8881eeebf4f0 R08: dffffc0000000000 R09: ffffed103ce745e9 R10: ffffed103ce745e9 R11: 1ffff1103ce745e8 R12: ffffffff8619add0 R13: ffffffff8619adc0 R14: ffffffff8619add0 R15: dffffc0000000000 mutex_optimistic_spin kernel/locking/mutex.c:685 [inline] __mutex_lock_common kernel/locking/mutex.c:973 [inline] __mutex_lock+0x2aa/0xe30 kernel/locking/mutex.c:1114 __mutex_lock_slowpath+0xe/0x10 kernel/locking/mutex.c:1375 mutex_lock+0xcf/0xe0 kernel/locking/mutex.c:296 rtnl_lock net/core/rtnetlink.c:72 [inline] rtnetlink_rcv_msg+0x4d5/0xbe0 net/core/rtnetlink.c:5287 netlink_rcv_skb+0x1e6/0x430 net/netlink/af_netlink.c:2467 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5308 netlink_unicast_kernel net/netlink/af_netlink.c:1306 [inline] netlink_unicast+0x88b/0xa40 net/netlink/af_netlink.c:1332 netlink_sendmsg+0x88d/0xb30 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:638 [inline] __sock_sendmsg net/socket.c:650 [inline] __sys_sendto+0x414/0x570 net/socket.c:1961 __do_sys_sendto net/socket.c:1973 [inline] __se_sys_sendto net/socket.c:1969 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:1969 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f2f649707a3 Code: 64 89 02 48 c7 c0 ff ff ff ff eb b7 66 2e 0f 1f 84 00 00 00 00 00 90 80 3d a1 3d 1f 00 00 41 89 ca 74 14 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 75 c3 0f 1f 40 00 55 48 83 ec 30 44 89 4c 24 RSP: 002b:00007ffe2c9fc8c8 EFLAGS: 00000202 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f2f656c4620 RCX: 00007f2f649707a3 RDX: 0000000000000028 RSI: 00007f2f656c4670 RDI: 0000000000000003 RBP: 0000000000000001 R08: 00007ffe2c9fc8e4 R09: 000000000000000c R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000003 R13: 0000000000000000 R14: 00007f2f656c4670 R15: 0000000000000000 Modules linked in: CR2: 0000000000000000 ---[ end trace ae7cb3cb735bb892 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6f09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffff8881e73a2f40 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881e608f1c0 RBP: ffff8881f6f09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103ede1398 R11: 1ffff1103ede1398 R12: 00000000ffffbe00 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e608f1c0 FS: 000055558c788500(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001ebdd0000 CR4: 00000000003406a0 DR0: 0000000000000000 DR1: 0000200000000300 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: e8 23 62 45 00 call 0x45622a 7: 48 8b 45 a0 mov -0x60(%rbp),%rax b: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1) 10: 74 08 je 0x1a 12: 4c 89 ef mov %r13,%rdi 15: e8 10 88 45 00 call 0x45882a 1a: 49 f7 45 00 01 00 00 testq $0x1,0x0(%r13) 21: 00 22: 0f 85 8b 00 00 00 jne 0xb3 28: f3 90 pause * 2a: 4c 89 ef mov %r13,%rdi <-- trapping instruction 2d: be 08 00 00 00 mov $0x8,%esi 32: e8 f3 61 45 00 call 0x45622a 37: 48 8b 45 a0 mov -0x60(%rbp),%rax 3b: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1)