================================================================== 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 lib/usercopy.c:32 [inline] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0xc7/0x150 lib/usercopy.c:26 Read of size 42 at addr ffff88801d14e580 by task syz-executor.4/29168 CPU: 0 PID: 29168 Comm: syz-executor.4 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+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_copy_to_user include/linux/instrumented.h:118 [inline] _copy_to_user lib/usercopy.c:32 [inline] _copy_to_user+0xc7/0x150 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:200 [inline] __htab_map_lookup_and_delete_batch+0xedb/0x18b0 kernel/bpf/hashtab.c:1768 bpf_map_do_batch+0x2dd/0x5c0 kernel/bpf/syscall.c:4221 __sys_bpf+0x288b/0x5980 kernel/bpf/syscall.c:4693 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4735 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7ff909640ae9 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:00007ff906b53188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007ff9097541a0 RCX: 00007ff909640ae9 RDX: 0000000000000038 RSI: 0000000020000080 RDI: 0000000000000019 RBP: 00007ff90969af6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdd732688f R14: 00007ff906b53300 R15: 0000000000022000 Allocated by task 29168: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc_node include/linux/slab.h:613 [inline] kvmalloc_node+0x61/0x120 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+0x525/0x18b0 kernel/bpf/hashtab.c:1647 bpf_map_do_batch+0x2dd/0x5c0 kernel/bpf/syscall.c:4221 __sys_bpf+0x288b/0x5980 kernel/bpf/syscall.c:4693 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4735 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2985 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065 __percpu_ref_switch_to_atomic lib/percpu-refcount.c:232 [inline] __percpu_ref_switch_mode+0x398/0x830 lib/percpu-refcount.c:279 percpu_ref_kill_and_confirm+0x8a/0x180 lib/percpu-refcount.c:393 blkg_destroy_all+0xcc/0x220 block/blk-cgroup.c:436 blkcg_exit_queue+0x11/0x20 block/blk-cgroup.c:1232 blk_exit_queue block/blk-sysfs.c:758 [inline] blk_release_queue+0x14c/0x320 block/blk-sysfs.c:794 kobject_cleanup lib/kobject.c:705 [inline] kobject_release lib/kobject.c:736 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c8/0x540 lib/kobject.c:753 scsi_device_dev_release_usercontext+0x62d/0xdd0 drivers/scsi/scsi_sysfs.c:473 execute_in_process_context+0x37/0x150 kernel/workqueue.c:3359 device_release+0x9f/0x240 drivers/base/core.c:2230 kobject_cleanup lib/kobject.c:705 [inline] kobject_release lib/kobject.c:736 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c8/0x540 lib/kobject.c:753 put_device+0x1b/0x30 drivers/base/core.c:3501 __scsi_remove_device+0x1dd/0x330 drivers/scsi/scsi_sysfs.c:1472 scsi_probe_and_add_lun+0x2666/0x3590 drivers/scsi/scsi_scan.c:1221 __scsi_scan_target+0x21f/0xdb0 drivers/scsi/scsi_scan.c:1604 scsi_scan_channel drivers/scsi/scsi_scan.c:1692 [inline] scsi_scan_channel+0x148/0x1e0 drivers/scsi/scsi_scan.c:1668 scsi_scan_host_selected+0x2df/0x3b0 drivers/scsi/scsi_scan.c:1721 do_scsi_scan_host+0x1e8/0x260 drivers/scsi/scsi_scan.c:1860 do_scan_async+0x3e/0x500 drivers/scsi/scsi_scan.c:1870 async_run_entry_fn+0x9d/0x550 kernel/async.c:127 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88801d14e580 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801d14e580, ffff88801d14e5c0) The buggy address belongs to the page: page:ffffea0000745380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d14e flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001d8bd00 dead000000000005 ffff888010c41640 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 10, ts 8676245131, free_ts 8637060873 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] __kmalloc+0x2fb/0x340 mm/slub.c:4419 kmalloc include/linux/slab.h:595 [inline] kzalloc include/linux/slab.h:724 [inline] lsm_task_alloc security/security.c:614 [inline] security_task_alloc+0x10b/0x250 security/security.c:1644 copy_process+0x2132/0x75a0 kernel/fork.c:2173 kernel_clone+0xe7/0xab0 kernel/fork.c:2582 kernel_thread+0xb5/0xf0 kernel/fork.c:2634 call_usermodehelper_exec_work kernel/umh.c:174 [inline] call_usermodehelper_exec_work+0xcc/0x180 kernel/umh.c:160 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 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+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3425 release_pages+0x3f4/0x1480 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 mm/mmu_gather.c:249 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340 exit_mmap+0x1ea/0x630 mm/mmap.c:3172 __mmput+0x122/0x4b0 kernel/fork.c:1113 mmput+0x56/0x60 kernel/fork.c:1134 free_bprm+0x65/0x2e0 fs/exec.c:1481 kernel_execve+0x380/0x460 fs/exec.c:1978 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88801d14e480: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88801d14e500: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff88801d14e580: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88801d14e600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88801d14e680: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================