================================================================== 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: 0 PID: 3701 Comm: kworker/0:4 Not tainted 6.0.0-syzkaller-02734-g0326074ff465 #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 7293: 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 include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] sctp_add_bind_addr+0x93/0x3d0 net/sctp/bind_addr.c:144 sctp_copy_local_addr_list+0x325/0x4f0 net/sctp/protocol.c:165 sctp_copy_one_addr net/sctp/bind_addr.c:460 [inline] sctp_bind_addr_copy+0xde/0x460 net/sctp/bind_addr.c:56 sctp_connect_new_asoc+0x1cd/0x770 net/sctp/socket.c:1093 __sctp_connect+0x3d0/0xc30 net/sctp/socket.c:1195 __sctp_setsockopt_connectx+0x102/0x170 net/sctp/socket.c:1334 sctp_getsockopt_connectx3 net/sctp/socket.c:1419 [inline] sctp_getsockopt+0x279d/0x6e90 net/sctp/socket.c:8108 __sys_getsockopt+0x216/0x690 net/socket.c:2296 __do_sys_getsockopt net/socket.c:2311 [inline] __se_sys_getsockopt net/socket.c:2308 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2308 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 sctp_bind_addr_clean+0x135/0x1f0 net/sctp/bind_addr.c:125 sctp_association_free+0x28c/0x7d0 net/sctp/associola.c:358 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1328 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x385c/0x4ec0 net/sctp/sm_sideeffect.c:1170 sctp_primitive_SHUTDOWN+0x9b/0xc0 net/sctp/primitive.c:89 sctp_close+0x3e3/0x940 net/sctp/socket.c:1526 inet_release+0x12e/0x270 net/ipv4/af_inet.c:428 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:482 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x277/0x9d0 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad5/0x29b0 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934 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 sctp_bind_addr_clean+0x135/0x1f0 net/sctp/bind_addr.c:125 sctp_association_free+0x28c/0x7d0 net/sctp/associola.c:358 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1328 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x385c/0x4ec0 net/sctp/sm_sideeffect.c:1170 sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1053 sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x196/0x5a0 net/sctp/input.c:346 sk_backlog_rcv include/net/sock.h:1109 [inline] __release_sock+0x12f/0x3a0 net/core/sock.c:2906 release_sock+0x54/0x1b0 net/core/sock.c:3462 sctp_close+0x442/0x940 net/sctp/socket.c:1534 inet_release+0x12e/0x270 net/ipv4/af_inet.c:428 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:482 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 __fput+0x277/0x9d0 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad5/0x29b0 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x2387/0x2610 kernel/signal.c:2857 arch_do_signal_or_restart+0x82/0x2300 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888145692400 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff888145692400, ffff888145692440) The buggy address belongs to the physical page: page:ffffea000515a480 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888145692f80 pfn:0x145692 flags: 0x57ff00000000200(slab|node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000000200 ffffea00051de508 ffff888140000408 ffff888011841640 raw: ffff888145692f80 000000000020000f 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, tgid 1 (swapper/0), ts 2027256518, free_ts 0 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_page_interleave+0x1e/0x200 mm/mempolicy.c:2103 alloc_pages+0x22f/0x270 mm/mempolicy.c:2265 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] kmem_cache_alloc_trace+0x323/0x3e0 mm/slub.c:3287 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] add_sysfs_param+0x654/0x960 kernel/params.c:638 kernel_add_sysfs_param kernel/params.c:812 [inline] param_sysfs_builtin kernel/params.c:851 [inline] param_sysfs_init+0x301/0x43b kernel/params.c:970 do_one_initcall+0xfe/0x650 init/main.c:1296 do_initcall_level init/main.c:1369 [inline] do_initcalls init/main.c:1385 [inline] do_basic_setup init/main.c:1404 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1623 kernel_init+0x1a/0x1d0 init/main.c:1512 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page_owner free stack trace missing Memory state around the buggy address: ffff888145692300: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff888145692380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888145692400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888145692480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888145692500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================