================================================================== BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:295 [inline] BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:771 [inline] BUG: KASAN: use-after-free in detach_timer kernel/time/timer.c:824 [inline] BUG: KASAN: use-after-free in detach_if_pending kernel/time/timer.c:841 [inline] BUG: KASAN: use-after-free in try_to_del_timer_sync+0x27c/0x460 kernel/time/timer.c:1238 Write of size 8 at addr ffff8881e1bf71c0 by task syz-executor.1/672 CPU: 0 PID: 672 Comm: syz-executor.1 Not tainted 5.4.190-syzkaller-00009-g397b3ca493cb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1d5 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 __write_once_size include/linux/compiler.h:295 [inline] __hlist_del include/linux/list.h:771 [inline] detach_timer kernel/time/timer.c:824 [inline] detach_if_pending kernel/time/timer.c:841 [inline] try_to_del_timer_sync+0x27c/0x460 kernel/time/timer.c:1238 del_timer_sync+0x74/0xd0 kernel/time/timer.c:1379 tun_flow_uninit drivers/net/tun.c:1387 [inline] tun_free_netdev+0x99/0x3b0 drivers/net/tun.c:2328 netdev_run_todo+0xa3c/0xc80 net/core/dev.c:9445 tun_detach drivers/net/tun.c:751 [inline] tun_chr_close+0xc0/0xd0 drivers/net/tun.c:3523 __fput+0x261/0x680 fs/file_table.c:281 task_work_run+0x186/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x1ba/0x1d0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f77e6192e4b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007fffca891e00 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007f77e6192e4b RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 00007f77e62f4960 R08: 0000000000000000 R09: 00007fffca9640b8 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000009002 R13: 00007f77e62f78e0 R14: 00007f77e62f3100 R15: 0000000000000002 Allocated by task 672: 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] __alloc_skb+0xb5/0x4d0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1060 [inline] nlmsg_new include/net/netlink.h:888 [inline] inet6_netconf_notify_devconf+0xc9/0x180 net/ipv6/addrconf.c:574 __addrconf_sysctl_unregister net/ipv6/addrconf.c:6959 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:6983 [inline] addrconf_ifdown+0x1285/0x1480 net/ipv6/addrconf.c:3887 addrconf_notify+0x36f/0xe60 net/ipv6/addrconf.c:3669 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0x9d/0x110 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] rollback_registered_many+0xb88/0x11c0 net/core/dev.c:8616 rollback_registered net/core/dev.c:8658 [inline] unregister_netdevice_queue+0x2bb/0x470 net/core/dev.c:9754 unregister_netdevice include/linux/netdevice.h:2725 [inline] __tun_detach+0xedd/0x1980 drivers/net/tun.c:731 tun_detach drivers/net/tun.c:748 [inline] tun_chr_close+0x8e/0xd0 drivers/net/tun.c:3523 __fput+0x261/0x680 fs/file_table.c:281 task_work_run+0x186/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x1ba/0x1d0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 672: 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+0x55/0x170 net/core/skbuff.c:689 netlink_broadcast_filtered+0x1005/0x1110 net/netlink/af_netlink.c:1522 netlink_broadcast net/netlink/af_netlink.c:1544 [inline] nlmsg_multicast include/net/netlink.h:968 [inline] nlmsg_notify+0xa2/0x140 net/netlink/af_netlink.c:2543 __addrconf_sysctl_unregister net/ipv6/addrconf.c:6959 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:6983 [inline] addrconf_ifdown+0x1285/0x1480 net/ipv6/addrconf.c:3887 addrconf_notify+0x36f/0xe60 net/ipv6/addrconf.c:3669 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0x9d/0x110 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] rollback_registered_many+0xb88/0x11c0 net/core/dev.c:8616 rollback_registered net/core/dev.c:8658 [inline] unregister_netdevice_queue+0x2bb/0x470 net/core/dev.c:9754 unregister_netdevice include/linux/netdevice.h:2725 [inline] __tun_detach+0xedd/0x1980 drivers/net/tun.c:731 tun_detach drivers/net/tun.c:748 [inline] tun_chr_close+0x8e/0xd0 drivers/net/tun.c:3523 __fput+0x261/0x680 fs/file_table.c:281 task_work_run+0x186/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x1ba/0x1d0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881e1bf7000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 448 bytes inside of 512-byte region [ffff8881e1bf7000, ffff8881e1bf7200) The buggy address belongs to the page: page:ffffea000786fd00 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02500 raw: 0000000000000000 0000000080100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__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+0x2ab/0x6f0 mm/page_alloc.c:4857 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:2506 [inline] ___slab_alloc+0x320/0x4b0 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+0x197/0x2b0 mm/slub.c:3909 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:690 [inline] fib6_info_alloc+0x2c/0xd0 net/ipv6/ip6_fib.c:154 ip6_route_net_init+0x7a/0x770 net/ipv6/route.c:6230 ops_init+0x278/0x350 net/core/net_namespace.c:137 setup_net+0x1bb/0x9e0 net/core/net_namespace.c:338 copy_net_ns+0x2d4/0x470 net/core/net_namespace.c:479 create_new_namespaces+0x440/0x5e0 kernel/nsproxy.c:103 copy_namespaces+0x169/0x1b0 kernel/nsproxy.c:161 copy_process+0x12a4/0x3200 kernel/fork.c:2044 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+0x7ee/0x920 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4919 [inline] __free_pages+0x45/0x1e0 mm/page_alloc.c:4925 kfree+0x1ef/0x260 mm/slub.c:4068 device_release+0x70/0x1a0 drivers/base/core.c:1776 kobject_cleanup lib/kobject.c:708 [inline] kobject_release+0x1f3/0x3d0 lib/kobject.c:739 tun_set_iff+0xc0b/0x1050 drivers/net/tun.c:2906 __tun_chr_ioctl+0x6c7/0x1b70 drivers/net/tun.c:3149 do_vfs_ioctl+0x6d1/0x15b0 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Memory state around the buggy address: ffff8881e1bf7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e1bf7100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881e1bf7180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e1bf7200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e1bf7280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================