================================================================== BUG: KASAN: slab-use-after-free in macvlan_forward_source+0x5d8/0x700 drivers/net/macvlan.c:442 Read of size 2 at addr ffff88807ffe0dfc by task syz.2.1748/12017 CPU: 0 UID: 0 PID: 12017 Comm: syz.2.1748 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0xe8/0x150 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 macvlan_forward_source+0x5d8/0x700 drivers/net/macvlan.c:442 macvlan_handle_frame+0x1ba/0x12e0 drivers/net/macvlan.c:501 __netif_receive_skb_core+0x95f/0x2f90 net/core/dev.c:6039 __netif_receive_skb_one_core net/core/dev.c:6150 [inline] __netif_receive_skb+0x72/0x380 net/core/dev.c:6265 netif_receive_skb_internal net/core/dev.c:6351 [inline] netif_receive_skb+0x1bb/0x750 net/core/dev.c:6410 tun_rx_batched+0x1b9/0x730 drivers/net/tun.c:1485 tun_get_user+0x2aa3/0x3dc0 drivers/net/tun.c:1953 tun_chr_write_iter+0x113/0x200 drivers/net/tun.c:1999 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x5c9/0xb30 fs/read_write.c:686 ksys_write+0x145/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7d1918e1ff Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 f9 92 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 4c 93 02 00 48 RSP: 002b:00007f7d1a087000 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f7d193e6090 RCX: 00007f7d1918e1ff RDX: 00000000000000e2 RSI: 0000200000000b80 RDI: 00000000000000c8 RBP: 00007f7d19213f91 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000000e2 R11: 0000000000000293 R12: 0000000000000000 R13: 00007f7d193e6128 R14: 00007f7d193e6090 R15: 00007ffdaab61888 Allocated by task 11983: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5657 [inline] __kvmalloc_node_noprof+0x5d5/0x920 mm/slub.c:7136 alloc_netdev_mqs+0xa6/0x11b0 net/core/dev.c:12012 rtnl_create_link+0x31f/0xcf0 net/core/rtnetlink.c:3648 rtnl_newlink_create+0x25c/0xb00 net/core/rtnetlink.c:3830 __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0x16e7/0x1c90 net/core/rtnetlink.c:4072 rtnetlink_rcv_msg+0x7cf/0xb70 net/core/rtnetlink.c:6958 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2550 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:742 ____sys_sendmsg+0x505/0x820 net/socket.c:2592 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 11983: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6670 [inline] kfree+0x1c0/0x660 mm/slub.c:6878 rtnl_newlink_create+0x373/0xb00 net/core/rtnetlink.c:3844 __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0x16e7/0x1c90 net/core/rtnetlink.c:4072 rtnetlink_rcv_msg+0x7cf/0xb70 net/core/rtnetlink.c:6958 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2550 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:742 ____sys_sendmsg+0x505/0x820 net/socket.c:2592 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807ffe0000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 3580 bytes inside of freed 4096-byte region [ffff88807ffe0000, ffff88807ffe1000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88807ffe4000 pfn:0x7ffe0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888032dc8e81 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88813ffb0500 ffffea0001e77610 ffffea0001ea1810 raw: ffff88807ffe4000 0000000000040003 00000000f5000000 ffff888032dc8e81 head: 00fff00000000240 ffff88813ffb0500 ffffea0001e77610 ffffea0001ea1810 head: ffff88807ffe4000 0000000000040003 00000000f5000000 ffff888032dc8e81 head: 00fff00000000003 ffffea0001fff801 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 9848, tgid 9847 (syz.2.1099), ts 154022028932, free_ts 153736238007 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x234/0x290 mm/page_alloc.c:1857 prep_new_page mm/page_alloc.c:1865 [inline] get_page_from_freelist+0x24e0/0x2580 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5210 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab+0x86/0x3b0 mm/slub.c:3248 new_slab mm/slub.c:3302 [inline] ___slab_alloc+0xe53/0x1820 mm/slub.c:4656 __slab_alloc+0x65/0x100 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_node_track_caller_noprof+0x5d4/0x820 mm/slub.c:5764 kmemdup_noprof+0x2b/0x70 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:765 [inline] __addrconf_sysctl_register+0x9e/0x4c0 net/ipv6/addrconf.c:7305 addrconf_sysctl_register+0x168/0x1c0 net/ipv6/addrconf.c:7371 ipv6_add_dev+0xd26/0x13a0 net/ipv6/addrconf.c:460 addrconf_notify+0x771/0x1050 net/ipv6/addrconf.c:3650 notifier_call_chain+0x19d/0x3a0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2281 [inline] call_netdevice_notifiers net/core/dev.c:2295 [inline] register_netdevice+0x15c6/0x1a70 net/core/dev.c:11444 register_netdev+0x40/0x60 net/core/dev.c:11522 page last free pid 9848 tgid 9847 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0xbc8/0xd30 mm/page_alloc.c:2943 discard_slab mm/slub.c:3346 [inline] __put_partials+0x146/0x170 mm/slub.c:3886 __slab_free+0x294/0x320 mm/slub.c:5952 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_node_track_caller_noprof+0x526/0x820 mm/slub.c:5764 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x42/0x100 mm/util.c:84 __kernfs_new_node+0x9c/0x8a0 fs/kernfs/dir.c:633 kernfs_new_node+0x102/0x210 fs/kernfs/dir.c:718 __kernfs_create_file+0x4b/0x2e0 fs/kernfs/file.c:1057 sysfs_add_file_mode_ns+0x238/0x300 fs/sysfs/file.c:313 create_files fs/sysfs/group.c:82 [inline] internal_create_group+0x667/0x1170 fs/sysfs/group.c:189 internal_create_groups fs/sysfs/group.c:229 [inline] sysfs_create_groups+0x59/0x120 fs/sysfs/group.c:255 setup_gid_attrs drivers/infiniband/core/sysfs.c:1162 [inline] ib_setup_port_attrs+0x140c/0x2070 drivers/infiniband/core/sysfs.c:1439 add_one_compat_dev+0x449/0x650 drivers/infiniband/core/device.c:1005 Memory state around the buggy address: ffff88807ffe0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ffe0d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807ffe0d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807ffe0e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807ffe0e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================