================================================================== 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: 8382 Comm: kworker/0:14 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #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 3656: 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] vzalloc+0x67/0x80 mm/vmalloc.c:3334 compat_get_entries+0x360/0x770 net/ipv4/netfilter/ip_tables.c:801 do_ipt_get_ctl+0x4ed/0x9d0 net/ipv4/netfilter/ip_tables.c:1660 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x185/0x1e0 net/ipv4/ip_sockglue.c:1796 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 3656: 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 compat_copy_entries_to_user net/ipv4/netfilter/ip_tables.c:1569 [inline] compat_get_entries+0x52d/0x770 net/ipv4/netfilter/ip_tables.c:1599 do_ipt_get_ctl+0x4ed/0x9d0 net/ipv4/netfilter/ip_tables.c:1660 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x185/0x1e0 net/ipv4/ip_sockglue.c:1796 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 The buggy address belongs to the object at ffff88801c423000 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801c423000, ffff88801c423040) The buggy address belongs to the physical page: page:ffffea00007108c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c423 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001ea1d80 dead000000000003 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 3864, tgid 3859 (syz-executor.1), ts 115217183694, free_ts 115103353469 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] sock_kmalloc+0xae/0x100 net/core/sock.c:2620 cmsghdr_from_user_compat_to_kern+0x5dd/0x700 net/compat.c:175 ____sys_sendmsg+0x4f8/0x8c0 net/socket.c:2445 __sys_sendmsg_sock+0x26/0x30 net/socket.c:2548 io_sendmsg+0x248/0x800 io_uring/net.c:301 io_issue_sqe+0x69d/0xd00 io_uring/io_uring.c:1740 io_queue_sqe io_uring/io_uring.c:1914 [inline] io_submit_sqe io_uring/io_uring.c:2172 [inline] io_submit_sqes+0x936/0x1d10 io_uring/io_uring.c:2283 __do_sys_io_uring_enter+0xadb/0x2430 io_uring/io_uring.c:3227 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 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_list+0x16f/0xb90 mm/page_alloc.c:3522 release_pages+0xbd3/0x1400 mm/swap.c:1012 __pagevec_release+0x77/0x100 mm/swap.c:1032 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x318/0x1510 mm/truncate.c:373 kill_bdev block/bdev.c:76 [inline] blkdev_flush_mapping+0x140/0x2f0 block/bdev.c:662 blkdev_put_whole+0xd1/0xf0 block/bdev.c:693 blkdev_put+0x226/0x770 block/bdev.c:953 blkdev_close+0x64/0x80 block/fops.c:499 __fput+0x27c/0xa90 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/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_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 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: ffff88801c422f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801c422f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801c423000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88801c423080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801c423100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================