================================================================== BUG: KASAN: stack-out-of-bounds in jhash2 include/linux/jhash.h:128 [inline] BUG: KASAN: stack-out-of-bounds in hash+0x227/0xc20 kernel/bpf/bloom_filter.c:36 Read of size 4 at addr ffffc9000407ed00 by task syz.2.2410/9419 CPU: 0 PID: 9419 Comm: syz.2.2410 Not tainted 6.1.84-syzkaller-00131-g81e9f0610c73 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 jhash2 include/linux/jhash.h:128 [inline] hash+0x227/0xc20 kernel/bpf/bloom_filter.c:36 bloom_map_peek_elem+0xac/0x1a0 kernel/bpf/bloom_filter.c:51 bpf_prog_00798911c748094f+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x133/0x290 kernel/trace/bpf_trace.c:2312 __bpf_trace_kfree+0x6f/0x90 include/trace/events/kmem.h:94 __traceiter_kfree+0x2a/0x40 include/trace/events/kmem.h:94 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0xce/0xf0 mm/slab_common.c:996 kvfree+0x35/0x40 mm/util.c:639 __vunmap+0xaa4/0xb60 mm/vmalloc.c:2733 __vfree mm/vmalloc.c:2776 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2807 bpf_prog_calc_tag+0x65f/0x8f0 kernel/bpf/core.c:343 resolve_pseudo_ldimm64+0xe2/0x1240 kernel/bpf/verifier.c:13057 bpf_check+0x57be/0x16560 kernel/bpf/verifier.c:15588 bpf_prog_load+0x1304/0x1bf0 kernel/bpf/syscall.c:2611 __sys_bpf+0x52c/0x7f0 kernel/bpf/syscall.c:4987 __do_sys_bpf kernel/bpf/syscall.c:5091 [inline] __se_sys_bpf kernel/bpf/syscall.c:5089 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5089 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f3c3af75b99 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3c3bdc9048 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f3c3b103fa0 RCX: 00007f3c3af75b99 RDX: 0000000000000090 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007f3c3aff677e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f3c3b103fa0 R15: 00007ffcc323ba98 The buggy address belongs to stack of task syz.2.2410/9419 and is located at offset 0 in frame: bpf_trace_run2+0x0/0x290 This frame has 1 object: [32, 48) 'args' The buggy address belongs to the virtual mapping at [ffffc90004078000, ffffc90004081000) created by: copy_process+0x5c3/0x3530 kernel/fork.c:2199 The buggy address belongs to the physical page: page:ffffea0004923ac0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1248eb flags: 0x4000000000000000(zone=1) raw: 4000000000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 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 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 9418, tgid 9418 (syz.2.2410), ts 470009490663, free_ts 461565087374 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5714 __vmalloc_area_node mm/vmalloc.c:3062 [inline] __vmalloc_node_range+0x89b/0x1540 mm/vmalloc.c:3234 alloc_thread_stack_node kernel/fork.c:318 [inline] dup_task_struct+0x3d6/0x7d0 kernel/fork.c:1080 copy_process+0x5c3/0x3530 kernel/fork.c:2199 kernel_clone+0x229/0x890 kernel/fork.c:2786 __do_sys_clone3 kernel/fork.c:3087 [inline] __se_sys_clone3 kernel/fork.c:3071 [inline] __x64_sys_clone3+0x35c/0x390 kernel/fork.c:3071 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page+0xb2/0x5c0 mm/page_alloc.c:3594 free_the_page mm/page_alloc.c:798 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5803 __vunmap+0x9f3/0xb60 mm/vmalloc.c:2728 __vfree mm/vmalloc.c:2776 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2807 kcov_put kernel/kcov.c:428 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:524 __fput+0x3ab/0x870 fs/file_table.c:320 ____fput+0x15/0x20 fs/file_table.c:348 task_work_run+0x24d/0x2e0 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xbd5/0x2b80 kernel/exit.c:875 do_group_exit+0x21a/0x2d0 kernel/exit.c:1025 __do_sys_exit_group kernel/exit.c:1036 [inline] __se_sys_exit_group kernel/exit.c:1034 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1034 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffffc9000407ec00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000407ec80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000407ed00: f1 f1 f1 f1 00 00 f3 f3 00 00 00 00 00 00 00 00 ^ ffffc9000407ed80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000407ee00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================