================================================================== BUG: KASAN: slab-use-after-free in ipvlan_get_iflink+0x70/0x80 drivers/net/ipvlan/ipvlan_main.c:353 Read of size 4 at addr ffff88804af4a0e0 by task kworker/u32:9/1138 CPU: 0 UID: 0 PID: 1138 Comm: kworker/u32:9 Not tainted 6.11.0-syzkaller-11558-g075dbe9f6e3c #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events_unbound linkwatch_event Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 ipvlan_get_iflink+0x70/0x80 drivers/net/ipvlan/ipvlan_main.c:353 dev_get_iflink+0x73/0xf0 net/core/dev.c:674 default_operstate net/core/link_watch.c:45 [inline] rfc2863_policy+0xbe/0x340 net/core/link_watch.c:67 linkwatch_do_dev+0x30/0x160 net/core/link_watch.c:170 __linkwatch_run_queue+0x233/0x690 net/core/link_watch.c:234 linkwatch_event+0x8f/0xc0 net/core/link_watch.c:277 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 5350: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4265 [inline] __kmalloc_node_noprof+0x211/0x430 mm/slub.c:4271 __kvmalloc_node_noprof+0xad/0x1a0 mm/util.c:658 alloc_netdev_mqs+0xd1/0x1420 net/core/dev.c:11093 rtnl_create_link+0xc10/0xfa0 net/core/rtnetlink.c:3374 rtnl_newlink_create net/core/rtnetlink.c:3500 [inline] __rtnl_newlink+0x10ae/0x1920 net/core/rtnetlink.c:3730 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3743 rtnetlink_rcv_msg+0x3c7/0xea0 net/core/rtnetlink.c:6646 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x479/0x4d0 net/socket.c:2210 __do_sys_sendto net/socket.c:2222 [inline] __se_sys_sendto net/socket.c:2218 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2218 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6176: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2343 [inline] slab_free mm/slub.c:4580 [inline] kfree+0x14f/0x4b0 mm/slub.c:4728 kvfree+0x47/0x50 mm/util.c:701 device_release+0xa1/0x240 drivers/base/core.c:2582 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1e4/0x5a0 lib/kobject.c:737 netdev_run_todo+0x7bc/0x12d0 net/core/dev.c:10812 rtnl_unlock net/core/rtnetlink.c:152 [inline] rtnetlink_rcv_msg+0x3d7/0xea0 net/core/rtnetlink.c:6647 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2550 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x53c/0x7f0 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0xaaf/0xc90 net/socket.c:2603 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2657 __sys_sendmsg+0x117/0x1f0 net/socket.c:2686 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88804af4a000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 224 bytes inside of freed 4096-byte region [ffff88804af4a000, ffff88804af4b000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4af48 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b050280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000040004 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801b050280 dead000000000122 0000000000000000 head: 0000000000000000 0000000000040004 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00012bd201 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 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 5350, tgid 5350 (syz-executor), ts 47655733486, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x101e/0x3070 mm/page_alloc.c:3457 __alloc_pages_noprof+0x223/0x25c0 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2413 [inline] allocate_slab mm/slub.c:2579 [inline] new_slab+0x28b/0x3f0 mm/slub.c:2632 ___slab_alloc+0xd1d/0x16f0 mm/slub.c:3819 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3909 __slab_alloc_node mm/slub.c:3962 [inline] slab_alloc_node mm/slub.c:4123 [inline] __do_kmalloc_node mm/slub.c:4264 [inline] __kmalloc_noprof+0x367/0x400 mm/slub.c:4277 kmalloc_noprof include/linux/slab.h:882 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] __register_sysctl_table+0xb4/0x1910 fs/proc/proc_sysctl.c:1368 __addrconf_sysctl_register+0x1a3/0x360 net/ipv6/addrconf.c:7224 addrconf_sysctl_register net/ipv6/addrconf.c:7272 [inline] addrconf_sysctl_register+0x15f/0x1f0 net/ipv6/addrconf.c:7261 ipv6_add_dev+0x9d7/0x1400 net/ipv6/addrconf.c:456 addrconf_notify+0x53e/0x19c0 net/ipv6/addrconf.c:3655 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] register_netdevice+0x17a0/0x1e90 net/core/dev.c:10520 page_owner free stack trace missing Memory state around the buggy address: ffff88804af49f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804af4a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804af4a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804af4a100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804af4a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================