================================================================== BUG: KASAN: double-free in slab_free mm/slub.c:3539 [inline] BUG: KASAN: double-free in kfree+0xda/0x210 mm/slub.c:4567 CPU: 1 PID: 3713 Comm: kworker/1:8 Not tainted 6.0.0-syzkaller-06205-gffb39098bf87 #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+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report_invalid_free+0xb9/0xd0 mm/kasan/report.c:462 ____kasan_slab_free+0xfd/0x120 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xda/0x210 mm/slub.c:4567 tcp_disconnect+0x9ee/0x1a10 net/ipv4/tcp.c:3145 __mptcp_close_ssk+0x31a/0x6a0 net/mptcp/protocol.c:2327 mptcp_do_fastclose net/mptcp/protocol.c:2592 [inline] mptcp_worker+0x67b/0xfe0 net/mptcp/protocol.c:2627 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 2975: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:234 [inline] __kmalloc+0x226/0x370 mm/slub.c:4429 kmalloc include/linux/slab.h:605 [inline] kzalloc include/linux/slab.h:733 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x540 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x5b4/0x5f0 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x270/0x6b0 security/tomoyo/file.c:822 security_inode_getattr+0xc0/0x140 security/security.c:1345 vfs_getattr+0x26/0x360 fs/stat.c:158 vfs_statx+0x1b5/0x4e0 fs/stat.c:233 vfs_fstatat fs/stat.c:267 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat+0x104/0x7b0 fs/stat.c:431 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8c0 kernel/rcu/tree.c:3341 sctp_bind_addr_clean net/sctp/bind_addr.c:125 [inline] sctp_bind_addr_free+0x14b/0x1a0 net/sctp/bind_addr.c:134 sctp_association_free+0x284/0x7b0 net/sctp/associola.c:358 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter+0x3dd6/0x5440 net/sctp/sm_sideeffect.c:1328 sctp_side_effects+0x6c/0x1f0 net/sctp/sm_sideeffect.c:1199 sctp_do_sm+0x22c/0x540 net/sctp/sm_sideeffect.c:1170 sctp_assoc_bh_rcv+0x42a/0x680 net/sctp/associola.c:1053 sctp_backlog_rcv+0x16e/0x3c0 net/sctp/input.c:346 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2906 release_sock+0x5d/0x1c0 net/core/sock.c:3462 sctp_wait_for_connect+0x3f0/0x700 net/sctp/socket.c:9310 __sctp_connect+0xb2d/0xde0 net/sctp/socket.c:1245 sctp_connect+0xab/0x130 net/sctp/socket.c:4805 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x29b/0x2d0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8c0 kernel/rcu/tree.c:3341 sctp_bind_addr_clean net/sctp/bind_addr.c:125 [inline] sctp_bind_addr_free+0x14b/0x1a0 net/sctp/bind_addr.c:134 sctp_association_free+0x284/0x7b0 net/sctp/associola.c:358 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter+0x3dd6/0x5440 net/sctp/sm_sideeffect.c:1328 sctp_side_effects+0x6c/0x1f0 net/sctp/sm_sideeffect.c:1199 sctp_do_sm+0x22c/0x540 net/sctp/sm_sideeffect.c:1170 sctp_assoc_bh_rcv+0x42a/0x680 net/sctp/associola.c:1053 sctp_backlog_rcv+0x16e/0x3c0 net/sctp/input.c:346 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2906 release_sock+0x5d/0x1c0 net/core/sock.c:3462 sctp_close+0x6de/0x8e0 net/sctp/socket.c:1534 inet_release+0x184/0x1e0 net/ipv4/af_inet.c:428 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3b9/0x820 fs/file_table.c:320 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x55e/0x20a0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 get_signal+0x172f/0x1780 kernel/signal.c:2857 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:166 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88801f9dd100 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801f9dd100, ffff88801f9dd140) The buggy address belongs to the physical page: page:ffffea00007e7740 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801f9dd100 pfn:0x1f9dd flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000099f688 ffffea0000813a08 ffff888012041640 raw: ffff88801f9dd100 000000000020001a 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 5563, tgid 5560 (syz-executor.1), ts 268346413305, free_ts 268255764157 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0x70/0xf0 mm/slub.c:1829 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] kmem_cache_alloc_trace+0x25f/0x310 mm/slub.c:3287 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] sctp_add_bind_addr+0x85/0x360 net/sctp/bind_addr.c:144 sctp_copy_local_addr_list+0x2e1/0x4b0 net/sctp/protocol.c:165 sctp_bind_addr_copy+0xad/0x3c0 net/sctp/bind_addr.c:56 sctp_connect_new_asoc+0x2dd/0x6a0 net/sctp/socket.c:1093 __sctp_connect+0x64b/0xde0 net/sctp/socket.c:1195 sctp_connect+0xab/0x130 net/sctp/socket.c:4805 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x29b/0x2d0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page_list+0xb4/0x7b0 mm/page_alloc.c:3522 release_pages+0x22c3/0x2540 mm/swap.c:1012 tlb_batch_pages_flush mm/mmu_gather.c:58 [inline] tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu+0x850/0xa70 mm/mmu_gather.c:262 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:353 exit_mmap+0x1dc/0x530 mm/mmap.c:3118 __mmput+0x111/0x3a0 kernel/fork.c:1187 vhost_detach_mm drivers/vhost/vhost.c:567 [inline] vhost_dev_cleanup+0xb37/0xbf0 drivers/vhost/vhost.c:713 vhost_vsock_dev_release+0x3ba/0x420 drivers/vhost/vsock.c:774 __fput+0x3b9/0x820 fs/file_table.c:320 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x55e/0x20a0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 get_signal+0x172f/0x1780 kernel/signal.c:2857 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:166 Memory state around the buggy address: ffff88801f9dd000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801f9dd080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88801f9dd100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88801f9dd180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801f9dd200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================