syzbot


BUG: unable to handle kernel paging request in htab_map_alloc (2)

Status: fixed on 2021/03/10 01:49
Subsystems: bpf
[Documentation on labels]
Fix commit: e1868b9e36d0 bpf: Avoid overflows involving hash elem_size
First crash: 1270d, last: 1262d
Cause bisection: introduced by (bisect log) [merge commit]:
commit 830382e4ccb5e5d9164fcd28854238ef5f5a1751
Author: Andrii Nakryiko <andrii@kernel.org>
Date: Fri Nov 27 03:33:36 2020 +0000

  Merge branch 'bpf: remove bpf_load loader completely'

Crash: BUG: sleeping function called from invalid context in sta_info_move_state (log)
Repro: C syz .config
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: unable to handle kernel paging request in htab_map_alloc bpf C 1 2137d 2137d 0/26 closed as invalid on 2018/09/05 12:51

Sample crash report:
BUG: unable to handle page fault for address: fffff5200994ae06
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 23fff2067 P4D 23fff2067 PUD 101a4067 PMD 38478067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8481 Comm: syz-executor028 Not tainted 5.10.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:htab_elem_set_ptr kernel/bpf/hashtab.c:212 [inline]
RIP: 0010:prealloc_init kernel/bpf/hashtab.c:299 [inline]
RIP: 0010:htab_map_alloc+0xd9b/0x1230 kernel/bpf/hashtab.c:507
Code: 42 0f b6 14 22 84 d2 74 09 80 fa 03 0f 8e 82 03 00 00 89 da 0f af 95 d0 02 00 00 48 8d 54 16 30 48 01 ca 48 89 d1 48 c1 e9 03 <42> 80 3c 21 00 0f 85 31 03 00 00 4c 89 32 be 2d 01 00 00 31 d2 83
RSP: 0018:ffffc90000e8fcb0 EFLAGS: 00010a06
RAX: ffffed1003494003 RBX: 0000000000000400 RCX: 1ffff9200994ae06
RDX: ffffc9004ca57030 RSI: ffffc9000c949000 RDI: ffff888021e4e338
RBP: ffff88801a4a0000 R08: 0000000000000000 R09: ffffffff8cecff4f
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffed1003494004 R14: 0000607f45e35bf8 R15: 0000000000002400
FS:  0000000001b89880(0000) GS:ffff8880b9e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffff5200994ae06 CR3: 000000001b3a6000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 find_and_alloc_map kernel/bpf/syscall.c:123 [inline]
 map_create kernel/bpf/syscall.c:829 [inline]
 __do_sys_bpf+0xa81/0x5170 kernel/bpf/syscall.c:4374
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4412f9
Code: e8 fc ab 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 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 0f 83 1b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffff64779f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412f9
RDX: 0000000000000040 RSI: 0000000020000540 RDI: 0400000000000000
RBP: 00000000006cb018 R08: 0000000000000004 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004020a0
R13: 0000000000402130 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
CR2: fffff5200994ae06
---[ end trace a6278fbbb0d27eab ]---
RIP: 0010:htab_elem_set_ptr kernel/bpf/hashtab.c:212 [inline]
RIP: 0010:prealloc_init kernel/bpf/hashtab.c:299 [inline]
RIP: 0010:htab_map_alloc+0xd9b/0x1230 kernel/bpf/hashtab.c:507
Code: 42 0f b6 14 22 84 d2 74 09 80 fa 03 0f 8e 82 03 00 00 89 da 0f af 95 d0 02 00 00 48 8d 54 16 30 48 01 ca 48 89 d1 48 c1 e9 03 <42> 80 3c 21 00 0f 85 31 03 00 00 4c 89 32 be 2d 01 00 00 31 d2 83
RSP: 0018:ffffc90000e8fcb0 EFLAGS: 00010a06
RAX: ffffed1003494003 RBX: 0000000000000400 RCX: 1ffff9200994ae06
RDX: ffffc9004ca57030 RSI: ffffc9000c949000 RDI: ffff888021e4e338
RBP: ffff88801a4a0000 R08: 0000000000000000 R09: ffffffff8cecff4f
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffed1003494004 R14: 0000607f45e35bf8 R15: 0000000000002400
FS:  0000000001b89880(0000) GS:ffff8880b9e00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: fffff5200994ae06 CR3: 000000001b3a6000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/06 04:47 net-next-old bcd684aace34 50503117 .config console log report syz C ci-upstream-net-kasan-gce
2020/12/06 04:21 bpf-next 34da87213d3d 50503117 .config console log report syz C ci-upstream-bpf-next-kasan-gce
2020/12/13 08:37 net-next-old 00f7763a26cb bca53db9 .config console log report info ci-upstream-net-kasan-gce
2020/12/10 18:23 net-next-old a7105e3472bf f900b48c .config console log report info ci-upstream-net-kasan-gce
2020/12/07 11:48 bpf-next 34da87213d3d 1190297f .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/06 03:39 bpf-next 34da87213d3d 50503117 .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/05 23:25 bpf-next 34da87213d3d 50503117 .config console log report info ci-upstream-bpf-next-kasan-gce
2020/12/04 20:42 bpf-next eceae70bdeae 20366b87 .config console log report info ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.