================================================================== BUG: KASAN: use-after-free in skb_copy_bits+0x6f0/0x780 net/core/skbuff.c:2396 Read of size 4 at addr ffff888079cd9570 by task syz-executor.5/21868 CPU: 1 PID: 21868 Comm: syz-executor.5 Not tainted 5.17.0-rc1-syzkaller-00210-g6449520391df #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 skb_copy_bits+0x6f0/0x780 net/core/skbuff.c:2396 __skb_header_pointer include/linux/skbuff.h:3782 [inline] skb_header_pointer include/linux/skbuff.h:3791 [inline] do_basic_checks net/netfilter/nf_conntrack_proto_sctp.c:174 [inline] nf_conntrack_sctp_packet+0xe34/0x2500 net/netfilter/nf_conntrack_proto_sctp.c:383 nf_conntrack_handle_packet net/netfilter/nf_conntrack_core.c:1847 [inline] nf_conntrack_in+0xeb5/0x17f0 net/netfilter/nf_conntrack_core.c:1920 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xc5/0x1e0 net/netfilter/core.c:619 nf_hook.constprop.0+0x3ac/0x650 include/linux/netfilter.h:262 NF_HOOK include/linux/netfilter.h:305 [inline] ipv6_rcv+0x9e/0x3b0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797 __napi_poll+0xaf/0x440 net/core/dev.c:6365 napi_poll net/core/dev.c:6432 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:6519 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:__syscall_enter_from_user_work kernel/entry/common.c:87 [inline] RIP: 0010:syscall_enter_from_user_mode+0x2b/0x70 kernel/entry/common.c:108 Code: 54 49 89 f4 55 48 89 fd 48 8b 7c 24 10 e8 ed f5 ff ff eb 27 eb 2b e8 74 93 30 f8 e8 af 91 30 f8 fb 65 48 8b 04 25 00 70 02 00 <48> 8b 70 08 40 f6 c6 3f 75 19 4c 89 e0 5d 41 5c c3 eb 1b 0f 0b eb RSP: 0018:ffffc900050aff28 EFLAGS: 00000202 RAX: ffff88801d741d00 RBX: 0000000000000000 RCX: 1ffffffff1b293b1 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900050aff58 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff817ea2d8 R11: 0000000000000000 R12: 00000000000000ca R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 do_syscall_64+0x16/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f01371b9059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffca1f23958 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 00007f01372cc03c RCX: 00007f01371b9059 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f01372cc03c RBP: 00007ffca1f23ad8 R08: 0000000000000000 R09: 00000000000000d0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f01372cc03c R13: 0000000000000001 R14: 00007f01372cc030 R15: 0000000000000032 Allocated by task 21868: 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:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] kmem_cache_alloc_node+0x255/0x3f0 mm/slub.c:3266 __alloc_skb+0x215/0x340 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1158 [inline] sctp_packet_pack net/sctp/output.c:471 [inline] sctp_packet_transmit+0xcca/0x3070 net/sctp/output.c:620 sctp_packet_transmit_chunk+0x114/0x260 net/sctp/output.c:193 sctp_outq_flush_data+0xa1a/0x26c0 net/sctp/outqueue.c:1104 sctp_outq_flush net/sctp/outqueue.c:1210 [inline] sctp_outq_uncork+0x178/0x200 net/sctp/outqueue.c:761 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1812 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1195 [inline] sctp_do_sm+0x745/0x4ed0 net/sctp/sm_sideeffect.c:1166 sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1054 sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80 sctp_rcv+0x1018/0x32f0 net/sctp/input.c:256 sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109 ip6_protocol_deliver_rcu+0x2e9/0x1d10 net/ipv6/ip6_input.c:422 ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797 __napi_poll+0xaf/0x440 net/core/dev.c:6365 napi_poll net/core/dev.c:6432 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:6519 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Freed by task 21868: 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:366 [inline] ____kasan_slab_free+0x130/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kmem_cache_free+0xd8/0x340 mm/slub.c:3526 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:700 __kfree_skb net/core/skbuff.c:757 [inline] consume_skb net/core/skbuff.c:914 [inline] consume_skb+0xcf/0x160 net/core/skbuff.c:908 sctp_chunk_destroy net/sctp/sm_make_chunk.c:1503 [inline] sctp_chunk_put+0x1c0/0x2d0 net/sctp/sm_make_chunk.c:1530 sctp_inq_free+0x17f/0x260 net/sctp/inqueue.c:56 sctp_association_free+0x221/0x7d0 net/sctp/associola.c:348 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:940 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1324 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1195 [inline] sctp_do_sm+0x365d/0x4ed0 net/sctp/sm_sideeffect.c:1166 sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1054 sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80 sctp_rcv+0x1018/0x32f0 net/sctp/input.c:256 sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109 ip6_protocol_deliver_rcu+0x2e9/0x1d10 net/ipv6/ip6_input.c:422 ip6_input_finish+0x62/0x170 net/ipv6/ip6_input.c:463 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:472 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797 __napi_poll+0xaf/0x440 net/core/dev.c:6365 napi_poll net/core/dev.c:6432 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:6519 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 The buggy address belongs to the object at ffff888079cd9500 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 112 bytes inside of 232-byte region [ffff888079cd9500, ffff888079cd95e8) The buggy address belongs to the page: page:ffffea0001e73640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79cd9 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff8881447ee000 raw: 0000000000000000 00000000000c000c 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 21868, ts 786446100102, free_ts 778128552870 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28a/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87c/0xe90 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] kmem_cache_alloc_node+0x122/0x3f0 mm/slub.c:3266 __alloc_skb+0x215/0x340 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1158 [inline] _sctp_make_chunk+0x50/0x260 net/sctp/sm_make_chunk.c:1443 sctp_make_control+0x30/0x2d0 net/sctp/sm_make_chunk.c:1490 sctp_make_sack+0x18f/0x500 net/sctp/sm_make_chunk.c:785 sctp_gen_sack net/sctp/sm_sideeffect.c:206 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1355 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1195 [inline] sctp_do_sm+0x3ed5/0x4ed0 net/sctp/sm_sideeffect.c:1166 sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1054 sctp_inq_push+0x1d2/0x270 net/sctp/inqueue.c:80 sctp_rcv+0x1018/0x32f0 net/sctp/input.c:256 sctp6_rcv+0x38/0x60 net/sctp/ipv6.c:1109 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3441 release_pages+0x317/0x1220 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:50 [inline] tlb_flush_mmu_free mm/mmu_gather.c:243 [inline] tlb_flush_mmu mm/mmu_gather.c:250 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:341 exit_mmap+0x21b/0x670 mm/mmap.c:3180 __mmput+0x122/0x4b0 kernel/fork.c:1114 mmput+0x56/0x60 kernel/fork.c:1135 exit_mm kernel/exit.c:507 [inline] do_exit+0xa3c/0x2a30 kernel/exit.c:793 do_group_exit+0xd2/0x2f0 kernel/exit.c:935 get_signal+0x4b0/0x28c0 kernel/signal.c:2862 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888079cd9400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888079cd9480: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff888079cd9500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888079cd9580: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff888079cd9600: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 54 push %rsp 1: 49 89 f4 mov %rsi,%r12 4: 55 push %rbp 5: 48 89 fd mov %rdi,%rbp 8: 48 8b 7c 24 10 mov 0x10(%rsp),%rdi d: e8 ed f5 ff ff callq 0xfffff5ff 12: eb 27 jmp 0x3b 14: eb 2b jmp 0x41 16: e8 74 93 30 f8 callq 0xf830938f 1b: e8 af 91 30 f8 callq 0xf83091cf 20: fb sti 21: 65 48 8b 04 25 00 70 mov %gs:0x27000,%rax 28: 02 00 * 2a: 48 8b 70 08 mov 0x8(%rax),%rsi <-- trapping instruction 2e: 40 f6 c6 3f test $0x3f,%sil 32: 75 19 jne 0x4d 34: 4c 89 e0 mov %r12,%rax 37: 5d pop %rbp 38: 41 5c pop %r12 3a: c3 retq 3b: eb 1b jmp 0x58 3d: 0f 0b ud2 3f: eb .byte 0xeb