syzbot


general protection fault in __btf_resolve_helper_id

Status: fixed on 2020/09/16 22:51
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+ee09bda7017345f1fbe6@syzkaller.appspotmail.com
Fix commit: 5b801dfb7feb bpf: Fix NULL pointer dereference in __btf_resolve_helper_id()
First crash: 1384d, last: 1375d
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 5.7 00/79] 5.7.15-rc1 review 83 (83) 2020/08/11 14:23
[Linux-kernel-mentees] [PATCH] bpf: Fix NULL pointer dereference in __btf_resolve_helper_id() 7 (7) 2020/07/15 21:07
general protection fault in __btf_resolve_helper_id 0 (1) 2020/07/05 18:41

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
CPU: 0 PID: 6799 Comm: syz-executor682 Not tainted 5.8.0-rc3-next-20200703-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__btf_resolve_helper_id+0x149/0xb10 kernel/bpf/btf.c:4102
Code: 80 3c 03 00 0f 85 dd 08 00 00 48 8b 05 70 46 0a 0b 48 8d 78 48 48 89 04 24 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 50 09 00 00 48 8b 04 24 31 ff
RSP: 0018:ffffc90001637378 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 1ffffffff1926068 RCX: ffffffff816aa4b6
RDX: 0000000000000009 RSI: ffffffff8188bcb1 RDI: 0000000000000048
RBP: ffffffff818ba3d0 R08: ffffc900016373e4 R09: ffffc90001637670
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffff888096648260 R15: ffff888096648000
FS:  0000000000cc2880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000282 CR3: 00000000a6dbe000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 btf_resolve_helper_id+0x10c/0x1c0 kernel/bpf/btf.c:4164
 check_helper_call+0x1641/0x5650 kernel/bpf/verifier.c:4721
 do_check kernel/bpf/verifier.c:8938 [inline]
 do_check_common+0x7253/0xc2d0 kernel/bpf/verifier.c:10574
 do_check_main kernel/bpf/verifier.c:10640 [inline]
 bpf_check+0x857f/0xce51 kernel/bpf/verifier.c:11093
 bpf_prog_load+0xdaf/0x1b50 kernel/bpf/syscall.c:2194
 __do_sys_bpf+0x1edf/0x4b10 kernel/bpf/syscall.c:4112
 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:367
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x440379
Code: Bad RIP value.
RSP: 002b:00007ffee37aa6d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440379
RDX: 0000000000000048 RSI: 0000000020000080 RDI: 0000000000000005
RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000401c00
R13: 0000000000401c90 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace d5a7c4fec6f343c9 ]---
RIP: 0010:__btf_resolve_helper_id+0x149/0xb10 kernel/bpf/btf.c:4102
Code: 80 3c 03 00 0f 85 dd 08 00 00 48 8b 05 70 46 0a 0b 48 8d 78 48 48 89 04 24 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 50 09 00 00 48 8b 04 24 31 ff
RSP: 0018:ffffc90001637378 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 1ffffffff1926068 RCX: ffffffff816aa4b6
RDX: 0000000000000009 RSI: ffffffff8188bcb1 RDI: 0000000000000048
RBP: ffffffff818ba3d0 R08: ffffc900016373e4 R09: ffffc90001637670
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffff888096648260 R15: ffff888096648000
FS:  0000000000cc2880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000282 CR3: 00000000a6dbe000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/07/05 08:35 linux-next 9e50b94b3eb0 51095195 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/07/14 07:26 net-next-old 2be53e0e4690 ce4c95b3 .config console log report ci-upstream-net-kasan-gce
2020/07/13 13:27 net-next-old 94339443686b f90ec899 .config console log report ci-upstream-net-kasan-gce
2020/07/13 05:51 bpf-next eef8a42d6ce0 9ebcc5b1 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/13 02:26 bpf-next eef8a42d6ce0 9ebcc5b1 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/11 15:12 bpf-next eef8a42d6ce0 18d18b59 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/11 15:11 net-next-old a594920f8747 18d18b59 .config console log report ci-upstream-net-kasan-gce
2020/07/10 13:04 bpf-next 2977282b63c3 edf162e8 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/10 12:14 bpf-next 2977282b63c3 edf162e8 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/10 10:55 bpf-next 2977282b63c3 edf162e8 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/08 23:50 net-next-old e80a07b244dd bc238812 .config console log report ci-upstream-net-kasan-gce
2020/07/08 23:05 bpf-next 5cfd607b49db bc238812 .config console log report ci-upstream-bpf-next-kasan-gce
2020/07/14 07:34 linux-next be978f8feb1d ce4c95b3 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/07/14 07:34 linux-next be978f8feb1d ce4c95b3 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/07/11 15:19 linux-next d31958b30ea3 18d18b59 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/07/07 07:54 linux-next 9e50b94b3eb0 51095195 .config console log report ci-upstream-linux-next-kasan-gce-root
2020/07/05 08:20 linux-next 9e50b94b3eb0 51095195 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.