================================================================== 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: 18176 Comm: kworker/0:13 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+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 3671: 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 __vmalloc_node mm/vmalloc.c:3261 [inline] vmalloc+0x67/0x80 mm/vmalloc.c:3294 xt_compat_init_offsets+0xdf/0x220 net/netfilter/x_tables.c:733 compat_table_info+0xb7/0x5e0 net/ipv6/netfilter/ip6_tables.c:952 compat_get_entries+0x1d4/0x7d0 net/ipv6/netfilter/ip6_tables.c:1606 do_ip6t_get_ctl+0x4ed/0xa10 net/ipv6/netfilter/ip6_tables.c:1669 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1eb/0x2a0 net/ipv6/ipv6_sockglue.c:1509 tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:4399 __sys_getsockopt+0x216/0x690 net/socket.c:2296 __do_compat_sys_socketcall+0x513/0x660 net/compat.c:492 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Freed by task 3671: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 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 __vunmap+0xae4/0xd30 mm/vmalloc.c:2704 __vfree+0x3c/0xd0 mm/vmalloc.c:2744 vfree+0x5a/0x90 mm/vmalloc.c:2775 xt_compat_flush_offsets+0x8b/0x160 net/netfilter/x_tables.c:691 compat_get_entries+0x1f8/0x7d0 net/ipv6/netfilter/ip6_tables.c:1613 do_ip6t_get_ctl+0x4ed/0xa10 net/ipv6/netfilter/ip6_tables.c:1669 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1eb/0x2a0 net/ipv6/ipv6_sockglue.c:1509 tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:4399 __sys_getsockopt+0x216/0x690 net/socket.c:2296 __do_compat_sys_socketcall+0x513/0x660 net/compat.c:492 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 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_wait_for_connect+0x416/0x5c0 net/sctp/socket.c:9310 __sctp_connect+0x9a1/0xc30 net/sctp/socket.c:1245 __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] __ia32_sys_getsockopt+0xb9/0x150 net/socket.c:2308 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 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_wait_for_connect+0x416/0x5c0 net/sctp/socket.c:9310 __sctp_connect+0x9a1/0xc30 net/sctp/socket.c:1245 __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] __ia32_sys_getsockopt+0xb9/0x150 net/socket.c:2308 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 The buggy address belongs to the object at ffff88807f07f400 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88807f07f400, ffff88807f07f440) The buggy address belongs to the physical page: page:ffffea0001fc1fc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7f07f flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00005d0540 dead000000000005 ffff888011841640 raw: 0000000000000000 0000000000200020 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 3668, tgid 3668 (syz-executor.1), ts 138278718865, free_ts 138278614206 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] kmem_cache_alloc_node_trace+0x185/0x410 mm/slub.c:3312 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 __vmalloc_node mm/vmalloc.c:3261 [inline] vmalloc+0x67/0x80 mm/vmalloc.c:3294 xt_compat_init_offsets+0xdf/0x220 net/netfilter/x_tables.c:733 translate_compat_table+0x1f3/0x18d0 net/ipv6/netfilter/ip6_tables.c:1425 compat_do_replace.constprop.0+0x24e/0x410 net/ipv6/netfilter/ip6_tables.c:1529 do_ip6t_set_ctl+0x5b0/0xb20 net/ipv6/netfilter/ip6_tables.c:1636 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x127/0x190 net/ipv6/ipv6_sockglue.c:1026 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 __vunmap+0x85d/0xd30 mm/vmalloc.c:2696 __vfree+0x3c/0xd0 mm/vmalloc.c:2744 vfree+0x5a/0x90 mm/vmalloc.c:2775 xt_compat_flush_offsets+0x8b/0x160 net/netfilter/x_tables.c:691 compat_get_entries+0x1f8/0x7d0 net/ipv6/netfilter/ip6_tables.c:1613 do_ip6t_get_ctl+0x4ed/0xa10 net/ipv6/netfilter/ip6_tables.c:1669 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1eb/0x2a0 net/ipv6/ipv6_sockglue.c:1509 tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:4399 __sys_getsockopt+0x216/0x690 net/socket.c:2296 __do_compat_sys_socketcall+0x513/0x660 net/compat.c:492 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 Memory state around the buggy address: ffff88807f07f300: 00 00 00 00 04 fc fc fc fc fc fc fc fc fc fc fc ffff88807f07f380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88807f07f400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88807f07f480: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88807f07f500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================