[ 17.265673][ T253] ip (253) used greatest stack depth: 23952 bytes left [ 98.689220][ T627] ================================================================== [ 98.689529][ T627] BUG: KASAN: slab-use-after-free in kobject_put+0xbb/0xd0 [ 98.689807][ T627] Read of size 1 at addr ffff8880074916ac by task ip/627 [ 98.690008][ T627] [ 98.690095][ T627] CPU: 0 UID: 0 PID: 627 Comm: ip Not tainted 6.18.0-rc4-virtme #1 PREEMPT(full) [ 98.690102][ T627] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 98.690107][ T627] Call Trace: [ 98.690109][ T627] [ 98.690110][ T627] dump_stack_lvl+0x82/0xc0 [ 98.690116][ T627] print_address_description.constprop.0+0x2c/0x3a0 [ 98.690131][ T627] ? kobject_put+0xbb/0xd0 [ 98.690135][ T627] print_report+0xb4/0x270 [ 98.690138][ T627] ? kobject_put+0xbb/0xd0 [ 98.690141][ T627] ? kasan_addr_to_slab+0x21/0x70 [ 98.690144][ T627] ? kobject_put+0xbb/0xd0 [ 98.690147][ T627] kasan_report+0xca/0x100 [ 98.690151][ T627] ? kobject_put+0xbb/0xd0 [ 98.690156][ T627] kobject_put+0xbb/0xd0 [ 98.690159][ T627] netdev_run_todo+0x5f0/0xc60 [ 98.690166][ T627] ? dev_ingress_queue_create+0x190/0x190 [ 98.690169][ T627] ? generic_xdp_install+0x410/0x410 [ 98.690173][ T627] ? vrf_dellink+0xff/0x150 [vrf] [ 98.690180][ T627] ? vrf_map_unregister_dev+0x480/0x480 [vrf] [ 98.690184][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.690200][ T627] rtnl_dellink+0x350/0xa30 [ 98.690206][ T627] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 98.690225][ T627] ? find_held_lock+0x2b/0x80 [ 98.690230][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.690235][ T627] ? find_held_lock+0x2b/0x80 [ 98.690241][ T627] ? rtnetlink_rcv_msg+0x6e6/0xc00 [ 98.690243][ T627] ? __lock_release+0x5d/0x170 [ 98.690248][ T627] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 98.690251][ T627] rtnetlink_rcv_msg+0x709/0xc00 [ 98.690255][ T627] ? rtnl_port_fill+0x850/0x850 [ 98.690257][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.690264][ T627] netlink_rcv_skb+0x121/0x340 [ 98.690270][ T627] ? rtnl_port_fill+0x850/0x850 [ 98.690274][ T627] ? netlink_ack+0xdd0/0xdd0 [ 98.690280][ T627] ? netlink_deliver_tap+0x13e/0x340 [ 98.690283][ T627] ? netlink_deliver_tap+0xc3/0x340 [ 98.690287][ T627] netlink_unicast+0x4aa/0x780 [ 98.690291][ T627] ? netlink_attachskb+0x810/0x810 [ 98.690294][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.690300][ T627] netlink_sendmsg+0x714/0xbd0 [ 98.690304][ T627] ? netlink_unicast+0x780/0x780 [ 98.690308][ T627] ? __import_iovec+0x230/0x3b0 [ 98.690316][ T627] ? netlink_unicast+0x780/0x780 [ 98.690321][ T627] ____sys_sendmsg+0x3dd/0x890 [ 98.690328][ T627] ? get_timestamp.constprop.0+0x380/0x380 [ 98.690331][ T627] ? __copy_msghdr+0x3c0/0x3c0 [ 98.690339][ T627] ___sys_sendmsg+0xed/0x170 [ 98.690342][ T627] ? kasan_record_aux_stack+0x8c/0xa0 [ 98.690345][ T627] ? __call_rcu_common.constprop.0+0xa8/0x630 [ 98.690357][ T627] ? copy_msghdr_from_user+0x110/0x110 [ 98.690362][ T627] ? find_held_lock+0x2b/0x80 [ 98.690366][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.690372][ T627] ? find_held_lock+0x2b/0x80 [ 98.690375][ T627] ? __virt_addr_valid+0x22a/0x450 [ 98.690389][ T627] ? __lock_release+0x5d/0x170 [ 98.690395][ T627] __sys_sendmsg+0x10b/0x1a0 [ 98.690398][ T627] ? __call_rcu_common.constprop.0+0x318/0x630 [ 98.690404][ T627] ? __sys_sendmsg_sock+0x20/0x20 [ 98.690416][ T627] ? rcu_is_watching+0x12/0xb0 [ 98.690422][ T627] do_syscall_64+0xc1/0xfd0 [ 98.690432][ T627] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 98.690442][ T627] RIP: 0033:0x7f36c5ee41d7 [ 98.690448][ T627] Code: 0e 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 98.690451][ T627] RSP: 002b:00007ffd6fea0fa8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 98.690458][ T627] RAX: ffffffffffffffda RBX: 00007ffd6fea16d0 RCX: 00007f36c5ee41d7 [ 98.690460][ T627] RDX: 0000000000000000 RSI: 00007ffd6fea1010 RDI: 0000000000000005 [ 98.690462][ T627] RBP: 0000000000000002 R08: 0000000000000003 R09: 0000000000000078 [ 98.690463][ T627] R10: 00007f36c5de0f60 R11: 0000000000000246 R12: 0000000000000002 [ 98.690465][ T627] R13: 00000000690debfb R14: 0000000000499600 R15: 0000000000000000 [ 98.690471][ T627] [ 98.690472][ T627] [ 98.703288][ T627] Allocated by task 338: [ 98.703417][ T627] kasan_save_stack+0x24/0x40 [ 98.703596][ T627] kasan_save_track+0x14/0x30 [ 98.703770][ T627] __kasan_kmalloc+0x7b/0x90 [ 98.703938][ T627] __kvmalloc_node_noprof+0x2e5/0x8e0 [ 98.704111][ T627] alloc_netdev_mqs+0x7d/0x1370 [ 98.704277][ T627] rtnl_create_link+0xa9e/0xe20 [ 98.704448][ T627] rtnl_newlink_create+0x203/0x770 [ 98.704616][ T627] __rtnl_newlink+0x231/0xa30 [ 98.704787][ T627] rtnl_newlink+0x693/0xa60 [ 98.704951][ T627] rtnetlink_rcv_msg+0x709/0xc00 [ 98.705117][ T627] netlink_rcv_skb+0x121/0x340 [ 98.705280][ T627] netlink_unicast+0x4aa/0x780 [ 98.705453][ T627] netlink_sendmsg+0x714/0xbd0 [ 98.705622][ T627] ____sys_sendmsg+0x3dd/0x890 [ 98.705799][ T627] ___sys_sendmsg+0xed/0x170 [ 98.705968][ T627] __sys_sendmsg+0x10b/0x1a0 [ 98.706131][ T627] do_syscall_64+0xc1/0xfd0 [ 98.706296][ T627] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 98.706506][ T627] [ 98.706631][ T627] Freed by task 627: [ 98.706776][ T627] kasan_save_stack+0x24/0x40 [ 98.706952][ T627] kasan_save_track+0x14/0x30 [ 98.707143][ T627] __kasan_save_free_info+0x3b/0x60 [ 98.707317][ T627] __kasan_slab_free+0x3f/0x60 [ 98.707491][ T627] kfree+0x21d/0x540 [ 98.707618][ T627] device_release+0x9c/0x210 [ 98.707808][ T627] kobject_cleanup+0xfe/0x360 [ 98.707992][ T627] netdev_run_todo+0x81f/0xc60 [ 98.708180][ T627] rtnl_dellink+0x350/0xa30 [ 98.708358][ T627] rtnetlink_rcv_msg+0x709/0xc00 [ 98.708537][ T627] netlink_rcv_skb+0x121/0x340 [ 98.708715][ T627] netlink_unicast+0x4aa/0x780 [ 98.708953][ T627] netlink_sendmsg+0x714/0xbd0 [ 98.709131][ T627] ____sys_sendmsg+0x3dd/0x890 [ 98.709300][ T627] ___sys_sendmsg+0xed/0x170 [ 98.709505][ T627] __sys_sendmsg+0x10b/0x1a0 [ 98.709691][ T627] do_syscall_64+0xc1/0xfd0 [ 98.709876][ T627] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 98.710100][ T627] [ 98.710195][ T627] The buggy address belongs to the object at ffff888007491000 [ 98.710195][ T627] which belongs to the cache kmalloc-4k of size 4096 [ 98.710655][ T627] The buggy address is located 1708 bytes inside of [ 98.710655][ T627] freed 4096-byte region [ffff888007491000, ffff888007492000) [ 98.711117][ T627] [ 98.711215][ T627] The buggy address belongs to the physical page: [ 98.711454][ T627] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7490 [ 98.711798][ T627] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 98.712079][ T627] flags: 0x80000000000040(head|node=0|zone=1) [ 98.712313][ T627] page_type: f5(slab) [ 98.712455][ T627] raw: 0080000000000040 ffff888001043700 ffffea0000172e10 ffffea0000207810 [ 98.712788][ T627] raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 [ 98.713109][ T627] head: 0080000000000040 ffff888001043700 ffffea0000172e10 ffffea0000207810 [ 98.713417][ T627] head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 [ 98.713727][ T627] head: 0080000000000003 ffffea00001d2401 00000000ffffffff 00000000ffffffff [ 98.714045][ T627] head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 98.714330][ T627] page dumped because: kasan: bad access detected [ 98.714535][ T627] [ 98.714617][ T627] Memory state around the buggy address: [ 98.714788][ T627] ffff888007491580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 98.715039][ T627] ffff888007491600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 98.715272][ T627] >ffff888007491680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 98.715508][ T627] ^ [ 98.715663][ T627] ffff888007491700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 98.715907][ T627] ffff888007491780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 98.716154][ T627] ================================================================== [ 98.716454][ T627] Disabling lock debugging due to kernel taint [ 98.716711][ T627] ------------[ cut here ]------------ [ 98.716886][ T627] refcount_t: underflow; use-after-free. [ 98.717118][ T627] WARNING: CPU: 3 PID: 627 at lib/refcount.c:28 refcount_warn_saturate+0x16f/0x1b0 [ 98.717481][ T627] Modules linked in: vrf veth [ 98.717686][ T627] CPU: 3 UID: 0 PID: 627 Comm: ip Tainted: G B 6.18.0-rc4-virtme #1 PREEMPT(full) [ 98.718005][ T627] Tainted: [B]=BAD_PAGE [ 98.718127][ T627] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 98.718369][ T627] RIP: 0010:refcount_warn_saturate+0x16f/0x1b0 [ 98.718737][ T627] Code: 7d 93 02 80 fb 01 0f 87 bb 99 d9 fe 83 e3 01 0f 85 51 ff ff ff c6 05 a8 7d 93 02 01 90 48 c7 c7 60 8d e5 a6 e8 32 bf 18 ff 90 <0f> 0b 90 90 e9 33 ff ff ff 48 89 df e8 b0 63 a1 ff e9 ba fe ff ff [ 98.719681][ T627] RSP: 0018:ffffc900010b71f0 EFLAGS: 00010286 [ 98.720028][ T627] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [ 98.720280][ T627] RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000001 [ 98.720551][ T627] RBP: 0000000000000003 R08: 0000000000000000 R09: fffffbfff4efe134 [ 98.721015][ T627] R10: 0000000000000003 R11: ffffc900010b6d80 R12: 0000000000000001 [ 98.721439][ T627] R13: dffffc0000000000 R14: dead000000000122 R15: dead000000000100 [ 98.721851][ T627] FS: 00007f36c5d16800(0000) GS:ffff88808d772000(0000) knlGS:0000000000000000 [ 98.722359][ T627] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 98.722733][ T627] CR2: 00000000004061e9 CR3: 00000000054fd003 CR4: 0000000000772ef0 [ 98.723146][ T627] PKRU: 55555554 [ 98.723328][ T627] Call Trace: [ 98.723456][ T627] [ 98.723562][ T627] netdev_run_todo+0x5f0/0xc60 [ 98.723741][ T627] ? dev_ingress_queue_create+0x190/0x190 [ 98.723904][ T627] ? generic_xdp_install+0x410/0x410 [ 98.724068][ T627] ? vrf_dellink+0xff/0x150 [vrf] [ 98.724227][ T627] ? vrf_map_unregister_dev+0x480/0x480 [vrf] [ 98.724430][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.724610][ T627] rtnl_dellink+0x350/0xa30 [ 98.724772][ T627] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 98.724989][ T627] ? find_held_lock+0x2b/0x80 [ 98.725147][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.725309][ T627] ? find_held_lock+0x2b/0x80 [ 98.725483][ T627] ? rtnetlink_rcv_msg+0x6e6/0xc00 [ 98.725655][ T627] ? __lock_release+0x5d/0x170 [ 98.725817][ T627] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 98.726030][ T627] rtnetlink_rcv_msg+0x709/0xc00 [ 98.726207][ T627] ? rtnl_port_fill+0x850/0x850 [ 98.726379][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.726584][ T627] netlink_rcv_skb+0x121/0x340 [ 98.726770][ T627] ? rtnl_port_fill+0x850/0x850 [ 98.727009][ T627] ? netlink_ack+0xdd0/0xdd0 [ 98.727188][ T627] ? netlink_deliver_tap+0x13e/0x340 [ 98.727361][ T627] ? netlink_deliver_tap+0xc3/0x340 [ 98.727564][ T627] netlink_unicast+0x4aa/0x780 [ 98.727758][ T627] ? netlink_attachskb+0x810/0x810 [ 98.727932][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.728125][ T627] netlink_sendmsg+0x714/0xbd0 [ 98.728316][ T627] ? netlink_unicast+0x780/0x780 [ 98.728483][ T627] ? __import_iovec+0x230/0x3b0 [ 98.728749][ T627] ? netlink_unicast+0x780/0x780 [ 98.729023][ T627] ____sys_sendmsg+0x3dd/0x890 [ 98.729241][ T627] ? get_timestamp.constprop.0+0x380/0x380 [ 98.729453][ T627] ? __copy_msghdr+0x3c0/0x3c0 [ 98.729653][ T627] ___sys_sendmsg+0xed/0x170 [ 98.729809][ T627] ? kasan_record_aux_stack+0x8c/0xa0 [ 98.729997][ T627] ? __call_rcu_common.constprop.0+0xa8/0x630 [ 98.730194][ T627] ? copy_msghdr_from_user+0x110/0x110 [ 98.730377][ T627] ? find_held_lock+0x2b/0x80 [ 98.730620][ T627] ? __lock_acquire+0x449/0x7e0 [ 98.730805][ T627] ? find_held_lock+0x2b/0x80 [ 98.730999][ T627] ? __virt_addr_valid+0x22a/0x450 [ 98.731166][ T627] ? __lock_release+0x5d/0x170 [ 98.731330][ T627] __sys_sendmsg+0x10b/0x1a0 [ 98.731678][ T627] ? __call_rcu_common.constprop.0+0x318/0x630 [ 98.731972][ T627] ? __sys_sendmsg_sock+0x20/0x20 [ 98.732137][ T627] ? rcu_is_watching+0x12/0xb0 [ 98.732400][ T627] do_syscall_64+0xc1/0xfd0 [ 98.732610][ T627] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 98.732807][ T627] RIP: 0033:0x7f36c5ee41d7 [ 98.732984][ T627] Code: 0e 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 98.733816][ T627] RSP: 002b:00007ffd6fea0fa8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 98.734080][ T627] RAX: ffffffffffffffda RBX: 00007ffd6fea16d0 RCX: 00007f36c5ee41d7 [ 98.734328][ T627] RDX: 0000000000000000 RSI: 00007ffd6fea1010 RDI: 0000000000000005 [ 98.734600][ T627] RBP: 0000000000000002 R08: 0000000000000003 R09: 0000000000000078 [ 98.734954][ T627] R10: 00007f36c5de0f60 R11: 0000000000000246 R12: 0000000000000002 [ 98.735302][ T627] R13: 00000000690debfb R14: 0000000000499600 R15: 0000000000000000 [ 98.735673][ T627] [ 98.735804][ T627] irq event stamp: 51281 [ 98.735935][ T627] hardirqs last enabled at (51281): [] finish_task_switch.isra.0+0x245/0x960 [ 98.736248][ T627] hardirqs last disabled at (51280): [] __schedule+0x94a/0x1b10 [ 98.736568][ T627] softirqs last enabled at (50916): [] handle_softirqs+0x352/0x610 [ 98.736965][ T627] softirqs last disabled at (50909): [] irq_exit_rcu+0xab/0x100 [ 98.737330][ T627] ---[ end trace 0000000000000000 ]---