================================================================== BUG: KASAN: invalid-free in slab_free mm/slub.c:3787 [inline] BUG: KASAN: invalid-free in kmem_cache_free+0xec/0x4e0 mm/slub.c:3809 Free of addr ffff88802cdb1000 by task syz-executor.5/18285 CPU: 1 PID: 18285 Comm: syz-executor.5 Not tainted 6.2.0-syzkaller-05251-g5b7c4cabbb65 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x28/0x360 mm/kasan/report.c:306 print_report mm/kasan/report.c:417 [inline] kasan_report_invalid_free+0xe8/0x100 mm/kasan/report.c:482 ____kasan_slab_free+0x1a5/0x1c0 mm/kasan/common.c:216 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3787 [inline] kmem_cache_free+0xec/0x4e0 mm/slub.c:3809 skb_kfree_head net/core/skbuff.c:857 [inline] skb_kfree_head net/core/skbuff.c:853 [inline] skb_free_head+0x16f/0x1a0 net/core/skbuff.c:872 skb_release_data+0x57a/0x820 net/core/skbuff.c:901 skb_release_all net/core/skbuff.c:966 [inline] __kfree_skb+0x4f/0x70 net/core/skbuff.c:980 tcp_wmem_free_skb include/net/tcp.h:302 [inline] tcp_rtx_queue_unlink_and_free include/net/tcp.h:1938 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3334 [inline] tcp_ack+0x1e0a/0x5a10 net/ipv4/tcp_input.c:3884 tcp_rcv_established+0x667/0x22a0 net/ipv4/tcp_input.c:6006 tcp_v4_do_rcv+0x663/0x9d0 net/ipv4/tcp_ipv4.c:1721 tcp_v4_rcv+0x2eac/0x3280 net/ipv4/tcp_ipv4.c:2143 ip_protocol_deliver_rcu+0x9f/0x480 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2ec/0x520 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_local_deliver+0x1ae/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:454 [inline] ip_rcv_finish+0x1cf/0x2f0 net/ipv4/ip_input.c:449 NF_HOOK include/linux/netfilter.h:302 [inline] NF_HOOK include/linux/netfilter.h:296 [inline] ip_rcv+0xae/0xd0 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5477 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5591 process_backlog+0x279/0x850 net/core/dev.c:5919 __napi_poll+0xb8/0x870 net/core/dev.c:6480 napi_poll net/core/dev.c:6547 [inline] net_rx_action+0x9fd/0xdc0 net/core/dev.c:6657 __do_softirq+0x2e3/0xae3 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x114/0x190 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x49/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0033:0x7f3e78c39429 Code: 31 c5 c1 e8 0f 31 c5 80 3d 9c c2 c9 00 00 75 81 44 0f b6 6c 24 0f 44 8d 4d 04 89 e8 41 89 c0 41 81 e0 ff 1f 00 00 43 8b 14 84 <39> d5 0f 84 70 ff ff ff 85 d2 0f 84 67 01 00 00 83 c0 01 41 39 c1 RSP: 002b:00007f3e78ecfac0 EFLAGS: 00000202 RAX: 000000002eec0740 RBX: 00007f3e78dac018 RCX: 0000001b32b20000 RDX: 00000000a5232740 RSI: 0000001b32b2531c RDI: 000000000cd4860f RBP: 000000002eec073f R08: 0000000000000740 R09: 000000002eec0743 R10: 00007f3e78ecfc80 R11: 0000000000000246 R12: 00007f3e78da0000 R13: 0000000000000001 R14: 0000000000000c5f R15: ffffffff8896cbd9 Allocated by task 18297: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:968 [inline] __kmalloc_node_track_caller+0x5b/0xc0 mm/slab_common.c:988 kmalloc_reserve+0xf1/0x230 net/core/skbuff.c:539 pskb_expand_head+0x237/0x1160 net/core/skbuff.c:1995 __skb_unclone_keeptruesize+0x93/0x220 net/core/skbuff.c:2094 skb_unclone_keeptruesize include/linux/skbuff.h:1910 [inline] skb_prepare_for_shift net/core/skbuff.c:3804 [inline] skb_shift+0xef8/0x1e20 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+0x93b/0x18a0 net/ipv4/tcp_input.c:1713 tcp_sacktag_write_queue+0x1599/0x31d0 net/ipv4/tcp_input.c:1974 tcp_ack+0x2e9f/0x5a10 net/ipv4/tcp_input.c:3847 tcp_rcv_established+0x667/0x22a0 net/ipv4/tcp_input.c:6006 tcp_v4_do_rcv+0x663/0x9d0 net/ipv4/tcp_ipv4.c:1721 sk_backlog_rcv include/net/sock.h:1113 [inline] __release_sock+0x133/0x3b0 net/core/sock.c:2921 release_sock+0x58/0x1b0 net/core/sock.c:3488 tcp_sendmsg+0x3a/0x50 net/ipv4/tcp.c:1485 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:825 sock_sendmsg_nosec net/socket.c:722 [inline] sock_sendmsg+0xde/0x190 net/socket.c:745 sock_write_iter+0x295/0x3d0 net/socket.c:1136 call_write_iter include/linux/fs.h:1849 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ed/0xe10 fs/read_write.c:584 ksys_write+0x1ec/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88802cdb1000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of 1024-byte region [ffff88802cdb1000, ffff88802cdb1400) The buggy address belongs to the physical page: page:ffffea0000b36c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2cdb0 head:ffffea0000b36c00 order:3 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012441dc0 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5129, tgid 5129 (syz-executor.2), ts 184900731766, free_ts 0 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2d00 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5c0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2287 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x136/0x330 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc_node+0x4d/0xd0 mm/slab_common.c:975 kmalloc_node include/linux/slab.h:610 [inline] kzalloc_node include/linux/slab.h:731 [inline] qdisc_alloc+0xb0/0xb00 net/sched/sch_generic.c:938 qdisc_create_dflt+0x79/0x560 net/sched/sch_generic.c:996 attach_one_default_qdisc net/sched/sch_generic.c:1151 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2481 [inline] attach_default_qdiscs net/sched/sch_generic.c:1169 [inline] dev_activate+0x79e/0x1350 net/sched/sch_generic.c:1228 __dev_open+0x393/0x4d0 net/core/dev.c:1426 __dev_change_flags+0x587/0x750 net/core/dev.c:8525 dev_change_flags+0x97/0x170 net/core/dev.c:8597 do_setlink+0x9f4/0x3d30 net/core/rtnetlink.c:2833 __rtnl_newlink+0xd69/0x1840 net/core/rtnetlink.c:3623 page_owner free stack trace missing Memory state around the buggy address: ffff88802cdb0f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802cdb0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802cdb1000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88802cdb1080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802cdb1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================