================================================================== BUG: KASAN: slab-out-of-bounds in instrument_copy_to_user include/linux/instrumented.h:118 [inline] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0xe1/0x130 lib/usercopy.c:32 Read of size 42 at addr ffff88801e138280 by task syz-executor.0/13293 CPU: 1 PID: 13293 Comm: syz-executor.0 Not tainted 5.15.0-rc1-syzkaller #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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x66/0x3e0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:459 kasan_check_range+0x2b5/0x2f0 mm/kasan/generic.c:189 instrument_copy_to_user include/linux/instrumented.h:118 [inline] _copy_to_user+0xe1/0x130 lib/usercopy.c:32 copy_to_user include/linux/uaccess.h:200 [inline] __htab_map_lookup_and_delete_batch+0x1a63/0x2160 kernel/bpf/hashtab.c:1768 bpf_map_do_batch+0x396/0x490 __sys_bpf+0xde4/0x12c70 __do_sys_bpf kernel/bpf/syscall.c:4691 [inline] __se_sys_bpf kernel/bpf/syscall.c:4689 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4689 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f3c57bd7739 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3c5512d188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f3c57cdc038 RCX: 00007f3c57bd7739 RDX: 0000000000000038 RSI: 0000000020000040 RDI: 0000000000000019 RBP: 00007f3c57c31cc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3c57cdc038 R13: 00007ffe8c029f7f R14: 00007f3c5512d300 R15: 0000000000022000 Allocated by task 13293: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node+0x288/0x400 mm/slub.c:4439 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x81/0x110 mm/util.c:587 kvmalloc include/linux/mm.h:805 [inline] kvmalloc_array include/linux/mm.h:823 [inline] __htab_map_lookup_and_delete_batch+0x43b/0x2160 kernel/bpf/hashtab.c:1647 bpf_map_do_batch+0x396/0x490 __sys_bpf+0xde4/0x12c70 __do_sys_bpf kernel/bpf/syscall.c:4691 [inline] __se_sys_bpf kernel/bpf/syscall.c:4689 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4689 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801e138280 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801e138280, ffff88801e1382c0) The buggy address belongs to the page: page:ffffea0000784e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1e138 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000693540 0000000b0000000b ffff888011041640 raw: 0000000000000000 0000000000200020 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 10, ts 222580310678, free_ts 221886261105 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4153 __alloc_pages+0x255/0x580 mm/page_alloc.c:5375 alloc_slab_page mm/slub.c:1763 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1900 new_slab mm/slub.c:1963 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:2994 __slab_alloc mm/slub.c:3081 [inline] slab_alloc_node mm/slub.c:3172 [inline] slab_alloc mm/slub.c:3214 [inline] __kmalloc+0x2e9/0x370 mm/slub.c:4387 kmalloc include/linux/slab.h:596 [inline] ieee802_11_parse_elems_crc+0xfd/0x1020 net/mac80211/util.c:1477 ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2207 [inline] ieee80211_bss_info_update+0x81a/0xbc0 net/mac80211/scan.c:212 ieee80211_rx_bss_info net/mac80211/ibss.c:1119 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1608 [inline] ieee80211_ibss_rx_queued_mgmt+0x1707/0x2b40 net/mac80211/ibss.c:1635 ieee80211_iface_process_skb net/mac80211/iface.c:1439 [inline] ieee80211_iface_work+0x709/0xc90 net/mac80211/iface.c:1493 process_one_work+0x853/0x1140 kernel/workqueue.c:2297 worker_thread+0xac1/0x1320 kernel/workqueue.c:2444 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page_list+0x11f/0xa50 mm/page_alloc.c:3431 release_pages+0x18cb/0x1b00 mm/swap.c:950 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu+0x780/0x910 mm/mmu_gather.c:249 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:340 exit_mmap+0x3dd/0x6f0 mm/mmap.c:3173 __mmput+0x111/0x3a0 kernel/fork.c:1115 exit_mm+0x63e/0x7a0 kernel/exit.c:501 do_exit+0x67f/0x2580 kernel/exit.c:812 do_group_exit+0x168/0x2d0 kernel/exit.c:922 get_signal+0x16e0/0x20c0 kernel/signal.c:2868 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:865 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+0x191/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:302 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88801e138180: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc ffff88801e138200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88801e138280: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801e138300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801e138380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================