syzbot


WARNING in bpf_mprog_pos_before

Status: fixed on 2023/12/21 03:45
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+b97d20ed568ce0951a06@syzkaller.appspotmail.com
Fix commit: f9b0e1088bbf bpf, mprog: Fix maximum program check on mprog attachment
First crash: 242d, last: 234d
Cause bisection: introduced by (bisect log) :
commit e420bed025071a623d2720a92bc2245c84757ecb
Author: Daniel Borkmann <daniel@iogearbox.net>
Date: Wed Jul 19 14:08:52 2023 +0000

  bpf: Add fd-based tcx multi-prog infra with link support

Crash: WARNING in bpf_mprog_pos_before (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH bpf 1/2] bpf, mprog: Fix maximum program check on mprog attachment 2 (2) 2023/09/29 23:00
[syzbot] [bpf?] WARNING in bpf_mprog_pos_before 0 (2) 2023/09/26 21:38
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/09/29 19:25 23m daniel@iogearbox.net https://github.com/cilium/linux.git pr/mprog-fix OK log

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 5104 at include/linux/bpf_mprog.h:198 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
WARNING: CPU: 1 PID: 5104 at include/linux/bpf_mprog.h:198 bpf_mprog_pos_before+0x18c/0x280 kernel/bpf/mprog.c:200
Modules linked in:
CPU: 1 PID: 5104 Comm: syz-executor209 Not tainted 6.6.0-rc2-syzkaller-00245-ga59addacf899 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
RIP: 0010:bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
RIP: 0010:bpf_mprog_pos_before+0x18c/0x280 kernel/bpf/mprog.c:200
Code: 89 e8 48 c1 e8 03 42 80 3c 38 00 0f 85 d8 00 00 00 4d 3b 65 00 0f 85 26 ff ff ff e8 1e 5f e3 ff 83 eb 01 eb 38 e8 14 5f e3 ff <0f> 0b e9 3a ff ff ff e8 08 5f e3 ff 4c 89 f2 48 b8 00 00 00 00 00
RSP: 0018:ffffc90003cefad0 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff88801f46d940 RSI: ffffffff81a465dc RDI: 0000000000000005
RBP: 0000000000000040 R08: 0000000000000005 R09: 000000000000003f
R10: 0000000000000040 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88801c013418 R14: ffffc90003cefb98 R15: dffffc0000000000
FS:  0000555556695380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fabc01fb0d0 CR3: 0000000072aab000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bpf_mprog_attach+0x720/0xfe0 kernel/bpf/mprog.c:258
 tcx_prog_attach+0x2bd/0xbd0 kernel/bpf/tcx.c:39
 bpf_prog_attach kernel/bpf/syscall.c:3848 [inline]
 __sys_bpf+0x3f4a/0x4d30 kernel/bpf/syscall.c:5344
 __do_sys_bpf kernel/bpf/syscall.c:5439 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5437 [inline]
 __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5437
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fabc0183cb9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc7b50c788 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fabc0183cb9
RDX: 0000000000000020 RSI: 0000000020000080 RDI: 0000000000000008
RBP: 0000000000000000 R08: 0000000000000006 R09: 0000000000000006
R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (26):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/26 21:40 net a59addacf899 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 19:44 bpf 81335f90e8a8 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 19:36 net a59addacf899 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 17:40 bpf 81335f90e8a8 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 17:39 net a59addacf899 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 15:43 net a59addacf899 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 15:40 bpf 81335f90e8a8 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 13:36 bpf 81335f90e8a8 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 11:43 net a59addacf899 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 11:28 bpf 81335f90e8a8 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 22:06 bpf-next 0e73ef1d8c09 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 20:06 bpf-next 0e73ef1d8c09 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 19:33 net-next 5a1b322cb0b7 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 18:05 bpf-next 0e73ef1d8c09 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 17:32 net-next 5a1b322cb0b7 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 15:28 net-next 5a1b322cb0b7 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 13:31 net-next 5a1b322cb0b7 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 11:37 bpf-next e0fa6523e02a 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 11:23 net-next 5a1b322cb0b7 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_before
2023/10/04 09:34 net dfc7f7a988da 65faba36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/10/02 18:43 net 6a70e5cbedaf 50b20e75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 10:10 bpf 81335f90e8a8 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 10:05 net a59addacf899 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce WARNING in bpf_mprog_pos_before
2023/10/03 05:58 bpf-next 2147c8d07e1a 50b20e75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 10:17 bpf-next e0fa6523e02a 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_mprog_pos_before
2023/09/26 10:09 net-next 5a1b322cb0b7 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_before
* Struck through repros no longer work on HEAD.