================================================================== BUG: KASAN: use-after-free in netdev_need_ops_lock include/net/netdev_lock.h:30 [inline] BUG: KASAN: use-after-free in netdev_unlock_ops include/net/netdev_lock.h:47 [inline] BUG: KASAN: use-after-free in __linkwatch_run_queue+0x69b/0x7e0 net/core/link_watch.c:245 Read of size 1 at addr ffff88805718ccc5 by task kworker/u8:1/13 CPU: 0 UID: 0 PID: 13 Comm: kworker/u8:1 Not tainted 6.16.0-rc2-syzkaller-00162-g41687a5c6f8b #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: events_unbound linkwatch_event Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 netdev_need_ops_lock include/net/netdev_lock.h:30 [inline] netdev_unlock_ops include/net/netdev_lock.h:47 [inline] __linkwatch_run_queue+0x69b/0x7e0 net/core/link_watch.c:245 linkwatch_event+0x4c/0x60 net/core/link_watch.c:304 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88805718e080 pfn:0x5718c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea000120c308 ffffea0001e57e08 0000000000000000 raw: ffff88805718e080 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x446dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_COMP), pid 12116, tgid 12108 (syz.1.1674), ts 575212134853, free_ts 576536570533 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 __alloc_pages_noprof+0xa/0x30 mm/page_alloc.c:4993 __alloc_pages_node_noprof include/linux/gfp.h:284 [inline] alloc_pages_node_noprof include/linux/gfp.h:311 [inline] ___kmalloc_large_node+0x85/0x210 mm/slub.c:4272 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:4300 __do_kmalloc_node mm/slub.c:4316 [inline] __kvmalloc_node_noprof+0x6d/0x5f0 mm/slub.c:5015 alloc_netdev_mqs+0xa6/0x11e0 net/core/dev.c:11711 tun_set_iff+0x532/0xef0 drivers/net/tun.c:2752 __tun_chr_ioctl+0x788/0x1df0 drivers/net/tun.c:3048 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 12108 tgid 12108 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0xc71/0xe70 mm/page_alloc.c:2706 __folio_put+0x21b/0x2c0 mm/swap.c:112 folio_put include/linux/mm.h:1356 [inline] free_large_kmalloc+0x145/0x200 mm/slub.c:4768 device_release+0x9c/0x1c0 drivers/base/core.c:-1 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22b/0x480 lib/kobject.c:737 netdev_run_todo+0xd2e/0xea0 net/core/dev.c:11412 tun_detach drivers/net/tun.c:639 [inline] tun_chr_close+0x13c/0x1c0 drivers/net/tun.c:3396 __fput+0x44c/0xa70 fs/file_table.c:465 task_work_run+0x1d1/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:114 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline] do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805718cb80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805718cc00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805718cc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805718cd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805718cd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================