syzbot


BUG: unable to handle kernel paging request in htab_free_elems

Status: fixed on 2021/03/10 01:48
Subsystems: bpf
[Documentation on labels]
Fix commit: e1868b9e36d0 bpf: Avoid overflows involving hash elem_size
First crash: 1198d, last: 1198d

Sample crash report:
BUG: unable to handle page fault for address: ffffc900d22c94fd
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 10000067 P4D 10000067 PUD 1e7870067 PMD 1e797d067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5927 Comm: syz-executor.5 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_free_elems+0x1b1/0x290 kernel/bpf/hashtab.c:242
Code: c0 74 04 3c 03 7e 7e 89 e8 0f af 83 d0 02 00 00 49 8d 44 06 30 48 01 d0 48 89 c2 48 c1 ea 03 42 80 3c 22 00 0f 85 a1 00 00 00 <48> 8b 38 83 c5 01 e8 c4 6a 1a 00 31 d2 be f3 00 00 00 48 c7 c7 e0
RSP: 0018:ffffc900017c7c48 EFLAGS: 00010246
RAX: ffffc900d22c94fd RBX: ffff888012649800 RCX: ffffc9001375c000
RDX: 1ffff9201a45929f RSI: ffffffff81838257 RDI: 0000000000000004
RBP: 0000000000000582 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000800003 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff888012649988 R14: ffffc900a612b000 R15: 0000000000000007
FS:  00007ff454e93700(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc900d22c94fd CR3: 000000001be09000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 prealloc_init kernel/bpf/hashtab.c:330 [inline]
 htab_map_alloc+0xe2c/0x1230 kernel/bpf/hashtab.c:507
 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:0x45de79
Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ff454e92c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045de79
RDX: 0000000000000040 RSI: 0000000020000180 RDI: 0000000000000000
RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c
R13: 00007ffe605a7d1f R14: 00007ff454e939c0 R15: 000000000118bf2c
Modules linked in:
CR2: ffffc900d22c94fd
---[ end trace d45f0b284cafff45 ]---
RIP: 0010:htab_free_elems+0x1b1/0x290 kernel/bpf/hashtab.c:242
Code: c0 74 04 3c 03 7e 7e 89 e8 0f af 83 d0 02 00 00 49 8d 44 06 30 48 01 d0 48 89 c2 48 c1 ea 03 42 80 3c 22 00 0f 85 a1 00 00 00 <48> 8b 38 83 c5 01 e8 c4 6a 1a 00 31 d2 be f3 00 00 00 48 c7 c7 e0
RSP: 0018:ffffc900017c7c48 EFLAGS: 00010246

RAX: ffffc900d22c94fd RBX: ffff888012649800 RCX: ffffc9001375c000
RDX: 1ffff9201a45929f RSI: ffffffff81838257 RDI: 0000000000000004
RBP: 0000000000000582 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000800003 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff888012649988 R14: ffffc900a612b000 R15: 0000000000000007
FS:  00007ff454e93700(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc900d22c94fd CR3: 000000001be09000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/06 07:30 bpf-next 34da87213d3d f12ba0c5 .config console log report info ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.