syzbot


WARNING in bpf_test_finish

Status: internal: reported C repro on 2022/02/27 23:23
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: 530e214c5b5a bpf, test_run: Fix overflow in XDP frags bpf_test_finish
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 121d, last: 121d

Cause bisection: introduced by (bisect log) :
commit 7855e0db150ad8f494d66913c26deadc52f12e07
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Fri Jan 21 10:09:59 2022 +0000

  bpf: test_run: add xdp_shared_info pointer in bpf_test_finish signature

Crash: WARNING in bpf_test_finish (log)
Repro: C syz .config

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3599 at include/linux/thread_info.h:230 check_copy_size include/linux/thread_info.h:230 [inline]
WARNING: CPU: 0 PID: 3599 at include/linux/thread_info.h:230 copy_to_user include/linux/uaccess.h:199 [inline]
WARNING: CPU: 0 PID: 3599 at include/linux/thread_info.h:230 bpf_test_finish.isra.0+0x4b2/0x680 net/bpf/test_run.c:171
Modules linked in:
CPU: 0 PID: 3599 Comm: syz-executor304 Not tainted 5.17.0-rc5-syzkaller-01555-gb42a738e409b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:check_copy_size include/linux/thread_info.h:230 [inline]
RIP: 0010:copy_to_user include/linux/uaccess.h:199 [inline]
RIP: 0010:bpf_test_finish.isra.0+0x4b2/0x680 net/bpf/test_run.c:171
Code: ff ff ff 7f 4c 63 e3 49 83 c7 10 4c 03 64 24 08 48 01 c5 e8 90 d8 09 fa 49 81 fd ff ff ff 7f 0f 86 85 fe ff ff e8 8e d4 09 fa <0f> 0b e8 87 d4 09 fa 48 8d 7c 24 68 e8 1d f9 ff ff 44 8b 44 24 68
RSP: 0018:ffffc900037ffa18 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000fffffea7 RCX: 0000000000000000
RDX: ffff88807d1e1d00 RSI: ffffffff876f1762 RDI: 0000000000000003
RBP: ffff88801d48e100 R08: 000000007fffffff R09: 0000000000001000
R10: ffffffff876f1414 R11: 0000000000000000 R12: fffffffffffffea7
R13: ffff88801d48e000 R14: 0000000000000000 R15: 00000000000000e7
FS:  0000555555be7300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000d000 CR3: 0000000019bb9000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bpf_prog_test_run_xdp+0x92c/0x1200 net/bpf/test_run.c:1008
 bpf_prog_test_run kernel/bpf/syscall.c:3362 [inline]
 __sys_bpf+0x1858/0x59a0 kernel/bpf/syscall.c:4664
 __do_sys_bpf kernel/bpf/syscall.c:4750 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4748 [inline]
 __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4748
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f189fc8f209
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffccc4dddb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f189fc8f209
RDX: 0000000000000048 RSI: 0000000020000340 RDI: 000000000000000a
RBP: 00007f189fc531f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f189fc53280
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-kasan-gce 2022/02/28 00:12 net-next b42a738e409b 45a13a73 .config log report syz C WARNING in bpf_test_finish
ci-upstream-bpf-next-kasan-gce 2022/02/27 23:48 bpf-next e5313968c41b 45a13a73 .config log report syz C WARNING in bpf_test_finish
ci-upstream-bpf-next-kasan-gce 2022/02/27 23:22 bpf-next e5313968c41b 45a13a73 .config log report info WARNING in bpf_test_finish