================================================================== BUG: KASAN: stack-out-of-bounds in bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] BUG: KASAN: stack-out-of-bounds in xdp_do_check_flushed+0x231/0x240 net/core/filter.c:4305 Read of size 4 at addr ffffc9000eaaf7f8 by task syz.0.482/7626 CPU: 0 UID: 0 PID: 7626 Comm: syz.0.482 Not tainted 6.11.0-rc1-next-20240729-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] xdp_do_check_flushed+0x231/0x240 net/core/filter.c:4305 __napi_poll+0xe4/0x490 net/core/dev.c:6774 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0x89b/0x1240 net/core/dev.c:6962 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 do_softirq+0x11b/0x1e0 kernel/softirq.c:455 __local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:908 [inline] __dev_queue_xmit+0x1763/0x3e90 net/core/dev.c:4450 dev_queue_xmit include/linux/netdevice.h:3105 [inline] neigh_hh_output include/net/neighbour.h:526 [inline] neigh_output include/net/neighbour.h:540 [inline] ip6_finish_output2+0xfc2/0x1680 net/ipv6/ip6_output.c:137 ip6_finish_output+0x41e/0x810 net/ipv6/ip6_output.c:222 NF_HOOK include/linux/netfilter.h:314 [inline] ip6_xmit+0xefe/0x17f0 net/ipv6/ip6_output.c:358 sctp_v6_xmit+0x9f2/0x13f0 net/sctp/ipv6.c:248 sctp_packet_transmit+0x26af/0x2ca0 net/sctp/output.c:653 sctp_packet_singleton+0x22c/0x320 net/sctp/outqueue.c:783 sctp_outq_flush_ctrl net/sctp/outqueue.c:914 [inline] sctp_outq_flush+0x6d5/0x3e20 net/sctp/outqueue.c:1212 sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x59cc/0x60c0 net/sctp/sm_sideeffect.c:1169 sctp_primitive_ASSOCIATE+0x95/0xc0 net/sctp/primitive.c:73 sctp_sendmsg_to_asoc+0xfa5/0x1800 net/sctp/socket.c:1841 sctp_sendmsg+0x1bc3/0x3520 net/sctp/socket.c:2031 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x1a6/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2204 __do_sys_sendto net/socket.c:2216 [inline] __se_sys_sendto net/socket.c:2212 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2212 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6ba03773b9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6ba1177048 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f6ba0505f80 RCX: 00007f6ba03773b9 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000007 RBP: 00007f6ba03e48e6 R08: 0000000020000180 R09: 000000000000001c R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6ba0505f80 R15: 00007fff7c677fc8 The buggy address belongs to stack of task syz.0.482/7626 and is located at offset 472 in frame: sctp_do_sm+0x0/0x60c0 This frame has 2 objects: [32, 44) 'sackh.i' [64, 400) 'commands' The buggy address belongs to the virtual mapping at [ffffc9000eaa8000, ffffc9000eab1000) created by: copy_process+0x5d1/0x3d90 kernel/fork.c:2206 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x61c7d memcg:ffff888029184882 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff888029184882 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 7578, tgid 7578 (syz.0.471), ts 291416713004, free_ts 291395666339 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3442 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4700 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2263 vm_area_alloc_pages mm/vmalloc.c:3584 [inline] __vmalloc_area_node mm/vmalloc.c:3660 [inline] __vmalloc_node_range_noprof+0x971/0x1460 mm/vmalloc.c:3841 alloc_thread_stack_node kernel/fork.c:314 [inline] dup_task_struct+0x444/0x8c0 kernel/fork.c:1115 copy_process+0x5d1/0x3d90 kernel/fork.c:2206 kernel_clone+0x226/0x8f0 kernel/fork.c:2788 __do_sys_clone3 kernel/fork.c:3092 [inline] __se_sys_clone3+0x2cb/0x350 kernel/fork.c:3071 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 7529 tgid 7529 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2612 vfree+0x186/0x2e0 mm/vmalloc.c:3364 kvm_arch_free_memslot+0x103/0x170 arch/x86/kvm/x86.c:12861 kvm_free_memslot virt/kvm/kvm_main.c:987 [inline] kvm_free_memslots+0x146/0x1f0 virt/kvm/kvm_main.c:1008 kvm_destroy_vm virt/kvm/kvm_main.c:1354 [inline] kvm_put_kvm+0xf0d/0x1300 virt/kvm/kvm_main.c:1386 kvm_vm_release+0x46/0x50 virt/kvm/kvm_main.c:1409 __fput+0x24a/0x8a0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:222 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc9000eaaf680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000eaaf700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000eaaf780: 00 00 00 00 00 00 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 ^ ffffc9000eaaf800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000eaaf880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================