================================================================== BUG: KASAN: slab-out-of-bounds in __write_once_size include/linux/compiler.h:295 [inline] BUG: KASAN: slab-out-of-bounds in __hlist_del include/linux/list.h:789 [inline] BUG: KASAN: slab-out-of-bounds in detach_timer kernel/time/timer.c:824 [inline] BUG: KASAN: slab-out-of-bounds in detach_if_pending+0x12d/0x330 kernel/time/timer.c:841 Write of size 8 at addr ffff8881cb53b1c0 by task syz-executor/3203 CPU: 1 PID: 3203 Comm: syz-executor Tainted: G W 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 __write_once_size include/linux/compiler.h:295 [inline] __hlist_del include/linux/list.h:789 [inline] detach_timer kernel/time/timer.c:824 [inline] detach_if_pending+0x12d/0x330 kernel/time/timer.c:841 try_to_del_timer_sync kernel/time/timer.c:1267 [inline] del_timer_sync+0x136/0x1a0 kernel/time/timer.c:1410 tun_flow_uninit+0x2f/0x2b0 drivers/net/tun.c:1452 tun_free_netdev+0x7a/0x1b0 drivers/net/tun.c:2404 netdev_run_todo+0xa45/0xc70 net/core/dev.c:9477 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 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa43/0x2660 kernel/exit.c:861 do_group_exit+0x13e/0x300 kernel/exit.c:984 __do_sys_exit_group kernel/exit.c:995 [inline] __se_sys_exit_group kernel/exit.c:993 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:993 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f271b734969 Code: Bad RIP value. RSP: 002b:00007ffff7b40588 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f271b734969 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000043 RBP: 00007f271b7948f0 R08: 00007ffff7b3e327 R09: 0000000000000003 R10: 0000000000000009 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000003 R14: 00000000ffffffff R15: 00007ffff7b40740 Allocated by task 3203: 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_kmalloc+0xd/0x20 mm/kasan/common.c:543 __kmalloc+0x12a/0x2f0 mm/slub.c:3913 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:690 [inline] new_dir fs/proc/proc_sysctl.c:973 [inline] get_subdir fs/proc/proc_sysctl.c:1018 [inline] __register_sysctl_table+0x921/0x1130 fs/proc/proc_sysctl.c:1361 register_net_sysctl+0x2c/0x40 net/sysctl_net.c:121 neigh_sysctl_register+0x998/0xa70 net/core/neighbour.c:3718 devinet_sysctl_register+0xaf/0x1e0 net/ipv4/devinet.c:2639 inetdev_init+0x28a/0x430 net/ipv4/devinet.c:277 inetdev_event+0x1f8/0x1030 net/ipv4/devinet.c:1545 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] register_netdevice+0xeb9/0x12a0 net/core/dev.c:9240 veth_newlink+0x84f/0xb70 drivers/net/veth.c:1329 __rtnl_newlink net/core/rtnetlink.c:3255 [inline] rtnl_newlink+0x104c/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 0: (stack is not available) The buggy address belongs to the object at ffff8881cb53b000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 448 bytes inside of 512-byte region [ffff8881cb53b000, ffff8881cb53b200) The buggy address belongs to the page: page:ffffea00072d4e00 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 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+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] kmem_cache_alloc_trace+0x130/0x290 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] kmalloc_array include/linux/slab.h:617 [inline] rtnl_newlink+0xff/0x15f0 net/core/rtnetlink.c:3310 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 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 netdev_freemem+0x3f/0x60 net/core/dev.c:9583 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1743 device_release+0x70/0x1a0 drivers/base/core.c:1776 kobject_cleanup lib/kobject.c:716 [inline] kobject_release lib/kobject.c:747 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fe/0x2c0 lib/kobject.c:764 put_device+0x1f/0x30 drivers/base/core.c:3010 free_netdev+0x27e/0x320 net/core/dev.c:9746 tun_set_iff+0x87c/0xe00 drivers/net/tun.c:2924 __tun_chr_ioctl+0x771/0x18a0 drivers/net/tun.c:3187 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:3470 do_vfs_ioctl+0x753/0x13f0 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+0xe1/0x120 fs/ioctl.c:747 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 Memory state around the buggy address: ffff8881cb53b080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881cb53b100: 04 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881cb53b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881cb53b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881cb53b280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================