bisecting fixing commit since 3f667b5d4053ad54aee13dab5c94f04ff75ddfdf building syzkaller on 44068e196185e2f5a7c94629b6245cdde008b140 testing commit 3f667b5d4053ad54aee13dab5c94f04ff75ddfdf compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 7602b70fbb89813a228ca0cd81c4ac0495ec6965b0162072797bd961447e4cb2 all runs: crashed: KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch testing current HEAD 99613159ad749543621da8238acf1a122880144e testing commit 99613159ad749543621da8238acf1a122880144e compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 17ec3a1ceb17bda75f456e15c2561d438f84acce99f2a4e83e4027d664796c7d all runs: crashed: KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch revisions tested: 2, total time: 20m9.025568734s (build: 13m4.197998821s, test: 6m34.919883122s) the crash still happens on HEAD commit msg: Merge tag 'dmaengine-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine crash: KASAN: slab-out-of-bounds Read in __htab_map_lookup_and_delete_batch ================================================================== 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+0x5c/0xc0 lib/usercopy.c:26 Read of size 42 at addr ffff8880177fe200 by task syz-executor692/4114 CPU: 1 PID: 4114 Comm: syz-executor692 Not tainted 5.16.0-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+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 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+0x5c/0xc0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:200 [inline] __htab_map_lookup_and_delete_batch+0xb71/0x1460 kernel/bpf/hashtab.c:1768 bpf_map_do_batch+0x1f5/0x420 kernel/bpf/syscall.c:4222 __sys_bpf+0x161f/0x4400 kernel/bpf/syscall.c:4694 __do_sys_bpf kernel/bpf/syscall.c:4738 [inline] __se_sys_bpf kernel/bpf/syscall.c:4736 [inline] __x64_sys_bpf+0x70/0xb0 kernel/bpf/syscall.c:4736 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:0x7f2343a2eb79 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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:00007f23439bf2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f2343ab73f0 RCX: 00007f2343a2eb79 RDX: 0000000000000038 RSI: 0000000020000080 RDI: 0000000000000019 RBP: 00007f2343a848e0 R08: 00007f23439bf700 R09: 0000000000000000 R10: 00007f23439bf700 R11: 0000000000000246 R12: 00000000200031c0 R13: 00007f2343a84068 R14: 00000000200021c0 R15: 00007f2343ab73f8 Allocated by task 4114: 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:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kvmalloc include/linux/slab.h:733 [inline] kvmalloc_array include/linux/slab.h:751 [inline] __htab_map_lookup_and_delete_batch+0x479/0x1460 kernel/bpf/hashtab.c:1647 bpf_map_do_batch+0x1f5/0x420 kernel/bpf/syscall.c:4222 __sys_bpf+0x161f/0x4400 kernel/bpf/syscall.c:4694 __do_sys_bpf kernel/bpf/syscall.c:4738 [inline] __se_sys_bpf kernel/bpf/syscall.c:4736 [inline] __x64_sys_bpf+0x70/0xb0 kernel/bpf/syscall.c:4736 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 The buggy address belongs to the object at ffff8880177fe200 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8880177fe200, ffff8880177fe240) The buggy address belongs to the page: page:ffffea00005dff80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x177fe flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00004760c0 dead000000000005 ffff88800fc41640 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 1056, ts 3750806203, free_ts 3023088508 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa6f/0x2f10 mm/page_alloc.c:4164 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5386 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28a/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87e/0xe80 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] kmem_cache_alloc_node_trace+0x116/0x310 mm/slub.c:3280 kmalloc_node include/linux/slab.h:600 [inline] kzalloc_node include/linux/slab.h:727 [inline] __get_vm_area_node.constprop.0+0x9b/0x300 mm/vmalloc.c:2429 __vmalloc_node_range+0x124/0xd70 mm/vmalloc.c:3092 alloc_thread_stack_node kernel/fork.c:245 [inline] dup_task_struct kernel/fork.c:887 [inline] copy_process+0x720/0x6890 kernel/fork.c:1998 kernel_clone+0xb8/0x7f0 kernel/fork.c:2555 kernel_thread+0xa3/0xe0 kernel/fork.c:2607 call_usermodehelper_exec_work kernel/umh.c:174 [inline] call_usermodehelper_exec_work+0xa4/0x140 kernel/umh.c:160 process_one_work+0x879/0x1410 kernel/workqueue.c:2307 worker_thread+0x5a0/0xf60 kernel/workqueue.c:2454 kthread+0x299/0x340 kernel/kthread.c:359 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:1351 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3324 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3440 release_pages+0x223/0xee0 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:50 [inline] tlb_flush_mmu_free mm/mmu_gather.c:243 [inline] tlb_flush_mmu mm/mmu_gather.c:250 [inline] tlb_finish_mmu+0x127/0x790 mm/mmu_gather.c:341 exit_mmap+0x1d1/0x580 mm/mmap.c:3180 __mmput+0xed/0x430 kernel/fork.c:1114 free_bprm+0x5b/0x290 fs/exec.c:1483 kernel_execve+0x2cc/0x3e0 fs/exec.c:1980 call_usermodehelper_exec_async+0x2c1/0x500 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff8880177fe100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8880177fe180: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff8880177fe200: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880177fe280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8880177fe300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================