================================================================== BUG: KASAN: stack-out-of-bounds in jhash2 include/linux/jhash.h:126 [inline] BUG: KASAN: stack-out-of-bounds in hash+0x177/0x410 kernel/bpf/bloom_filter.c:29 Read of size 4 at addr ffffc900140bfa20 by task syz-executor.1/8433 CPU: 0 PID: 8433 Comm: syz-executor.1 Not tainted 6.8.0-syzkaller-05236-g443574b03387 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 jhash2 include/linux/jhash.h:126 [inline] hash+0x177/0x410 kernel/bpf/bloom_filter.c:29 bloom_map_push_elem+0xcc/0x180 kernel/bpf/bloom_filter.c:61 bpf_prog_bfd19630a338eafb+0x47/0x4b __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run_xdp include/net/xdp.h:514 [inline] bpf_test_run+0x3d1/0x900 net/bpf/test_run.c:423 bpf_prog_test_run_xdp+0x7e8/0x11b0 net/bpf/test_run.c:1269 bpf_prog_test_run+0x33a/0x3b0 kernel/bpf/syscall.c:4240 __sys_bpf+0x48d/0x810 kernel/bpf/syscall.c:5649 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline] __se_sys_bpf kernel/bpf/syscall.c:5736 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5736 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7fa95cc7de69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa95c7ff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fa95cdabf80 RCX: 00007fa95cc7de69 RDX: 0000000000000010 RSI: 0000000020000740 RDI: 000000000000000a RBP: 00007fa95ccca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa95cdabf80 R15: 00007ffc2bb76f28 The buggy address belongs to stack of task syz-executor.1/8433 and is located at offset 0 in frame: bpf_test_run+0x0/0x900 This frame has 4 objects: [32, 56) 'item' [96, 112) 'run_ctx' [128, 152) 't' [192, 196) 'ret' The buggy address belongs to the virtual mapping at [ffffc900140b8000, ffffc900140c1000) created by: copy_process+0x5d1/0x3df0 kernel/fork.c:2219 The buggy address belongs to the physical page: page:ffffea00010ec8c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x43b23 memcg:ffff88801e542982 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88801e542982 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 8432, tgid 8432 (syz-executor.1), ts 335678639500, free_ts 335482776708 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x256/0x680 mm/page_alloc.c:4569 alloc_pages_mpol+0x3de/0x650 mm/mempolicy.c:2133 vm_area_alloc_pages mm/vmalloc.c:3135 [inline] __vmalloc_area_node mm/vmalloc.c:3211 [inline] __vmalloc_node_range+0x9a4/0x14a0 mm/vmalloc.c:3392 alloc_thread_stack_node kernel/fork.c:309 [inline] dup_task_struct+0x3e9/0x7d0 kernel/fork.c:1114 copy_process+0x5d1/0x3df0 kernel/fork.c:2219 kernel_clone+0x21e/0x8d0 kernel/fork.c:2796 __do_sys_clone3 kernel/fork.c:3097 [inline] __se_sys_clone3+0x2cb/0x350 kernel/fork.c:3081 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 page last free pid 60 tgid 60 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x968/0xa90 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 vfree+0x186/0x2e0 mm/vmalloc.c:2914 stack_map_free+0x3c/0x60 kernel/bpf/stackmap.c:660 bpf_map_free_deferred+0xe6/0x110 kernel/bpf/syscall.c:734 process_one_work kernel/workqueue.c:3254 [inline] process_scheduled_works+0xa00/0x1770 kernel/workqueue.c:3335 worker_thread+0x86d/0xd70 kernel/workqueue.c:3416 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Memory state around the buggy address: ffffc900140bf900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900140bf980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc900140bfa00: 00 00 00 00 f1 f1 f1 f1 00 00 00 f2 f2 f2 f2 f2 ^ ffffc900140bfa80: 00 00 f2 f2 00 00 00 f2 f2 f2 f2 f2 04 f3 f3 f3 ffffc900140bfb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================