================================================================== BUG: KASAN: double-free in slab_free mm/slub.c:3539 [inline] BUG: KASAN: double-free in kfree+0xe2/0x580 mm/slub.c:4567 CPU: 1 PID: 2173 Comm: kworker/1:2 Not tainted 6.0.0-syzkaller-02741-g1d22f78d0573 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: events mptcp_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report_invalid_free+0x81/0x190 mm/kasan/report.c:462 ____kasan_slab_free+0x18b/0x1c0 mm/kasan/common.c:356 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 tcp_disconnect+0x980/0x1e20 net/ipv4/tcp.c:3145 __mptcp_close_ssk+0x5ca/0x7e0 net/mptcp/protocol.c:2327 mptcp_do_fastclose net/mptcp/protocol.c:2592 [inline] mptcp_worker+0x78c/0xff0 net/mptcp/protocol.c:2627 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 10155: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc_node include/linux/slab.h:618 [inline] kzalloc_node include/linux/slab.h:744 [inline] __get_vm_area_node+0xed/0x3f0 mm/vmalloc.c:2477 __vmalloc_node_range+0x250/0x13a0 mm/vmalloc.c:3156 alloc_thread_stack_node kernel/fork.c:312 [inline] dup_task_struct kernel/fork.c:977 [inline] copy_process+0x156c/0x7090 kernel/fork.c:2085 kernel_clone+0xe7/0xab0 kernel/fork.c:2671 __do_sys_clone+0xba/0x100 kernel/fork.c:2805 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x8f0 kernel/rcu/tree.c:3341 __netdev_adjacent_dev_remove+0x327/0x680 net/core/dev.c:7546 __netdev_adjacent_dev_unlink_lists net/core/dev.c:7578 [inline] __netdev_adjacent_dev_unlink_neighbour net/core/dev.c:7595 [inline] __netdev_upper_dev_unlink+0x114/0x400 net/core/dev.c:7745 netdev_upper_dev_unlink+0x7c/0xb0 net/core/dev.c:7774 macsec_newlink+0x988/0x1d00 drivers/net/macsec.c:4150 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3581 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x8f0 kernel/rcu/tree.c:3341 __netdev_adjacent_dev_remove+0x327/0x680 net/core/dev.c:7546 __netdev_adjacent_dev_unlink_lists net/core/dev.c:7579 [inline] __netdev_adjacent_dev_unlink_neighbour net/core/dev.c:7595 [inline] __netdev_upper_dev_unlink+0x12b/0x400 net/core/dev.c:7745 netdev_upper_dev_unlink+0x7c/0xb0 net/core/dev.c:7774 macsec_newlink+0x988/0x1d00 drivers/net/macsec.c:4150 rtnl_newlink_create net/core/rtnetlink.c:3364 [inline] __rtnl_newlink+0x1087/0x17e0 net/core/rtnetlink.c:3581 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3594 rtnetlink_rcv_msg+0x43a/0xca0 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880266f6880 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8880266f6880, ffff8880266f68c0) The buggy address belongs to the physical page: page:ffffea000099bd80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880266f6880 pfn:0x266f6 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00008b4e88 ffffea0000774988 ffff888011841640 raw: ffff8880266f6880 0000000000200014 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 12613, tgid 12611 (syz-executor.1), ts 337392880977, free_ts 337390839219 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1829 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x84f/0xe80 mm/slub.c:3036 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3123 slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] __kmalloc+0x32b/0x340 mm/slub.c:4425 kmalloc include/linux/slab.h:605 [inline] kzalloc include/linux/slab.h:733 [inline] kobject_get_path+0xbe/0x230 lib/kobject.c:147 kobject_uevent_env+0x254/0x1640 lib/kobject_uevent.c:529 __kobject_del+0x160/0x1f0 lib/kobject.c:585 kobject_cleanup lib/kobject.c:664 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x2ed/0x4c0 lib/kobject.c:721 net_rx_queue_update_kobjects+0x3f3/0x510 net/core/net-sysfs.c:1128 remove_queue_kobjects net/core/net-sysfs.c:1829 [inline] netdev_unregister_kobject+0x158/0x280 net/core/net-sysfs.c:1983 unregister_netdevice_many+0xe3a/0x1980 net/core/dev.c:10870 unregister_netdevice_queue+0x2dd/0x3c0 net/core/dev.c:10774 unregister_netdevice include/linux/netdevice.h:3032 [inline] macsec_newlink+0x997/0x1d00 drivers/net/macsec.c:4152 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 skb_free_frag include/linux/skbuff.h:3188 [inline] skb_free_head+0x96/0x110 net/core/skbuff.c:758 skb_release_data+0x5f1/0x870 net/core/skbuff.c:789 skb_release_all net/core/skbuff.c:854 [inline] __kfree_skb+0x46/0x60 net/core/skbuff.c:868 tcp_rcv_established+0x1477/0x20e0 net/ipv4/tcp_input.c:5914 tcp_v4_do_rcv+0x66c/0x9b0 net/ipv4/tcp_ipv4.c:1681 tcp_v4_rcv+0x329d/0x38c0 net/ipv4/tcp_ipv4.c:2100 ip_protocol_deliver_rcu+0x9b/0x7c0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2e8/0x4c0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_local_deliver+0x1aa/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:455 [inline] ip_sublist_rcv_finish+0x9a/0x2c0 net/ipv4/ip_input.c:575 ip_list_rcv_finish net/ipv4/ip_input.c:625 [inline] ip_sublist_rcv+0x533/0x980 net/ipv4/ip_input.c:633 ip_list_rcv+0x31a/0x470 net/ipv4/ip_input.c:668 __netif_receive_skb_list_ptype net/core/dev.c:5528 [inline] __netif_receive_skb_list_core+0x548/0x8f0 net/core/dev.c:5576 __netif_receive_skb_list net/core/dev.c:5628 [inline] netif_receive_skb_list_internal+0x75b/0xd80 net/core/dev.c:5719 Memory state around the buggy address: ffff8880266f6780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880266f6800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880266f6880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880266f6900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880266f6980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================