==================================================================
BUG: KASAN: stack-out-of-bounds in __get_unaligned_cpu32 include/linux/unaligned/packed_struct.h:19 [inline]
BUG: KASAN: stack-out-of-bounds in jhash include/linux/jhash.h:82 [inline]
BUG: KASAN: stack-out-of-bounds in hash+0x465/0xc20 kernel/bpf/bloom_filter.c:39
Read of size 4 at addr ffffc900093bfa00 by task syz.0.490/2368
CPU: 1 PID: 2368 Comm: syz.0.490 Not tainted 6.1.84-syzkaller-00135-gce6f9cab9edc #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_load_n_noabort+0xf/0x20 mm/kasan/report_generic.c:361
__get_unaligned_cpu32 include/linux/unaligned/packed_struct.h:19 [inline]
jhash include/linux/jhash.h:82 [inline]
hash+0x465/0xc20 kernel/bpf/bloom_filter.c:39
bloom_map_push_elem+0xce/0x180 kernel/bpf/bloom_filter.c:69
bpf_prog_bfd19630a338eafb+0x3f/0x43
bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline]
__bpf_prog_run include/linux/filter.h:596 [inline]
bpf_prog_run include/linux/filter.h:610 [inline]
bpf_test_run+0x6b0/0xa40 net/bpf/test_run.c:402
bpf_prog_test_run_skb+0xaf1/0x13a0 net/bpf/test_run.c:1180
bpf_prog_test_run+0x3b0/0x630 kernel/bpf/syscall.c:3650
__sys_bpf+0x59f/0x7f0 kernel/bpf/syscall.c:5005
__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:0x7f8fa8575bd9
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:00007f8fa93ad048 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f8fa8703f60 RCX: 00007f8fa8575bd9
RDX: 0000000000000050 RSI: 0000000020000000 RDI: 000000000000000a
RBP: 00007f8fa85e4aa1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f8fa8703f60 R15: 00007fffa30939f8
The buggy address belongs to stack of task syz.0.490/2368
and is located at offset 0 in frame:
bpf_test_run+0x0/0xa40
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
[ffffc900093b8000, ffffc900093c1000) created by:
copy_process+0x5c3/0x3530 kernel/fork.c:2199
The buggy address belongs to the physical page:
page:ffffea00042e0f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10b83c
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 2298, tgid 2298 (syz.2.472), ts 113214641831, free_ts 113179458061
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_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:174
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:303
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87
Memory state around the buggy address:
ffffc900093bf900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc900093bf980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc900093bfa00: f1 f1 f1 f1 00 00 00 f2 f2 f2 f2 f2 00 00 f2 f2
^
ffffc900093bfa80: 00 00 00 f2 f2 f2 f2 f2 04 f3 f3 f3 00 00 00 00
ffffc900093bfb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
BUG: unable to handle page fault for address: ffffc900093c0000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 100000067 P4D 100000067 PUD 100154067 PMD 1299ef067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 2368 Comm: syz.0.490 Tainted: G B 6.1.84-syzkaller-00135-gce6f9cab9edc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
RIP: 0010:jhash include/linux/jhash.h:82 [inline]
RIP: 0010:hash+0x30d/0xc20 kernel/bpf/bloom_filter.c:39
Code: 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 56 01 00 00 4a 8d 7c 36 0b 48 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 6e 01 00 00 <46> 03 64 36 08 45 29 e7 44 89 e0 c1 c0 04 44 31 f8 41 01 dc 89 c1
RSP: 0000:ffffc900093bf850 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 00000000eb88b7c5 RCX: ffffffff8191f105
RDX: 0000000000000000 RSI: ffffc900093bf908 RDI: ffffc900093c0003
RBP: ffffc900093bf890 R08: 00000000fffff8fd R09: fffffbfff0f264fd
R10: 0000000000000000 R11: dffffc0000000001 R12: 000000009ad0d3f4
R13: 00000000fffff8fd R14: 00000000000006f0 R15: 00000000de8bc89f
FS: 00007f8fa93ad6c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc900093c0000 CR3: 00000001165ce000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
bloom_map_push_elem+0xce/0x180 kernel/bpf/bloom_filter.c:69
bpf_prog_bfd19630a338eafb+0x3f/0x43
bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline]
__bpf_prog_run include/linux/filter.h:596 [inline]
bpf_prog_run include/linux/filter.h:610 [inline]
bpf_test_run+0x6b0/0xa40 net/bpf/test_run.c:402
bpf_prog_test_run_skb+0xaf1/0x13a0 net/bpf/test_run.c:1180
bpf_prog_test_run+0x3b0/0x630 kernel/bpf/syscall.c:3650
__sys_bpf+0x59f/0x7f0 kernel/bpf/syscall.c:5005
__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:0x7f8fa8575bd9
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:00007f8fa93ad048 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f8fa8703f60 RCX: 00007f8fa8575bd9
RDX: 0000000000000050 RSI: 0000000020000000 RDI: 000000000000000a
RBP: 00007f8fa85e4aa1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f8fa8703f60 R15: 00007fffa30939f8
Modules linked in:
CR2: ffffc900093c0000
---[ end trace 0000000000000000 ]---
RIP: 0010:jhash include/linux/jhash.h:82 [inline]
RIP: 0010:hash+0x30d/0xc20 kernel/bpf/bloom_filter.c:39
Code: 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 56 01 00 00 4a 8d 7c 36 0b 48 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 6e 01 00 00 <46> 03 64 36 08 45 29 e7 44 89 e0 c1 c0 04 44 31 f8 41 01 dc 89 c1
RSP: 0000:ffffc900093bf850 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 00000000eb88b7c5 RCX: ffffffff8191f105
RDX: 0000000000000000 RSI: ffffc900093bf908 RDI: ffffc900093c0003
RBP: ffffc900093bf890 R08: 00000000fffff8fd R09: fffffbfff0f264fd
R10: 0000000000000000 R11: dffffc0000000001 R12: 000000009ad0d3f4
R13: 00000000fffff8fd R14: 00000000000006f0 R15: 00000000de8bc89f
FS: 00007f8fa93ad6c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc900093c0000 CR3: 00000001165ce000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 89 f8 mov %edi,%eax
2: 48 c1 e8 03 shr $0x3,%rax
6: 0f b6 04 10 movzbl (%rax,%rdx,1),%eax
a: 84 c0 test %al,%al
c: 0f 85 56 01 00 00 jne 0x168
12: 4a 8d 7c 36 0b lea 0xb(%rsi,%r14,1),%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 6e 01 00 00 jne 0x198
* 2a: 46 03 64 36 08 add 0x8(%rsi,%r14,1),%r12d <-- trapping instruction
2f: 45 29 e7 sub %r12d,%r15d
32: 44 89 e0 mov %r12d,%eax
35: c1 c0 04 rol $0x4,%eax
38: 44 31 f8 xor %r15d,%eax
3b: 41 01 dc add %ebx,%r12d
3e: 89 c1 mov %eax,%ecx