================================================================== BUG: KASAN: slab-out-of-bounds in copy_array+0x96/0x100 kernel/bpf/verifier.c:1072 Write of size 80 at addr ffff88807e7e5a00 by task syz-executor.3/8912 CPU: 1 PID: 8912 Comm: syz-executor.3 Not tainted 6.1.0-syzkaller-14011-gd75858ef108c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 memcpy+0x3d/0x60 mm/kasan/shadow.c:66 copy_array+0x96/0x100 kernel/bpf/verifier.c:1072 copy_verifier_state+0xa9/0xc60 kernel/bpf/verifier.c:1250 pop_stack+0x8c/0x2f0 kernel/bpf/verifier.c:1314 do_check kernel/bpf/verifier.c:14042 [inline] do_check_common+0x5663/0xbca0 kernel/bpf/verifier.c:16300 do_check_main kernel/bpf/verifier.c:16363 [inline] bpf_check+0x7348/0xacc0 kernel/bpf/verifier.c:16947 bpf_prog_load+0x1543/0x2230 kernel/bpf/syscall.c:2619 __sys_bpf+0x1435/0x5000 kernel/bpf/syscall.c:4979 __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] __se_sys_bpf kernel/bpf/syscall.c:5081 [inline] __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5081 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 RIP: 0033:0x7fb48888c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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:00007fb4895ba168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fb4889ac050 RCX: 00007fb48888c0c9 RDX: 0000000000000048 RSI: 0000000020000200 RDI: 0000000000000005 RBP: 00007fb4888e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf972f67f R14: 00007fb4895ba300 R15: 0000000000022000 Allocated by task 8912: 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:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_krealloc+0x145/0x180 mm/kasan/common.c:439 kasan_krealloc include/linux/kasan.h:231 [inline] __do_krealloc mm/slab_common.c:1361 [inline] krealloc+0xa8/0x100 mm/slab_common.c:1398 push_jmp_history+0x13e/0x330 kernel/bpf/verifier.c:2596 is_state_visited kernel/bpf/verifier.c:13563 [inline] do_check kernel/bpf/verifier.c:13763 [inline] do_check_common+0x50e5/0xbca0 kernel/bpf/verifier.c:16300 do_check_main kernel/bpf/verifier.c:16363 [inline] bpf_check+0x7348/0xacc0 kernel/bpf/verifier.c:16947 bpf_prog_load+0x1543/0x2230 kernel/bpf/syscall.c:2619 __sys_bpf+0x1435/0x5000 kernel/bpf/syscall.c:4979 __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] __se_sys_bpf kernel/bpf/syscall.c:5081 [inline] __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5081 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 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3376 cfg80211_update_known_bss+0x827/0xa70 net/wireless/scan.c:1681 cfg80211_bss_update+0xf3/0x21b0 net/wireless/scan.c:1728 cfg80211_inform_single_bss_frame_data+0x761/0xfc0 net/wireless/scan.c:2492 cfg80211_inform_bss_frame_data+0xc3/0xc80 net/wireless/scan.c:2525 ieee80211_bss_info_update+0x35c/0xaf0 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1120 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline] ieee80211_ibss_rx_queued_mgmt+0x19fc/0x3160 net/mac80211/ibss.c:1638 ieee80211_iface_process_skb net/mac80211/iface.c:1581 [inline] ieee80211_iface_work+0xa4d/0xd70 net/mac80211/iface.c:1635 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3376 cfg80211_update_known_bss+0x827/0xa70 net/wireless/scan.c:1681 cfg80211_bss_update+0xf3/0x21b0 net/wireless/scan.c:1728 cfg80211_inform_single_bss_frame_data+0x761/0xfc0 net/wireless/scan.c:2492 cfg80211_inform_bss_frame_data+0xc3/0xc80 net/wireless/scan.c:2525 ieee80211_bss_info_update+0x35c/0xaf0 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1120 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline] ieee80211_ibss_rx_queued_mgmt+0x19fc/0x3160 net/mac80211/ibss.c:1638 ieee80211_iface_process_skb net/mac80211/iface.c:1581 [inline] ieee80211_iface_work+0xa4d/0xd70 net/mac80211/iface.c:1635 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88807e7e5a00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 0 bytes inside of 96-byte region [ffff88807e7e5a00, ffff88807e7e5a60) The buggy address belongs to the physical page: page:ffffea0001f9f940 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e7e5 anon flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012441780 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080200020 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 26, tgid 26 (kworker/1:1), ts 81832857204, free_ts 81737131744 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 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+0x1a4/0x430 mm/slub.c:3491 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] dst_cow_metrics_generic+0x4c/0x1f0 net/core/dst.c:199 dst_metrics_write_ptr include/net/dst.h:119 [inline] dst_metric_set include/net/dst.h:180 [inline] icmp6_dst_alloc+0x4c4/0x680 net/ipv6/route.c:3274 mld_sendpack+0x5de/0xe70 net/ipv6/mcast.c:1809 mld_send_initial_cr.part.0+0x194/0x230 net/ipv6/mcast.c:2239 mld_send_initial_cr net/ipv6/mcast.c:1232 [inline] ipv6_mc_dad_complete+0x1d4/0x680 net/ipv6/mcast.c:2247 addrconf_dad_completed+0xa01/0xda0 net/ipv6/addrconf.c:4228 addrconf_dad_work+0x75d/0x12d0 net/ipv6/addrconf.c:4157 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page_list+0x176/0xcd0 mm/page_alloc.c:3510 release_pages+0xcb1/0x1330 mm/swap.c:1076 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:97 tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu mm/mmu_gather.c:299 [inline] tlb_finish_mmu+0x14b/0x7e0 mm/mmu_gather.c:391 exit_mmap+0x202/0x7b0 mm/mmap.c:3096 __mmput+0x128/0x4c0 kernel/fork.c:1207 mmput+0x60/0x70 kernel/fork.c:1229 exit_mm kernel/exit.c:563 [inline] do_exit+0x9ac/0x2950 kernel/exit.c:854 do_group_exit+0xd4/0x2a0 kernel/exit.c:1010 get_signal+0x21c3/0x2450 kernel/signal.c:2859 arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:296 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88807e7e5900: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88807e7e5980: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88807e7e5a00: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807e7e5a80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff88807e7e5b00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc ==================================================================