================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:796 [inline] BUG: KASAN: use-after-free in enqueue_timer kernel/time/timer.c:541 [inline] BUG: KASAN: use-after-free in __internal_add_timer+0x2a6/0x4a0 kernel/time/timer.c:554 Write of size 8 at addr ffff8881eb2031c8 by task kworker/1:6/864 CPU: 1 PID: 864 Comm: kworker/1:6 Not tainted 5.4.219-syzkaller-00002-ga0eae55f26a0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Workqueue: wg-crypt-wg0 wg_packet_tx_worker Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 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_add_head include/linux/list.h:796 [inline] enqueue_timer kernel/time/timer.c:541 [inline] __internal_add_timer+0x2a6/0x4a0 kernel/time/timer.c:554 internal_add_timer kernel/time/timer.c:604 [inline] __mod_timer+0xaad/0x1c90 kernel/time/timer.c:1065 mod_peer_timer drivers/net/wireguard/timers.c:37 [inline] wg_timers_any_authenticated_packet_traversal+0x125/0x180 drivers/net/wireguard/timers.c:215 wg_packet_create_data_done drivers/net/wireguard/send.c:247 [inline] wg_packet_tx_worker+0x15d/0x4d0 drivers/net/wireguard/send.c:276 process_one_work+0x6ca/0xc40 kernel/workqueue.c:2287 worker_thread+0xae0/0x1440 kernel/workqueue.c:2433 kthread+0x2d8/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 The buggy address belongs to the page: page:ffffea0007ac80c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea0007b26408 ffffea00070234c8 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 0x102800(GFP_NOWAIT|__GFP_NOWARN|__GFP_HARDWALL) 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+0x372/0x860 mm/page_alloc.c:4891 __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] __get_free_pages+0xa/0x30 mm/page_alloc.c:4935 tlb_next_batch mm/mmu_gather.c:29 [inline] __tlb_remove_page_size+0x168/0x2f0 mm/mmu_gather.c:83 __tlb_remove_page include/asm-generic/tlb.h:422 [inline] zap_pte_range+0x971/0x1ce0 mm/memory.c:1107 zap_pmd_range mm/memory.c:1221 [inline] zap_pud_range mm/memory.c:1250 [inline] zap_p4d_range mm/memory.c:1271 [inline] unmap_page_range+0x35e/0x450 mm/memory.c:1292 unmap_single_vma mm/memory.c:1337 [inline] unmap_vmas+0x384/0x500 mm/memory.c:1369 exit_mmap+0x2c8/0x540 mm/mmap.c:3186 __mmput+0x34/0x240 kernel/fork.c:1090 exit_mm kernel/exit.c:489 [inline] do_exit+0xc44/0x2d30 kernel/exit.c:799 do_group_exit+0x136/0x300 kernel/exit.c:910 get_signal+0xd99/0x13f0 kernel/signal.c:2735 do_signal+0xb0/0x1200 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xdd/0x1d0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 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:4951 [inline] __free_pages+0x9c/0x250 mm/page_alloc.c:4959 tlb_batch_list_free mm/mmu_gather.c:61 [inline] tlb_finish_mmu+0x124/0x200 mm/mmu_gather.c:275 exit_mmap+0x2e8/0x540 mm/mmap.c:3188 __mmput+0x34/0x240 kernel/fork.c:1090 exit_mm kernel/exit.c:489 [inline] do_exit+0xc44/0x2d30 kernel/exit.c:799 do_group_exit+0x136/0x300 kernel/exit.c:910 get_signal+0xd99/0x13f0 kernel/signal.c:2735 do_signal+0xb0/0x1200 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xdd/0x1d0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881eb203080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881eb203100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881eb203180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881eb203200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881eb203280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================