netlink: 8 bytes leftover after parsing attributes in process `syz.0.601'. netlink: 4 bytes leftover after parsing attributes in process `syz.0.601'. ================================================================== BUG: KASAN: use-after-free in read_pnet include/net/net_namespace.h:414 [inline] BUG: KASAN: use-after-free in dev_net include/linux/netdevice.h:2730 [inline] BUG: KASAN: use-after-free in nf_hook_entry_head+0x1f1/0x2c0 net/netfilter/core.c:319 Read of size 8 at addr ffff88806da84108 by task syz.0.601/8154 CPU: 1 UID: 0 PID: 8154 Comm: syz.0.601 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 read_pnet include/net/net_namespace.h:414 [inline] dev_net include/linux/netdevice.h:2730 [inline] nf_hook_entry_head+0x1f1/0x2c0 net/netfilter/core.c:319 __nf_unregister_net_hook+0x74/0x700 net/netfilter/core.c:491 nft_unregister_flowtable_ops net/netfilter/nf_tables_api.c:8977 [inline] __nft_unregister_flowtable_net_hooks net/netfilter/nf_tables_api.c:8992 [inline] nft_unregister_flowtable_net_hooks net/netfilter/nf_tables_api.c:9004 [inline] nf_tables_commit+0x4062/0xa1b0 net/netfilter/nf_tables_api.c:11163 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:576 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:649 [inline] nfnetlink_rcv+0x1ac9/0x2590 net/netfilter/nfnetlink.c:667 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:746 ____sys_sendmsg+0x505/0x830 net/socket.c:2634 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2688 __sys_sendmsg net/socket.c:2720 [inline] __do_sys_sendmsg net/socket.c:2725 [inline] __se_sys_sendmsg net/socket.c:2723 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2723 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f42e7f8f6c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f42e8d87038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f42e81e5fa0 RCX: 00007f42e7f8f6c9 RDX: 0000000000000000 RSI: 0000200000000080 RDI: 0000000000000007 RBP: 00007f42e8011f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f42e81e6038 R14: 00007f42e81e5fa0 R15: 00007ffe6cea8638 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88806da85a00 pfn:0x6da84 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea000161f408 ffffea0001de1208 0000000000000000 raw: ffff88806da85a00 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 8080, tgid 8079 (syz.0.578), ts 277130490521, free_ts 277692793744 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3920 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5209 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486 ___kmalloc_large_node+0x5f/0x1b0 mm/slub.c:5613 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:5644 __do_kmalloc_node mm/slub.c:5660 [inline] __kvmalloc_node_noprof+0x6e/0x910 mm/slub.c:7146 alloc_netdev_mqs+0xa8/0x1200 net/core/dev.c:12003 tun_set_iff+0x532/0xf00 drivers/net/tun.c:2778 __tun_chr_ioctl+0x795/0x1e10 drivers/net/tun.c:3088 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 8079 tgid 8079 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2948 free_large_kmalloc+0x13a/0x1f0 mm/slub.c:6812 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/0x570 lib/kobject.c:737 netdev_run_todo+0xf56/0x10c0 net/core/dev.c:11704 tun_detach drivers/net/tun.c:640 [inline] tun_chr_close+0x13c/0x1c0 drivers/net/tun.c:3436 __fput+0x44c/0xa70 fs/file_table.c:468 task_work_run+0x1d4/0x260 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:44 [inline] exit_to_user_mode_loop+0xff/0x4f0 kernel/entry/common.c:75 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] do_syscall_64+0x2e9/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88806da84000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806da84080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806da84100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806da84180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806da84200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================