================================================================== 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 ffff8881c5f4b1c8 by task syz-executor/6038 CPU: 0 PID: 6038 Comm: syz-executor Not tainted 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_pernet_init+0x1e9/0x2e0 net/can/af_can.c:811 ops_init+0x1ba/0x4a0 net/core/net_namespace.c:141 setup_net+0x20c/0x9b0 net/core/net_namespace.c:348 copy_net_ns+0x314/0x520 net/core/net_namespace.c:489 create_new_namespaces+0x49c/0x590 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:202 ksys_unshare+0x4a4/0x7d0 kernel/fork.c:2908 __do_sys_unshare kernel/fork.c:2976 [inline] __se_sys_unshare kernel/fork.c:2974 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:2974 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f79004ef167 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 10 01 00 00 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:00007ffdf77c19f8 EFLAGS: 00000202 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007f7900714f40 RCX: 00007f79004ef167 RDX: 0000000000000005 RSI: 00007ffdf77c18c0 RDI: 0000000040000000 RBP: 00007f7900715738 R08: 00007f7901246d60 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000008 R13: 0000000000000003 R14: 0000000000000009 R15: 0000000000000000 Allocated by task 5957: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537 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+0x10d/0x2d0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xdc/0x500 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] nlmsg_new include/net/netlink.h:888 [inline] rtmsg_fib+0x5a6/0xcb0 net/ipv4/fib_semantics.c:518 fib_table_insert+0xaaa/0x1870 net/ipv4/fib_trie.c:1283 fib_magic net/ipv4/fib_frontend.c:1103 [inline] fib_add_ifaddr+0xb18/0xed0 net/ipv4/fib_frontend.c:1149 fib_netdev_event+0x231/0x5d0 net/ipv4/fib_frontend.c:1487 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406 call_netdevice_notifiers_info net/core/dev.c:1670 [inline] call_netdevice_notifiers_extack net/core/dev.c:1682 [inline] call_netdevice_notifiers net/core/dev.c:1696 [inline] __dev_notify_flags+0x1e2/0x3d0 net/core/dev.c:-1 dev_change_flags+0xe8/0x1a0 net/core/dev.c:8034 do_setlink+0xb98/0x39e0 net/core/rtnetlink.c:2542 __rtnl_newlink net/core/rtnetlink.c:3188 [inline] rtnl_newlink+0x1136/0x15f0 net/core/rtnetlink.c:3314 rtnetlink_rcv_msg+0xa23/0xbe0 net/core/rtnetlink.c:5290 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 Freed by task 5957: 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+0x1c3/0x280 mm/kasan/common.c:487 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xbe/0x260 mm/slub.c:4071 skb_free_head net/core/skbuff.c:601 [inline] skb_release_data+0x4ea/0x610 net/core/skbuff.c:621 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb net/core/skbuff.c:689 [inline] consume_skb+0xad/0x240 net/core/skbuff.c:849 netlink_broadcast_filtered+0x1198/0x1290 net/netlink/af_netlink.c:1516 netlink_broadcast net/netlink/af_netlink.c:1538 [inline] nlmsg_multicast include/net/netlink.h:968 [inline] nlmsg_notify+0xed/0x1b0 net/netlink/af_netlink.c:2510 rtnl_notify+0x9a/0xc0 net/core/rtnetlink.c:737 rtmsg_fib+0x71a/0xcb0 net/ipv4/fib_semantics.c:531 fib_table_insert+0xaaa/0x1870 net/ipv4/fib_trie.c:1283 fib_magic net/ipv4/fib_frontend.c:1103 [inline] fib_add_ifaddr+0xb18/0xed0 net/ipv4/fib_frontend.c:1149 fib_netdev_event+0x231/0x5d0 net/ipv4/fib_frontend.c:1487 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0xa0/0x120 kernel/notifier.c:406 call_netdevice_notifiers_info net/core/dev.c:1670 [inline] call_netdevice_notifiers_extack net/core/dev.c:1682 [inline] call_netdevice_notifiers net/core/dev.c:1696 [inline] __dev_notify_flags+0x1e2/0x3d0 net/core/dev.c:-1 dev_change_flags+0xe8/0x1a0 net/core/dev.c:8034 do_setlink+0xb98/0x39e0 net/core/rtnetlink.c:2542 __rtnl_newlink net/core/rtnetlink.c:3188 [inline] rtnl_newlink+0x1136/0x15f0 net/core/rtnetlink.c:3314 rtnetlink_rcv_msg+0xa23/0xbe0 net/core/rtnetlink.c:5290 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 The buggy address belongs to the object at ffff8881c5f4b000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 456 bytes inside of 1024-byte region [ffff8881c5f4b000, ffff8881c5f4b400) The buggy address belongs to the page: page:ffffea000717d200 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02280 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, 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+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_slab_page+0x3c/0x3b0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x93/0x420 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x29e/0x420 mm/slub.c:2667 __slab_alloc+0x63/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x17c/0x2d0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xdc/0x500 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] nlmsg_new include/net/netlink.h:888 [inline] inet6_rt_notify+0x287/0x470 net/ipv6/route.c:5996 fib6_add_rt2node net/ipv6/ip6_fib.c:1187 [inline] fib6_add+0x21a3/0x3ad0 net/ipv6/ip6_fib.c:1416 __ip6_ins_rt net/ipv6/route.c:1322 [inline] ip6_ins_rt+0xc5/0x110 net/ipv6/route.c:1332 __ipv6_ifa_notify+0x4cb/0xdb0 net/ipv6/addrconf.c:6094 ipv6_ifa_notify net/ipv6/addrconf.c:6134 [inline] addrconf_dad_completed+0x183/0xe90 net/ipv6/addrconf.c:4234 addrconf_dad_work+0xc0d/0x1400 net/ipv6/addrconf.c:4038 process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290 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+0x7e4/0x910 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4956 [inline] __free_pages+0x8c/0x110 mm/page_alloc.c:4962 kfree+0x1ca/0x260 mm/slub.c:4068 kvfree+0x4c/0x50 mm/util.c:625 netif_free_rx_queues net/core/dev.c:9017 [inline] free_netdev+0x101/0x320 net/core/dev.c:9721 netdev_run_todo+0xa78/0xc70 net/core/dev.c:9479 rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112 tun_detach drivers/net/tun.c:766 [inline] tun_chr_close+0xc4/0x140 drivers/net/tun.c:3563 __fput+0x2a3/0x730 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x146/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x195/0x1b0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x18e/0x1f0 arch/x86/entry/common.c:194 syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x13e/0x170 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881c5f4b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c5f4b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881c5f4b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881c5f4b200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c5f4b280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================