syzbot


general protection fault in btf_type_id_size

Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+8bab8ed346746e7540e8@syzkaller.appspotmail.com
Fix commit: 350a5c4dd245 bpf: Dont allow vmlinux BTF to be used in map_create and prog_load.
First crash: 705d, last: 704d

Cause bisection: introduced by (bisect log) [merge commit]:
commit 19c176eb079834c5cf8574ce18c1d934ec486dd8
Author: Jakub Kicinski <kuba@kernel.org>
Date: Mon Oct 26 23:45:53 2020 +0000

  Merge branch 'mlxsw-various-fixes'

Crash: SYZFAIL: wrong response packet (log)
Repro: C syz .config

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 0 PID: 8380 Comm: syz-executor429 Not tainted 5.11.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:btf_resolved_type_id kernel/bpf/btf.c:1770 [inline]
RIP: 0010:btf_type_id_size+0x40e/0x960 kernel/bpf/btf.c:1811
Code: 48 c1 e9 03 80 3c 11 00 0f 85 17 05 00 00 49 8b 47 10 44 29 f3 48 8d 1c 98 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ec
RSP: 0018:ffffc90000fffd18 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: 0000000000000014 RCX: 1ffff11003a70482
RDX: 0000000000000002 RSI: ffffffff818b12f3 RDI: ffff88801d382410
RBP: ffff88801d382400 R08: 0000000000000005 R09: ffffffff818b114a
R10: ffffffff818b128e R11: 000000000000000a R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff88801d382400
FS:  0000000000ad5300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004ae0f0 CR3: 0000000024fca000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 map_check_btf kernel/bpf/syscall.c:757 [inline]
 map_create kernel/bpf/syscall.c:860 [inline]
 __do_sys_bpf+0x4000/0x4f00 kernel/bpf/syscall.c:4370
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43ff09
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc5f435ef8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 000000000001053e RCX: 000000000043ff09
RDX: 0000000000000040 RSI: 0000000020000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 00007ffc5f436098 R09: 00007ffc5f436098
R10: 00007ffc5f436098 R11: 0000000000000246 R12: 00007ffc5f435f0c
R13: 431bde82d7b634db R14: 00000000004ae018 R15: 0000000000400488
Modules linked in:
---[ end trace a4216c6ef2fa85f5 ]---
RIP: 0010:btf_resolved_type_id kernel/bpf/btf.c:1770 [inline]
RIP: 0010:btf_type_id_size+0x40e/0x960 kernel/bpf/btf.c:1811
Code: 48 c1 e9 03 80 3c 11 00 0f 85 17 05 00 00 49 8b 47 10 44 29 f3 48 8d 1c 98 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ec
RSP: 0018:ffffc90000fffd18 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: 0000000000000014 RCX: 1ffff11003a70482
RDX: 0000000000000002 RSI: ffffffff818b12f3 RDI: ffff88801d382410
RBP: ffff88801d382400 R08: 0000000000000005 R09: ffffffff818b114a
R10: ffffffff818b128e R11: 000000000000000a R12: 0000000000000000
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff88801d382400
FS:  0000000000ad5300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004ae0f0 CR3: 0000000024fca000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (6):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-bpf-kasan-gce 2021/03/03 22:09 bpf 6185266c5a85 06ed56cd .config console log report syz C general protection fault in btf_type_id_size
ci-upstream-net-this-kasan-gce 2021/03/03 22:04 net 6881b07fdd24 06ed56cd .config console log report syz C general protection fault in btf_type_id_size
ci-upstream-net-kasan-gce 2021/03/03 22:06 net-next d310ec03a34e 06ed56cd .config console log report syz C general protection fault in btf_type_id_size
ci-upstream-bpf-next-kasan-gce 2021/03/03 21:41 bpf-next 303dcc25b5c7 06ed56cd .config console log report syz C general protection fault in btf_type_id_size
ci-upstream-bpf-next-kasan-gce 2021/03/04 15:03 bpf-next 303dcc25b5c7 d7e4e604 .config console log report info general protection fault in btf_type_id_size
ci-upstream-bpf-next-kasan-gce 2021/03/03 21:10 bpf-next 303dcc25b5c7 06ed56cd .config console log report info general protection fault in btf_type_id_size
* Struck through repros no longer work on HEAD.