syzbot


BUG: unable to handle kernel paging request in jhash

Status: upstream: reported C repro on 2024/04/07 05:59
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+6592955f6080eeb2160f@syzkaller.appspotmail.com
First crash: 48d, last: 26d
Cause bisection: introduced by (bisect log) :
commit 9330986c03006ab1d33d243b7cfe598a7a3c1baa
Author: Joanne Koong <joannekoong@fb.com>
Date: Wed Oct 27 23:45:00 2021 +0000

  bpf: Add bloom filter map implementation

Crash: KASAN: stack-out-of-bounds Read in jhash (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bpf?] BUG: unable to handle kernel paging request in jhash 0 (2) 2024/05/14 17:24
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in jhash wireless C done done 15 397d 416d 22/26 fixed on 2023/06/08 14:41
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/05/09 22:35 23m retest repro bpf OK log
2024/05/09 21:00 30m retest repro net OK log
2024/05/09 20:21 22m retest repro bpf-next error OK

Sample crash report:
==================================================================
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+0x1b4/0x740 include/linux/jhash.h:81
Read of size 4 at addr ffffc90000106aa0 by task kworker/u8:1/11

CPU: 0 PID: 11 Comm: kworker/u8:1 Not tainted 6.8.0-syzkaller-05243-g14bb1e8c8d4a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: writeback wb_workfn (flush-8:0)
Call Trace:
 <TASK>
 __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
 __get_unaligned_cpu32 include/linux/unaligned/packed_struct.h:19 [inline]
 jhash+0x1b4/0x740 include/linux/jhash.h:81
 hash+0x339/0x410 kernel/bpf/bloom_filter.c:31
 bloom_map_peek_elem+0xb2/0x1b0 kernel/bpf/bloom_filter.c:43
 bpf_prog_00798911c748094f+0x42/0x46
 bpf_dispatcher_nop_func include/linux/bpf.h:1233 [inline]
 __bpf_prog_run include/linux/filter.h:667 [inline]
 bpf_prog_run include/linux/filter.h:674 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2396 [inline]
 bpf_trace_run8+0x3d2/0x610 kernel/trace/bpf_trace.c:2443
 __bpf_trace_jbd2_handle_stats+0x47/0x60 include/trace/events/jbd2.h:210
 __traceiter_jbd2_handle_stats+0xa3/0x100 include/trace/events/jbd2.h:210
 trace_jbd2_handle_stats include/trace/events/jbd2.h:210 [inline]
 jbd2_journal_stop+0xd3d/0xdc0 fs/jbd2/transaction.c:1869
 __ext4_journal_stop+0xfd/0x1a0 fs/ext4/ext4_jbd2.c:134
 ext4_do_writepages+0x2d24/0x3ca0 fs/ext4/inode.c:2692
 ext4_writepages+0x204/0x3e0 fs/ext4/inode.c:2768
 do_writepages+0x3a4/0x670 mm/page-writeback.c:2553
 __writeback_single_inode+0x155/0xfd0 fs/fs-writeback.c:1650
 writeback_sb_inodes+0x8e4/0x1220 fs/fs-writeback.c:1941
 __writeback_inodes_wb+0x11b/0x260 fs/fs-writeback.c:2012
 wb_writeback+0x45b/0xc70 fs/fs-writeback.c:2119
 wb_check_old_data_flush fs/fs-writeback.c:2223 [inline]
 wb_do_writeback fs/fs-writeback.c:2276 [inline]
 wb_workfn+0xb7c/0x1070 fs/fs-writeback.c:2304
 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
 </TASK>

The buggy address belongs to stack of task kworker/u8:1/11
 and is located at offset 0 in frame:
 bpf_trace_run8+0x0/0x610

This frame has 2 objects:
 [32, 48) 'run_ctx.i'
 [64, 128) 'args'

The buggy address belongs to the virtual mapping at
 [ffffc90000100000, ffffc90000109000) created by:
 copy_process+0x5d1/0x3df0 kernel/fork.c:2219

The buggy address belongs to the physical page:
page:ffffea00005ba000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x16e80
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 2, tgid 2 (kthreadd), ts 2693120013, free_ts 0
 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
 kernel_thread+0x1bc/0x240 kernel/fork.c:2858
 create_kthread kernel/kthread.c:411 [inline]
 kthreadd+0x60d/0x810 kernel/kthread.c:764
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243
page_owner free stack trace missing

Memory state around the buggy address:
 ffffc90000106980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc90000106a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90000106a80: 00 00 00 00 f1 f1 f1 f1 00 00 f2 f2 00 00 00 00
                               ^
 ffffc90000106b00: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
 ffffc90000106b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/04 23:42 bpf-next 14bb1e8c8d4a 0ee3535e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/03 07:17 net f99c5f563c17 7925100d .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/03 06:44 bpf 443574b03387 7925100d .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/07 23:33 net f99c5f563c17 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce BUG: unable to handle kernel paging request in jhash
2024/04/03 05:53 bpf 443574b03387 7925100d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce BUG: unable to handle kernel paging request in jhash
2024/04/25 20:20 bpf 443574b03387 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/25 13:58 bpf 443574b03387 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/25 02:21 bpf 443574b03387 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/24 06:15 bpf 443574b03387 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/24 01:28 bpf 443574b03387 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/22 15:09 bpf 443574b03387 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/15 16:22 bpf 443574b03387 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/06 11:07 net f99c5f563c17 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: stack-out-of-bounds Read in jhash
2024/04/06 00:19 bpf-next 14bb1e8c8d4a 18ea8213 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce KASAN: stack-out-of-bounds Read in jhash
* Struck through repros no longer work on HEAD.