================================================================== 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 ffffc90003d4e860 by task syz-executor.0/5181 CPU: 0 PID: 5181 Comm: syz-executor.0 Not tainted 6.1.75-syzkaller-00089-g1794308d463f #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+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:600 [inline] bpf_prog_run include/linux/filter.h:607 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2275 [inline] bpf_trace_run1+0x106/0x240 kernel/trace/bpf_trace.c:2313 __bpf_trace_scsi_dispatch_cmd_start+0x1d/0x30 include/trace/events/scsi.h:156 __traceiter_scsi_dispatch_cmd_start+0x68/0xb0 include/trace/events/scsi.h:156 trace_scsi_dispatch_cmd_start include/trace/events/scsi.h:156 [inline] scsi_dispatch_cmd drivers/scsi/scsi_lib.c:1520 [inline] scsi_queue_rq+0x2ed1/0x3060 drivers/scsi/scsi_lib.c:1763 blk_mq_dispatch_rq_list+0xffb/0x23c0 block/blk-mq.c:2051 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:172 [inline] blk_mq_do_dispatch_sched+0x8be/0xf10 block/blk-mq-sched.c:186 __blk_mq_sched_dispatch_requests+0x39b/0x490 blk_mq_sched_dispatch_requests+0xf0/0x160 block/blk-mq-sched.c:338 __blk_mq_run_hw_queue+0xb8/0x150 block/blk-mq.c:2170 __blk_mq_delay_run_hw_queue+0x112/0x580 block/blk-mq.c:2246 blk_mq_run_hw_queue+0x265/0x4c0 block/blk-mq.c:2294 blk_mq_sched_insert_requests+0x2b1/0x420 block/blk-mq-sched.c:492 blk_mq_dispatch_plug_list block/blk-mq.c:2755 [inline] blk_mq_flush_plug_list+0x7a0/0x9d0 block/blk-mq.c:2804 __blk_flush_plug+0x442/0x4c0 block/blk-core.c:1152 blk_finish_plug+0x5d/0x80 block/blk-core.c:1176 ext4_writepages+0x3280/0x3fd0 fs/ext4/inode.c:2895 do_writepages+0x385/0x620 mm/page-writeback.c:2472 filemap_fdatawrite_wbc+0x153/0x1b0 mm/filemap.c:402 __filemap_fdatawrite_range mm/filemap.c:435 [inline] file_write_and_wait_range+0x1ca/0x2b0 mm/filemap.c:788 ext4_sync_file+0x1a2/0xa50 fs/ext4/fsync.c:151 vfs_fsync_range+0x17b/0x190 fs/sync.c:188 generic_write_sync include/linux/fs.h:2951 [inline] ext4_buffered_write_iter+0x587/0x640 fs/ext4/file.c:292 ext4_file_write_iter+0x194/0x1570 call_write_iter include/linux/fs.h:2258 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x902/0xeb0 fs/read_write.c:584 ksys_write+0x199/0x2c0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:646 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:0x7f6caa27dca9 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:00007f6cab0b40c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f6caa3abf80 RCX: 00007f6caa27dca9 RDX: 0000000000000012 RSI: 0000000020000980 RDI: 0000000000000004 RBP: 00007f6caa2c947e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6caa3abf80 R15: 00007fffa16c3048 The buggy address belongs to stack of task syz-executor.0/5181 and is located at offset 0 in frame: bpf_trace_run1+0x0/0x240 This frame has 1 object: [32, 40) 'args' The buggy address belongs to the virtual mapping at [ffffc90003d48000, ffffc90003d51000) created by: copy_process+0x5c3/0x3530 kernel/fork.c:2199 The buggy address belongs to the physical page: page:ffffea0005272100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x149c84 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 5174, tgid 5174 (syz-executor.0), ts 86429354720, free_ts 86412162164 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:5712 __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_list+0xf1/0x7b0 mm/page_alloc.c:3646 release_pages+0xf7f/0xfe0 mm/swap.c:1063 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:314 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1e0/0x3f0 mm/mmu_gather.c:361 exit_mmap+0x421/0x940 mm/mmap.c:3348 __mmput+0x95/0x310 kernel/fork.c:1298 mmput+0x56/0x170 kernel/fork.c:1321 exit_mm kernel/exit.c:566 [inline] do_exit+0xb29/0x2b80 kernel/exit.c:862 do_group_exit+0x21a/0x2d0 kernel/exit.c:1025 get_signal+0x169d/0x1820 kernel/signal.c:2880 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x74/0xa0 kernel/entry/common.c:168 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffffc90003d4e700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90003d4e780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffc90003d4e800: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 ^ ffffc90003d4e880: 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc90003d4e900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== BUG: unable to handle page fault for address: ffffc90003d50000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 100000067 P4D 100000067 PUD 100154067 PMD 12730c067 PTE 0 Oops: 0000 [#2] PREEMPT SMP KASAN CPU: 0 PID: 5181 Comm: syz-executor.0 Tainted: G B D 6.1.75-syzkaller-00089-g1794308d463f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 RIP: 0010:jhash2 include/linux/jhash.h:128 [inline] RIP: 0010:hash+0x119/0xc20 kernel/bpf/bloom_filter.c:36 Code: c1 e8 03 0f b6 04 10 84 c0 0f 85 db 00 00 00 41 03 5e f8 48 8d 7e 08 48 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 f2 00 00 00 <45> 03 66 fc 45 29 e5 44 89 e0 c1 c0 04 44 31 e8 41 01 dc 89 c1 c1 RSP: 0018:ffffc90003d4e768 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000016f66abe RCX: ffffffff8191d597 RDX: 0000000000000000 RSI: ffffc90003d4fff8 RDI: ffffc90003d50000 RBP: ffffc90003d4e7a8 R08: 000000003ffff9c4 R09: fffffbfff0f260fd R10: 0000000000000000 R11: dffffc0000000001 R12: 000000000c79ec06 R13: 00000000c79111ed R14: ffffc90003d50004 R15: 000000003ffff9c4 FS: 00007f6cab0b46c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc90003d50000 CR3: 00000001486b8000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600 Call Trace: 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:600 [inline] bpf_prog_run include/linux/filter.h:607 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2275 [inline] bpf_trace_run1+0x106/0x240 kernel/trace/bpf_trace.c:2313 __bpf_trace_scsi_dispatch_cmd_start+0x1d/0x30 include/trace/events/scsi.h:156 __traceiter_scsi_dispatch_cmd_start+0x68/0xb0 include/trace/events/scsi.h:156 trace_scsi_dispatch_cmd_start include/trace/events/scsi.h:156 [inline] scsi_dispatch_cmd drivers/scsi/scsi_lib.c:1520 [inline] scsi_queue_rq+0x2ed1/0x3060 drivers/scsi/scsi_lib.c:1763 blk_mq_dispatch_rq_list+0xffb/0x23c0 block/blk-mq.c:2051 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:172 [inline] blk_mq_do_dispatch_sched+0x8be/0xf10 block/blk-mq-sched.c:186 __blk_mq_sched_dispatch_requests+0x39b/0x490 blk_mq_sched_dispatch_requests+0xf0/0x160 block/blk-mq-sched.c:338 __blk_mq_run_hw_queue+0xb8/0x150 block/blk-mq.c:2170 __blk_mq_delay_run_hw_queue+0x112/0x580 block/blk-mq.c:2246 blk_mq_run_hw_queue+0x265/0x4c0 block/blk-mq.c:2294 blk_mq_sched_insert_requests+0x2b1/0x420 block/blk-mq-sched.c:492 blk_mq_dispatch_plug_list block/blk-mq.c:2755 [inline] blk_mq_flush_plug_list+0x7a0/0x9d0 block/blk-mq.c:2804 __blk_flush_plug+0x442/0x4c0 block/blk-core.c:1152 blk_finish_plug+0x5d/0x80 block/blk-core.c:1176 ext4_writepages+0x3280/0x3fd0 fs/ext4/inode.c:2895 do_writepages+0x385/0x620 mm/page-writeback.c:2472 filemap_fdatawrite_wbc+0x153/0x1b0 mm/filemap.c:402 __filemap_fdatawrite_range mm/filemap.c:435 [inline] file_write_and_wait_range+0x1ca/0x2b0 mm/filemap.c:788 ext4_sync_file+0x1a2/0xa50 fs/ext4/fsync.c:151 vfs_fsync_range+0x17b/0x190 fs/sync.c:188 generic_write_sync include/linux/fs.h:2951 [inline] ext4_buffered_write_iter+0x587/0x640 fs/ext4/file.c:292 ext4_file_write_iter+0x194/0x1570 call_write_iter include/linux/fs.h:2258 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x902/0xeb0 fs/read_write.c:584 ksys_write+0x199/0x2c0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:646 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:0x7f6caa27dca9 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:00007f6cab0b40c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f6caa3abf80 RCX: 00007f6caa27dca9 RDX: 0000000000000012 RSI: 0000000020000980 RDI: 0000000000000004 RBP: 00007f6caa2c947e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6caa3abf80 R15: 00007fffa16c3048 Modules linked in: CR2: ffffc90003d50000 ---[ end trace 0000000000000000 ]--- RIP: 0010:jhash2 include/linux/jhash.h:126 [inline] RIP: 0010:hash+0xe3/0xc20 kernel/bpf/bloom_filter.c:36 Code: 83 c6 0c 41 83 c0 fd 45 89 ec 44 89 eb 48 89 f0 48 c1 e8 03 48 ba 00 00 00 00 00 fc ff df 0f b6 04 10 84 c0 0f 85 c1 00 00 00 <45> 03 6e f4 48 8d 7e 04 48 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f RSP: 0018:ffffc90002b7e6c8 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 00000000d92bf58f RCX: ffffffff8191d533 RDX: dffffc0000000000 RSI: ffffc90002b80000 RDI: ffffc90002b80000 RBP: ffffc90002b7e708 R08: 000000003ffff99a R09: fffffbfff0ede256 R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000b129b5fc R13: 00000000d904fde8 R14: ffffc90002b8000c R15: ffffc90002b80000 FS: 00007f6cab0b46c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc90003d50000 CR3: 00000001486b8000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: c1 e8 03 shr $0x3,%eax 3: 0f b6 04 10 movzbl (%rax,%rdx,1),%eax 7: 84 c0 test %al,%al 9: 0f 85 db 00 00 00 jne 0xea f: 41 03 5e f8 add -0x8(%r14),%ebx 13: 48 8d 7e 08 lea 0x8(%rsi),%rdi 17: 48 89 f8 mov %rdi,%rax 1a: 48 c1 e8 03 shr $0x3,%rax 1e: 0f b6 04 10 movzbl (%rax,%rdx,1),%eax 22: 84 c0 test %al,%al 24: 0f 85 f2 00 00 00 jne 0x11c * 2a: 45 03 66 fc add -0x4(%r14),%r12d <-- trapping instruction 2e: 45 29 e5 sub %r12d,%r13d 31: 44 89 e0 mov %r12d,%eax 34: c1 c0 04 rol $0x4,%eax 37: 44 31 e8 xor %r13d,%eax 3a: 41 01 dc add %ebx,%r12d 3d: 89 c1 mov %eax,%ecx 3f: c1 .byte 0xc1