================================================================== BUG: KASAN: invalid-free in skb_kfree_head net/core/skbuff.c:857 [inline] BUG: KASAN: invalid-free in skb_free_head+0xa0/0x190 net/core/skbuff.c:872 Free of addr ffff00012a6cf000 by task syz-executor.2/13135 CPU: 0 PID: 13135 Comm: syz-executor.2 Not tainted 6.3.0-rc1-syzkaller-gfe15c26ee26e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0x174/0x514 mm/kasan/report.c:430 kasan_report_invalid_free+0xc4/0x114 mm/kasan/report.c:501 ____kasan_slab_free+0x1a8/0x1c0 mm/kasan/common.c:216 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] kmem_cache_free+0x328/0x5f8 mm/slub.c:3809 skb_kfree_head net/core/skbuff.c:857 [inline] skb_free_head+0xa0/0x190 net/core/skbuff.c:872 skb_release_data+0x428/0x5ac net/core/skbuff.c:901 skb_release_all net/core/skbuff.c:966 [inline] __kfree_skb+0x58/0x78 net/core/skbuff.c:980 tcp_wmem_free_skb+0x258/0x408 include/net/tcp.h:302 tcp_rtx_queue_purge net/ipv4/tcp.c:3062 [inline] tcp_write_queue_purge+0x1d4/0x298 net/ipv4/tcp.c:3075 tcp_v4_destroy_sock+0x2c8/0x930 net/ipv4/tcp_ipv4.c:2302 inet_csk_destroy_sock+0x148/0x434 net/ipv4/inet_connection_sock.c:1195 __tcp_close+0x9a4/0xf7c net/ipv4/tcp.c:3022 tcp_close+0x38/0xec net/ipv4/tcp.c:3034 inet_release+0x160/0x1d0 net/ipv4/af_inet.c:426 __sock_release net/socket.c:651 [inline] sock_close+0xb8/0x1fc net/socket.c:1393 __fput+0x30c/0x7bc fs/file_table.c:321 ____fput+0x20/0x30 fs/file_table.c:349 task_work_run+0x240/0x2f0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2180/0x3c90 arch/arm64/kernel/signal.c:1302 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Allocated by task 13138: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x7c mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:510 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node_track_caller+0xd0/0x1c0 mm/slab_common.c:987 kmalloc_reserve+0x148/0x23c net/core/skbuff.c:539 pskb_expand_head+0x194/0x1060 net/core/skbuff.c:1995 __skb_unclone_keeptruesize net/core/skbuff.c:2094 [inline] skb_unclone_keeptruesize include/linux/skbuff.h:1910 [inline] skb_prepare_for_shift+0x110/0x2c4 net/core/skbuff.c:3804 skb_shift+0x634/0x1710 net/core/skbuff.c:3877 tcp_skb_shift net/ipv4/tcp_input.c:1538 [inline] tcp_shift_skb_data net/ipv4/tcp_input.c:1646 [inline] tcp_sacktag_walk+0xf14/0x1c6c net/ipv4/tcp_input.c:1713 tcp_sacktag_write_queue+0x1b4c/0x32f4 net/ipv4/tcp_input.c:1974 tcp_ack+0x1188/0x5688 net/ipv4/tcp_input.c:3847 tcp_rcv_established+0xb34/0x2350 net/ipv4/tcp_input.c:6006 tcp_v4_do_rcv+0x390/0xb08 net/ipv4/tcp_ipv4.c:1721 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x1a8/0x408 net/core/sock.c:2921 release_sock+0x68/0x1cc net/core/sock.c:3488 tcp_sendmsg+0x4c/0x64 net/ipv4/tcp.c:1485 inet_sendmsg+0x15c/0x290 net/ipv4/af_inet.c:825 sock_sendmsg_nosec net/socket.c:722 [inline] sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x3b4/0x538 net/socket.c:2145 __do_sys_sendto net/socket.c:2157 [inline] __se_sys_sendto net/socket.c:2153 [inline] __arm64_sys_sendto+0xd8/0xf8 net/socket.c:2153 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x198 arch/arm64/kernel/syscall.c:193 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 The buggy address belongs to the object at ffff00012a6cf000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of 1024-byte region [ffff00012a6cf000, ffff00012a6cf400) The buggy address belongs to the physical page: page:00000000628372a7 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16a6c8 head:00000000628372a7 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 ffff0000c0002780 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff00012a6cef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff00012a6cef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff00012a6cf000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff00012a6cf080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff00012a6cf100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================