[ 18.498630][ T292] ================================================================== [ 18.499016][ T292] BUG: KASAN: slab-use-after-free in kobject_put+0xbb/0xd0 [ 18.499290][ T292] Read of size 1 at addr ffff888004d0a6ac by task ip/292 [ 18.499507][ T292] [ 18.499605][ T292] CPU: 2 UID: 0 PID: 292 Comm: ip Not tainted 6.18.0-rc4-virtme #1 PREEMPT(full) [ 18.499610][ T292] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 18.499612][ T292] Call Trace: [ 18.499614][ T292] [ 18.499615][ T292] dump_stack_lvl+0x82/0xc0 [ 18.499622][ T292] print_address_description.constprop.0+0x2c/0x3a0 [ 18.499628][ T292] ? kobject_put+0xbb/0xd0 [ 18.499632][ T292] print_report+0xb4/0x270 [ 18.499635][ T292] ? kobject_put+0xbb/0xd0 [ 18.499639][ T292] ? kasan_addr_to_slab+0x21/0x70 [ 18.499642][ T292] ? kobject_put+0xbb/0xd0 [ 18.499645][ T292] kasan_report+0xca/0x100 [ 18.499649][ T292] ? kobject_put+0xbb/0xd0 [ 18.499658][ T292] kobject_put+0xbb/0xd0 [ 18.499663][ T292] netdev_run_todo+0x5f0/0xc60 [ 18.499670][ T292] ? dev_ingress_queue_create+0x190/0x190 [ 18.499675][ T292] ? generic_xdp_install+0x410/0x410 [ 18.499678][ T292] ? kernfs_put.part.0+0x12d/0x480 [ 18.499685][ T292] ? unregister_netdevice_many+0x20/0x20 [ 18.499690][ T292] ? br_dev_delete+0x115/0x1a0 [bridge] [ 18.499732][ T292] rtnl_dellink+0x350/0xa30 [ 18.499737][ T292] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 18.499756][ T292] ? find_held_lock+0x2b/0x80 [ 18.499762][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.499768][ T292] ? find_held_lock+0x2b/0x80 [ 18.499772][ T292] ? rtnetlink_rcv_msg+0x6e6/0xc00 [ 18.499774][ T292] ? __lock_release+0x5d/0x170 [ 18.499779][ T292] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 18.499782][ T292] rtnetlink_rcv_msg+0x709/0xc00 [ 18.499785][ T292] ? rtnl_port_fill+0x850/0x850 [ 18.499788][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.499795][ T292] netlink_rcv_skb+0x121/0x340 [ 18.499807][ T292] ? rtnl_port_fill+0x850/0x850 [ 18.499811][ T292] ? netlink_ack+0xdd0/0xdd0 [ 18.499817][ T292] ? netlink_deliver_tap+0x13e/0x340 [ 18.499820][ T292] ? netlink_deliver_tap+0xc3/0x340 [ 18.499824][ T292] netlink_unicast+0x4aa/0x780 [ 18.499828][ T292] ? netlink_attachskb+0x810/0x810 [ 18.499832][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.499842][ T292] netlink_sendmsg+0x714/0xbd0 [ 18.499846][ T292] ? netlink_unicast+0x780/0x780 [ 18.499850][ T292] ? __import_iovec+0x230/0x3b0 [ 18.499863][ T292] ? netlink_unicast+0x780/0x780 [ 18.499869][ T292] ____sys_sendmsg+0x3dd/0x890 [ 18.499877][ T292] ? get_timestamp.constprop.0+0x380/0x380 [ 18.499882][ T292] ? __copy_msghdr+0x3c0/0x3c0 [ 18.499893][ T292] ___sys_sendmsg+0xed/0x170 [ 18.499897][ T292] ? kasan_record_aux_stack+0x8c/0xa0 [ 18.499900][ T292] ? __call_rcu_common.constprop.0+0xa8/0x630 [ 18.499907][ T292] ? copy_msghdr_from_user+0x110/0x110 [ 18.499912][ T292] ? find_held_lock+0x2b/0x80 [ 18.499917][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.499922][ T292] ? find_held_lock+0x2b/0x80 [ 18.499926][ T292] ? __virt_addr_valid+0x22a/0x450 [ 18.499931][ T292] ? __lock_release+0x5d/0x170 [ 18.499937][ T292] __sys_sendmsg+0x10b/0x1a0 [ 18.499941][ T292] ? __call_rcu_common.constprop.0+0x318/0x630 [ 18.499944][ T292] ? __sys_sendmsg_sock+0x20/0x20 [ 18.499952][ T292] ? rcu_is_watching+0x12/0xb0 [ 18.499956][ T292] do_syscall_64+0xc1/0xfd0 [ 18.499962][ T292] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 18.499966][ T292] RIP: 0033:0x7f6fae4221d7 [ 18.499971][ T292] 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 [ 18.499974][ T292] RSP: 002b:00007fff188597f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 18.499977][ T292] RAX: ffffffffffffffda RBX: 00007fff18859f20 RCX: 00007f6fae4221d7 [ 18.499979][ T292] RDX: 0000000000000000 RSI: 00007fff18859860 RDI: 0000000000000005 [ 18.499981][ T292] RBP: 0000000000000002 R08: 0000000000000003 R09: 0000000000000078 [ 18.499983][ T292] R10: 00007f6fae31ef60 R11: 0000000000000246 R12: 0000000000000002 [ 18.499984][ T292] R13: 00000000690df626 R14: 0000000000499600 R15: 0000000000000000 [ 18.499991][ T292] [ 18.499992][ T292] [ 18.513790][ T292] Allocated by task 285: [ 18.513946][ T292] kasan_save_stack+0x24/0x40 [ 18.514144][ T292] kasan_save_track+0x14/0x30 [ 18.514323][ T292] __kasan_kmalloc+0x7b/0x90 [ 18.514488][ T292] __kvmalloc_node_noprof+0x2e5/0x8e0 [ 18.514688][ T292] alloc_netdev_mqs+0x7d/0x1370 [ 18.514857][ T292] rtnl_create_link+0xa9e/0xe20 [ 18.515033][ T292] rtnl_newlink_create+0x203/0x770 [ 18.515224][ T292] __rtnl_newlink+0x231/0xa30 [ 18.515400][ T292] rtnl_newlink+0x693/0xa60 [ 18.515574][ T292] rtnetlink_rcv_msg+0x709/0xc00 [ 18.515756][ T292] netlink_rcv_skb+0x121/0x340 [ 18.515942][ T292] netlink_unicast+0x4aa/0x780 [ 18.516117][ T292] netlink_sendmsg+0x714/0xbd0 [ 18.516298][ T292] ____sys_sendmsg+0x3dd/0x890 [ 18.516466][ T292] ___sys_sendmsg+0xed/0x170 [ 18.516636][ T292] __sys_sendmsg+0x10b/0x1a0 [ 18.516814][ T292] do_syscall_64+0xc1/0xfd0 [ 18.516993][ T292] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 18.517239][ T292] [ 18.517342][ T292] Freed by task 292: [ 18.517475][ T292] kasan_save_stack+0x24/0x40 [ 18.517662][ T292] kasan_save_track+0x14/0x30 [ 18.517842][ T292] __kasan_save_free_info+0x3b/0x60 [ 18.518016][ T292] __kasan_slab_free+0x3f/0x60 [ 18.518200][ T292] kfree+0x21d/0x540 [ 18.518325][ T292] device_release+0x9c/0x210 [ 18.518487][ T292] kobject_cleanup+0xfe/0x360 [ 18.518671][ T292] netdev_run_todo+0x81f/0xc60 [ 18.518845][ T292] rtnl_dellink+0x350/0xa30 [ 18.519018][ T292] rtnetlink_rcv_msg+0x709/0xc00 [ 18.519213][ T292] netlink_rcv_skb+0x121/0x340 [ 18.519377][ T292] netlink_unicast+0x4aa/0x780 [ 18.519549][ T292] netlink_sendmsg+0x714/0xbd0 [ 18.519736][ T292] ____sys_sendmsg+0x3dd/0x890 [ 18.519912][ T292] ___sys_sendmsg+0xed/0x170 [ 18.520075][ T292] __sys_sendmsg+0x10b/0x1a0 [ 18.520271][ T292] do_syscall_64+0xc1/0xfd0 [ 18.520438][ T292] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 18.520659][ T292] [ 18.520757][ T292] Last potentially related work creation: [ 18.520930][ T292] kasan_save_stack+0x24/0x40 [ 18.521113][ T292] kasan_record_aux_stack+0x8c/0xa0 [ 18.521300][ T292] insert_work+0x34/0x230 [ 18.521427][ T292] __queue_work+0x5fd/0xab0 [ 18.521607][ T292] queue_work_on+0x84/0x90 [ 18.521790][ T292] fdb_delete+0x7bf/0xd50 [bridge] [ 18.521998][ T292] br_fdb_change_mac_address+0x41e/0x5a0 [bridge] [ 18.522286][ T292] br_stp_change_bridge_id+0x93/0x350 [bridge] [ 18.522539][ T292] br_set_mac_address+0x1eb/0x260 [bridge] [ 18.522797][ T292] netif_set_mac_address+0x280/0x410 [ 18.522984][ T292] do_setlink.constprop.0+0x629/0x2460 [ 18.523180][ T292] rtnl_setlink+0x2bb/0x5a0 [ 18.523347][ T292] rtnetlink_rcv_msg+0x709/0xc00 [ 18.523525][ T292] netlink_rcv_skb+0x121/0x340 [ 18.523732][ T292] netlink_unicast+0x4aa/0x780 [ 18.523907][ T292] netlink_sendmsg+0x714/0xbd0 [ 18.524075][ T292] __sys_sendto+0x24b/0x380 [ 18.524266][ T292] __x64_sys_sendto+0xe0/0x1b0 [ 18.524438][ T292] do_syscall_64+0xc1/0xfd0 [ 18.524614][ T292] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 18.524837][ T292] [ 18.524936][ T292] The buggy address belongs to the object at ffff888004d0a000 [ 18.524936][ T292] which belongs to the cache kmalloc-8k of size 8192 [ 18.525378][ T292] The buggy address is located 1708 bytes inside of [ 18.525378][ T292] freed 8192-byte region [ffff888004d0a000, ffff888004d0c000) [ 18.525865][ T292] [ 18.525974][ T292] The buggy address belongs to the physical page: [ 18.526219][ T292] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4d08 [ 18.526586][ T292] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 [ 18.526893][ T292] flags: 0x80000000000040(head|node=0|zone=1) [ 18.527136][ T292] page_type: f5(slab) [ 18.527275][ T292] raw: 0080000000000040 ffff8880010438c0 ffffea00002e7010 ffff888001041228 [ 18.527595][ T292] raw: 0000000000000000 0000000000010001 00000000f5000000 0000000000000000 [ 18.527927][ T292] head: 0080000000000040 ffff8880010438c0 ffffea00002e7010 ffff888001041228 [ 18.528247][ T292] head: 0000000000000000 0000000000010001 00000000f5000000 0000000000000000 [ 18.528561][ T292] head: 0080000000000003 ffffea0000134201 00000000ffffffff 00000000ffffffff [ 18.528913][ T292] head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 18.529238][ T292] page dumped because: kasan: bad access detected [ 18.529478][ T292] [ 18.529569][ T292] Memory state around the buggy address: [ 18.529760][ T292] ffff888004d0a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.530011][ T292] ffff888004d0a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.530283][ T292] >ffff888004d0a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.530535][ T292] ^ [ 18.530706][ T292] ffff888004d0a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.530961][ T292] ffff888004d0a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 18.531227][ T292] ================================================================== [ 18.531568][ T292] Disabling lock debugging due to kernel taint [ 18.531827][ T292] ------------[ cut here ]------------ [ 18.531999][ T292] refcount_t: underflow; use-after-free. [ 18.532238][ T292] WARNING: CPU: 2 PID: 292 at lib/refcount.c:28 refcount_warn_saturate+0x16f/0x1b0 [ 18.532581][ T292] Modules linked in: bridge stp llc veth [ 18.532782][ T292] CPU: 2 UID: 0 PID: 292 Comm: ip Tainted: G B 6.18.0-rc4-virtme #1 PREEMPT(full) [ 18.533173][ T292] Tainted: [B]=BAD_PAGE [ 18.533353][ T292] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 18.533631][ T292] RIP: 0010:refcount_warn_saturate+0x16f/0x1b0 [ 18.533894][ T292] 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 65 b4 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 [ 18.534577][ T292] RSP: 0018:ffffc90000b271f0 EFLAGS: 00010286 [ 18.534822][ T292] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [ 18.535090][ T292] RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000001 [ 18.535374][ T292] RBP: 0000000000000003 R08: 0000000000000000 R09: fffffbfff69fe134 [ 18.535659][ T292] R10: 0000000000000003 R11: ffffc90000b26d80 R12: 0000000000000001 [ 18.535934][ T292] R13: dffffc0000000000 R14: dead000000000122 R15: dead000000000100 [ 18.536238][ T292] FS: 00007f6fae254800(0000) GS:ffff88807a2f2000(0000) knlGS:0000000000000000 [ 18.536575][ T292] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 18.536842][ T292] CR2: 00007f9a7f905470 CR3: 00000000055d8006 CR4: 0000000000772ef0 [ 18.537126][ T292] PKRU: 55555554 [ 18.537322][ T292] Call Trace: [ 18.537470][ T292] [ 18.537588][ T292] netdev_run_todo+0x5f0/0xc60 [ 18.537813][ T292] ? dev_ingress_queue_create+0x190/0x190 [ 18.538064][ T292] ? generic_xdp_install+0x410/0x410 [ 18.538278][ T292] ? kernfs_put.part.0+0x12d/0x480 [ 18.538482][ T292] ? unregister_netdevice_many+0x20/0x20 [ 18.538685][ T292] ? br_dev_delete+0x115/0x1a0 [bridge] [ 18.538919][ T292] rtnl_dellink+0x350/0xa30 [ 18.539108][ T292] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 18.539370][ T292] ? find_held_lock+0x2b/0x80 [ 18.539554][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.539747][ T292] ? find_held_lock+0x2b/0x80 [ 18.539952][ T292] ? rtnetlink_rcv_msg+0x6e6/0xc00 [ 18.540159][ T292] ? __lock_release+0x5d/0x170 [ 18.540360][ T292] ? valid_bridge_getlink_req.constprop.0+0x640/0x640 [ 18.540589][ T292] rtnetlink_rcv_msg+0x709/0xc00 [ 18.540781][ T292] ? rtnl_port_fill+0x850/0x850 [ 18.540988][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.541210][ T292] netlink_rcv_skb+0x121/0x340 [ 18.541418][ T292] ? rtnl_port_fill+0x850/0x850 [ 18.541598][ T292] ? netlink_ack+0xdd0/0xdd0 [ 18.541792][ T292] ? netlink_deliver_tap+0x13e/0x340 [ 18.541982][ T292] ? netlink_deliver_tap+0xc3/0x340 [ 18.542186][ T292] netlink_unicast+0x4aa/0x780 [ 18.542378][ T292] ? netlink_attachskb+0x810/0x810 [ 18.542573][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.542758][ T292] netlink_sendmsg+0x714/0xbd0 [ 18.542939][ T292] ? netlink_unicast+0x780/0x780 [ 18.543159][ T292] ? __import_iovec+0x230/0x3b0 [ 18.543361][ T292] ? netlink_unicast+0x780/0x780 [ 18.543548][ T292] ____sys_sendmsg+0x3dd/0x890 [ 18.543732][ T292] ? get_timestamp.constprop.0+0x380/0x380 [ 18.543949][ T292] ? __copy_msghdr+0x3c0/0x3c0 [ 18.544139][ T292] ___sys_sendmsg+0xed/0x170 [ 18.544328][ T292] ? kasan_record_aux_stack+0x8c/0xa0 [ 18.544514][ T292] ? __call_rcu_common.constprop.0+0xa8/0x630 [ 18.544752][ T292] ? copy_msghdr_from_user+0x110/0x110 [ 18.544934][ T292] ? find_held_lock+0x2b/0x80 [ 18.545121][ T292] ? __lock_acquire+0x449/0x7e0 [ 18.545312][ T292] ? find_held_lock+0x2b/0x80 [ 18.545501][ T292] ? __virt_addr_valid+0x22a/0x450 [ 18.545715][ T292] ? __lock_release+0x5d/0x170 [ 18.545922][ T292] __sys_sendmsg+0x10b/0x1a0 [ 18.546125][ T292] ? __call_rcu_common.constprop.0+0x318/0x630 [ 18.546380][ T292] ? __sys_sendmsg_sock+0x20/0x20 [ 18.546584][ T292] ? rcu_is_watching+0x12/0xb0 [ 18.546772][ T292] do_syscall_64+0xc1/0xfd0 [ 18.546966][ T292] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 18.547189][ T292] RIP: 0033:0x7f6fae4221d7 [ 18.547403][ T292] 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 [ 18.548142][ T292] RSP: 002b:00007fff188597f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 18.548540][ T292] RAX: ffffffffffffffda RBX: 00007fff18859f20 RCX: 00007f6fae4221d7 [ 18.548822][ T292] RDX: 0000000000000000 RSI: 00007fff18859860 RDI: 0000000000000005 [ 18.549114][ T292] RBP: 0000000000000002 R08: 0000000000000003 R09: 0000000000000078 [ 18.549529][ T292] R10: 00007f6fae31ef60 R11: 0000000000000246 R12: 0000000000000002 [ 18.549834][ T292] R13: 00000000690df626 R14: 0000000000499600 R15: 0000000000000000 [ 18.550107][ T292] [ 18.550383][ T292] irq event stamp: 38479 [ 18.550545][ T292] hardirqs last enabled at (38479): [] irqentry_exit+0x3b/0x80 [ 18.550866][ T292] hardirqs last disabled at (38478): [] handle_softirqs+0x47f/0x610 [ 18.551311][ T292] softirqs last enabled at (38090): [] handle_softirqs+0x352/0x610 [ 18.551645][ T292] softirqs last disabled at (37999): [] irq_exit_rcu+0xab/0x100 [ 18.552048][ T292] ---[ end trace 0000000000000000 ]--- [ 20.242411][ T316] br0: port 1(veth1) entered blocking state [ 20.242686][ T316] br0: port 1(veth1) entered disabled state [ 20.242937][ T316] veth1: entered allmulticast mode [ 20.245059][ T316] veth1: entered promiscuous mode [ 20.319774][ T318] br0: port 2(veth3) entered blocking state [ 20.320089][ T318] br0: port 2(veth3) entered disabled state [ 20.320395][ T318] veth3: entered allmulticast mode [ 20.322679][ T318] veth3: entered promiscuous mode [ 20.576815][ T71] br0: port 1(veth1) entered blocking state [ 20.577182][ T71] br0: port 1(veth1) entered forwarding state [ 20.650521][ T71] br0: port 2(veth3) entered blocking state [ 20.650810][ T71] br0: port 2(veth3) entered forwarding state [ 32.791047][ T559] br0: port 3(veth5) entered blocking state [ 32.791399][ T559] br0: port 3(veth5) entered disabled state [ 32.791716][ T559] veth5: entered allmulticast mode [ 32.793666][ T559] veth5: entered promiscuous mode [ 32.963140][ T564] veth5: left allmulticast mode [ 32.963567][ T564] veth5: left promiscuous mode [ 32.963920][ T564] br0: port 3(veth5) entered disabled state [ 33.698605][ T579] br0: port 3(veth5) entered blocking state [ 33.698929][ T579] br0: port 3(veth5) entered disabled state [ 33.699227][ T579] veth5: entered allmulticast mode [ 33.701358][ T579] veth5: entered promiscuous mode [ 33.701737][ T579] br0: adding interface veth5 with same address as a received packet (addr:de:ad:be:ef:42:00, vlan:0) [ 33.879411][ T584] veth5: left allmulticast mode [ 33.879694][ T584] veth5: left promiscuous mode [ 33.880038][ T584] br0: port 3(veth5) entered disabled state [ 72.386399][ T1324] br0: port 3(veth5) entered blocking state [ 72.386681][ T1324] br0: port 3(veth5) entered disabled state [ 72.386945][ T1324] veth5: entered allmulticast mode [ 72.388851][ T1324] veth5: entered promiscuous mode [ 72.592716][ T1336] br0: port 3(veth5) entered disabled state [ 72.655417][ T1337] br0: port 2(veth3) entered disabled state [ 72.726957][ T1338] br0: port 1(veth1) entered disabled state [ 72.805279][ T1339] veth5: left allmulticast mode [ 72.805495][ T1339] veth5: left promiscuous mode [ 72.805794][ T1339] br0: port 3(veth5) entered disabled state [ 72.806953][ T1339] veth3: left allmulticast mode [ 72.807138][ T1339] veth3: left promiscuous mode [ 72.807469][ T1339] br0: port 2(veth3) entered disabled state [ 72.808475][ T1339] veth1: left allmulticast mode [ 72.808662][ T1339] veth1: left promiscuous mode [ 72.808974][ T1339] br0: port 1(veth1) entered disabled state