================================================================== 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 ffff88801d2c4780 by task syz-executor.5/25527 CPU: 0 PID: 25527 Comm: syz-executor.5 Not tainted 5.15.0-rc6-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:0x7ff451b52a39 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:00007ff44f0a7188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007ff451c56020 RCX: 00007ff451b52a39 RDX: 0000000000000038 RSI: 0000000020000040 RDI: 0000000000000019 RBP: 00007ff451bace8f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffe31f1cff R14: 00007ff44f0a7300 R15: 0000000000022000 Allocated by task 25527: 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:4448 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 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348 kvfree_call_rcu+0x11b/0x880 kernel/rcu/tree.c:3552 sctp_bind_addr_clean net/sctp/bind_addr.c:125 [inline] sctp_bind_addr_free+0x14b/0x1a0 net/sctp/bind_addr.c:134 sctp_association_free+0x284/0x7b0 net/sctp/associola.c:359 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:940 [inline] sctp_cmd_interpreter+0x4091/0x5810 net/sctp/sm_sideeffect.c:1324 sctp_side_effects+0x6c/0x1f0 net/sctp/sm_sideeffect.c:1195 sctp_do_sm+0x22c/0x540 net/sctp/sm_sideeffect.c:1166 sctp_assoc_bh_rcv+0x42a/0x680 net/sctp/associola.c:1054 sctp_backlog_rcv+0x16e/0x4c0 net/sctp/input.c:344 sk_backlog_rcv include/net/sock.h:1027 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2686 release_sock+0x5d/0x1c0 net/core/sock.c:3218 sctp_wait_for_connect+0x3c6/0x6b0 net/sctp/socket.c:9306 __sctp_connect+0x10c1/0x1370 net/sctp/socket.c:1244 __sctp_setsockopt_connectx net/sctp/socket.c:1333 [inline] sctp_getsockopt_connectx3+0x459/0x710 net/sctp/socket.c:1418 sctp_getsockopt+0x9fe/0xec70 net/sctp/socket.c:8101 __sys_getsockopt+0x29f/0x560 net/socket.c:2220 __do_sys_getsockopt net/socket.c:2235 [inline] __se_sys_getsockopt net/socket.c:2232 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2232 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 Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0x1c4/0xa80 kernel/rcu/tree.c:3067 release_probes kernel/tracepoint.c:164 [inline] tracepoint_remove_func kernel/tracepoint.c:458 [inline] tracepoint_probe_unregister+0x953/0x9c0 kernel/tracepoint.c:551 trace_event_reg+0x215/0x250 perf_trace_event_unreg+0xaf/0x220 kernel/trace/trace_event_perf.c:162 perf_trace_destroy+0x93/0xb0 kernel/trace/trace_event_perf.c:243 _free_event+0x874/0xe50 kernel/events/core.c:4982 put_event kernel/events/core.c:5076 [inline] perf_event_release_kernel+0x86f/0x900 kernel/events/core.c:5191 perf_release+0x37/0x40 kernel/events/core.c:5201 __fput+0x3fe/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x209/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801d2c4780 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801d2c4780, ffff88801d2c47c0) The buggy address belongs to the page: page:ffffea000074b100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d2c4 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00006c2a40 0000001a0000001a 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 9336, ts 371097882465, free_ts 365448083352 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:1770 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1907 new_slab mm/slub.c:1970 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3001 __slab_alloc mm/slub.c:3088 [inline] slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x2e9/0x370 mm/slub.c:4396 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_rx_mgmt_probe_beacon net/mac80211/ibss.c:1605 [inline] ieee80211_ibss_rx_queued_mgmt+0x415/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+0x7d/0x580 mm/page_alloc.c:3394 free_slab mm/slub.c:2010 [inline] discard_slab mm/slub.c:2016 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2502 put_cpu_partial+0x132/0x1a0 mm/slub.c:2582 do_slab_free mm/slub.c:3480 [inline] ___cache_free+0xe6/0x120 mm/slub.c:3499 qlist_free_all mm/kasan/quarantine.c:165 [inline] kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3213 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc+0x1c3/0x300 mm/slub.c:3226 getname_flags+0xba/0x650 fs/namei.c:138 user_path_at_empty+0x2a/0x1a0 fs/namei.c:2800 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x10a/0x3f0 fs/stat.c:221 vfs_fstatat fs/stat.c:243 [inline] vfs_lstat include/linux/fs.h:3356 [inline] __do_sys_newlstat fs/stat.c:398 [inline] __se_sys_newlstat+0xba/0x750 fs/stat.c:392 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 Memory state around the buggy address: ffff88801d2c4680: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801d2c4700: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff88801d2c4780: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801d2c4800: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88801d2c4880: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ==================================================================