================================================================== 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 ffff8881eacb71c8 by task kworker/1:5/357 CPU: 1 PID: 357 Comm: kworker/1:5 Not tainted 5.4.219-syzkaller-00097-ga76dfbc99260 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 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 Allocated by task 1605: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x131/0x1e0 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0xfb/0x280 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] pskb_expand_head+0x118/0x1060 net/core/skbuff.c:1639 __bpf_try_make_writable net/core/filter.c:1635 [inline] bpf_try_make_writable net/core/filter.c:1641 [inline] bpf_try_make_head_writable net/core/filter.c:1649 [inline] ____bpf_clone_redirect net/core/filter.c:2136 [inline] bpf_clone_redirect+0x10e/0x350 net/core/filter.c:2114 0xffffffffa0030062 bpf_call_func include/linux/filter.h:623 [inline] bpf_test_run+0x2b4/0x6a0 net/bpf/test_run.c:44 bpf_prog_test_run_skb+0x890/0x1000 net/bpf/test_run.c:313 bpf_prog_test_run kernel/bpf/syscall.c:2124 [inline] __do_sys_bpf kernel/bpf/syscall.c:2909 [inline] __se_sys_bpf+0x2bc6/0xbba0 kernel/bpf/syscall.c:2849 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 1605: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x178/0x240 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0x80/0x150 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xc6/0x260 mm/slub.c:4071 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb+0x56/0x1d0 net/core/skbuff.c:689 dummy_xmit+0x133/0x190 drivers/net/dummy.c:91 __netdev_start_xmit include/linux/netdevice.h:4519 [inline] netdev_start_xmit include/linux/netdevice.h:4533 [inline] xmit_one+0xfa/0x4a0 net/core/dev.c:3209 dev_hard_start_xmit+0xac/0x1b0 net/core/dev.c:3225 __dev_queue_xmit+0x15d9/0x2a20 net/core/dev.c:3790 __bpf_tx_skb net/core/filter.c:2063 [inline] __bpf_redirect_common net/core/filter.c:2102 [inline] __bpf_redirect+0x8ab/0xcc0 net/core/filter.c:2109 ____bpf_clone_redirect net/core/filter.c:2142 [inline] bpf_clone_redirect+0x243/0x350 net/core/filter.c:2114 0xffffffffa0030062 bpf_call_func include/linux/filter.h:623 [inline] bpf_test_run+0x2b4/0x6a0 net/bpf/test_run.c:44 bpf_prog_test_run_skb+0x890/0x1000 net/bpf/test_run.c:313 bpf_prog_test_run kernel/bpf/syscall.c:2124 [inline] __do_sys_bpf kernel/bpf/syscall.c:2909 [inline] __se_sys_bpf+0x2bc6/0xbba0 kernel/bpf/syscall.c:2849 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881eacb7000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 456 bytes inside of 512-byte region [ffff8881eacb7000, ffff8881eacb7200) The buggy address belongs to the page: page:ffffea0007ab2d00 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02500 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__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_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:2505 [inline] ___slab_alloc+0x320/0x4a0 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] __kmalloc_track_caller+0x168/0x280 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] pskb_expand_head+0x118/0x1060 net/core/skbuff.c:1639 __bpf_try_make_writable net/core/filter.c:1635 [inline] bpf_try_make_writable net/core/filter.c:1641 [inline] bpf_try_make_head_writable net/core/filter.c:1649 [inline] ____bpf_clone_redirect net/core/filter.c:2136 [inline] bpf_clone_redirect+0x10e/0x350 net/core/filter.c:2114 0xffffffffa0030062 bpf_call_func include/linux/filter.h:623 [inline] bpf_test_run+0x2b4/0x6a0 net/bpf/test_run.c:44 bpf_prog_test_run_skb+0x890/0x1000 net/bpf/test_run.c:313 bpf_prog_test_run kernel/bpf/syscall.c:2124 [inline] __do_sys_bpf kernel/bpf/syscall.c:2909 [inline] __se_sys_bpf+0x2bc6/0xbba0 kernel/bpf/syscall.c:2849 do_syscall_64+0xcb/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+0x7fe/0x930 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4953 [inline] __free_pages+0x8f/0x250 mm/page_alloc.c:4959 kfree+0x1ef/0x260 mm/slub.c:4068 tipc_exit_net+0x92/0x100 net/tipc/core.c:108 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x6e4/0xd60 net/core/net_namespace.c:602 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 Memory state around the buggy address: ffff8881eacb7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881eacb7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881eacb7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881eacb7200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881eacb7280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================