================================================================== 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 ffff88801efd3180 by task syz-executor.3/19050 CPU: 0 PID: 19050 Comm: syz-executor.3 Not tainted 5.16.0-rc3-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+0x65/0x380 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:450 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+0x424/0x530 __sys_bpf+0xe0b/0x12dc0 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4735 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:0x7f2e8a1ddae9 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:00007f2e87711188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f2e8a2f10e0 RCX: 00007f2e8a1ddae9 RDX: 0000000000000038 RSI: 0000000020000040 RDI: 0000000000000019 RBP: 00007f2e8a237f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdfa6867bf R14: 00007f2e87711300 R15: 0000000000022000 Allocated by task 19050: 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:269 [inline] __kmalloc_node+0x28e/0x420 mm/slub.c:4471 kmalloc_node include/linux/slab.h:613 [inline] kvmalloc_node+0x81/0x110 mm/util.c:587 kvmalloc include/linux/slab.h:741 [inline] kvmalloc_array include/linux/slab.h:759 [inline] __htab_map_lookup_and_delete_batch+0x43b/0x2160 kernel/bpf/hashtab.c:1647 bpf_map_do_batch+0x424/0x530 __sys_bpf+0xe0b/0x12dc0 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4735 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+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xfa/0x130 mm/kasan/generic.c:348 kvfree_call_rcu+0x119/0x880 kernel/rcu/tree.c:3550 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_primitive_SHUTDOWN+0x93/0xc0 net/sctp/primitive.c:89 sctp_close+0x3b3/0x910 net/sctp/socket.c:1525 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:427 __sock_release net/socket.c:649 [inline] sock_close+0xd8/0x260 net/socket.c:1314 __fput+0x3fc/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 ffff88801efd3180 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801efd3180, ffff88801efd31c0) The buggy address belongs to the page: page:ffffea00007bf4c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1efd3 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001eefbc0 dead000000000004 ffff888011441640 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 9704, ts 226777410405, free_ts 226661208287 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149 __alloc_pages+0x255/0x580 mm/page_alloc.c:5369 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1930 new_slab mm/slub.c:1993 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3022 __slab_alloc mm/slub.c:3109 [inline] slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] kmem_cache_alloc_trace+0x28c/0x330 mm/slub.c:3259 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] allocate_cgrp_cset_links kernel/cgroup/cgroup.c:1150 [inline] find_css_set+0xdab/0x1af0 kernel/cgroup/cgroup.c:1228 cgroup_migrate_prepare_dst+0x10f/0xc80 kernel/cgroup/cgroup.c:2696 cgroup_attach_task+0x4e2/0x660 kernel/cgroup/cgroup.c:2802 cgroup_attach_task_all+0xba/0x130 kernel/cgroup/cgroup-v1.c:70 kvm_vm_worker_thread+0xc9/0x240 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5600 kthread+0x468/0x490 kernel/kthread.c:327 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+0xd1c/0xe00 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page_list+0x11f/0xa50 mm/page_alloc.c:3425 release_pages+0x15a7/0x17d0 mm/swap.c:980 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:3172 __mmput+0x111/0x3a0 kernel/fork.c:1113 exit_mm+0x211/0x2f0 kernel/exit.c:507 do_exit+0x688/0x24f0 kernel/exit.c:819 do_group_exit+0x168/0x2d0 kernel/exit.c:929 __do_sys_exit_group+0x13/0x20 kernel/exit.c:940 __ia32_sys_exit_group+0x0/0x40 kernel/exit.c:938 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:938 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: ffff88801efd3080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801efd3100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88801efd3180: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801efd3200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801efd3280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================