================================================================== BUG: KASAN: slab-use-after-free in hlist_add_head include/linux/list.h:945 [inline] BUG: KASAN: slab-use-after-free in enqueue_timer+0xad/0x560 kernel/time/timer.c:605 Write of size 8 at addr ffff888034fad500 by task kworker/u4:7/5978 CPU: 0 PID: 5978 Comm: kworker/u4:7 Not tainted 6.3.0-syzkaller-04626-g0cfd8703e7da #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Workqueue: wg-kex-wg0 wg_packet_handshake_send_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0x163/0x540 mm/kasan/report.c:430 kasan_report+0x176/0x1b0 mm/kasan/report.c:536 hlist_add_head include/linux/list.h:945 [inline] enqueue_timer+0xad/0x560 kernel/time/timer.c:605 internal_add_timer kernel/time/timer.c:634 [inline] __mod_timer+0xa76/0xf40 kernel/time/timer.c:1131 mod_peer_timer+0x158/0x220 drivers/net/wireguard/timers.c:37 wg_packet_send_handshake_initiation drivers/net/wireguard/send.c:42 [inline] wg_packet_handshake_send_worker+0x1e5/0x320 drivers/net/wireguard/send.c:51 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x2b2/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 4611: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node+0xb8/0x230 mm/slab_common.c:973 kmalloc_node include/linux/slab.h:580 [inline] kvmalloc_node+0x72/0x180 mm/util.c:603 kvmalloc include/linux/slab.h:698 [inline] kvzalloc include/linux/slab.h:706 [inline] alloc_netdev_mqs+0x89/0xf30 net/core/dev.c:10588 rtnl_create_link+0x2f7/0xc00 net/core/rtnetlink.c:3312 rtnl_newlink_create net/core/rtnetlink.c:3430 [inline] __rtnl_newlink net/core/rtnetlink.c:3657 [inline] rtnl_newlink+0x1379/0x2010 net/core/rtnetlink.c:3670 rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6181 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2577 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x58f/0x890 net/socket.c:2501 ___sys_sendmsg net/socket.c:2555 [inline] __sys_sendmsg+0x2ad/0x390 net/socket.c:2584 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5978: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x264/0x3c0 mm/slub.c:3800 device_release+0x95/0x1c0 kobject_cleanup lib/kobject.c:681 [inline] kobject_release lib/kobject.c:712 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x228/0x470 lib/kobject.c:729 netdev_run_todo+0xe5a/0xf50 net/core/dev.c:10362 default_device_exit_batch+0x5c9/0x630 net/core/dev.c:11354 ops_exit_list net/core/net_namespace.c:175 [inline] cleanup_net+0x767/0xb80 net/core/net_namespace.c:614 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x2b2/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1361 __queue_work+0xb37/0xf10 kernel/workqueue.c:1524 call_timer_fn+0x178/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2ab/0x908 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 insert_work+0x54/0x3d0 kernel/workqueue.c:1361 __queue_work+0xb37/0xf10 kernel/workqueue.c:1524 call_timer_fn+0x178/0x580 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1746 [inline] __run_timers+0x67a/0x860 kernel/time/timer.c:2022 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035 __do_softirq+0x2ab/0x908 kernel/softirq.c:571 The buggy address belongs to the object at ffff888034fac000 which belongs to the cache kmalloc-cg-8k of size 8192 The buggy address is located 5376 bytes inside of freed 8192-byte region [ffff888034fac000, ffff888034fae000) The buggy address belongs to the physical page: page:ffffea0000d3ea00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x34fa8 head:ffffea0000d3ea00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88802a459c81 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff88801244f640 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000020002 00000001ffffffff ffff88802a459c81 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4230, tgid 4229 (syz-executor.1), ts 1934920253453, free_ts 1934601251884 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x3246/0x33c0 mm/page_alloc.c:4326 __alloc_pages+0x255/0x670 mm/page_alloc.c:5592 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1b8/0x290 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc_node+0xa7/0x230 mm/slab_common.c:973 kmalloc_node include/linux/slab.h:580 [inline] kvmalloc_node+0x72/0x180 mm/util.c:603 kvmalloc include/linux/slab.h:698 [inline] kvzalloc include/linux/slab.h:706 [inline] alloc_netdev_mqs+0x89/0xf30 net/core/dev.c:10588 rtnl_create_link+0x2f7/0xc00 net/core/rtnetlink.c:3312 rtnl_newlink_create net/core/rtnetlink.c:3430 [inline] __rtnl_newlink net/core/rtnetlink.c:3657 [inline] rtnl_newlink+0x1379/0x2010 net/core/rtnetlink.c:3670 rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6181 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2577 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x7c3/0x990 net/netlink/af_netlink.c:1365 netlink_sendmsg+0xa2a/0xd60 net/netlink/af_netlink.c:1942 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x58f/0x890 net/socket.c:2501 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare mm/page_alloc.c:1504 [inline] free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388 free_unref_page+0x37/0x3f0 mm/page_alloc.c:3483 kasan_depopulate_vmalloc_pte+0x6a/0x80 mm/kasan/shadow.c:427 apply_to_pte_range mm/memory.c:2578 [inline] apply_to_pmd_range mm/memory.c:2622 [inline] apply_to_pud_range mm/memory.c:2658 [inline] apply_to_p4d_range mm/memory.c:2694 [inline] __apply_to_page_range+0x9c5/0xcc0 mm/memory.c:2728 kasan_release_vmalloc+0x9a/0xb0 mm/kasan/shadow.c:544 __purge_vmap_area_lazy+0xc0f/0x19d0 mm/vmalloc.c:1771 drain_vmap_area_work+0x40/0xd0 mm/vmalloc.c:1804 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x2b2/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888034fad400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888034fad480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888034fad500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888034fad580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888034fad600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================