syzbot


WARNING in bpf_mprog_pos_after

Status: fixed on 2023/12/21 03:45
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+2558ca3567a77b7af4e3@syzkaller.appspotmail.com
Fix commit: f9b0e1088bbf bpf, mprog: Fix maximum program check on mprog attachment
First crash: 214d, last: 201d
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_after 1 (2) 2023/09/18 12:41

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25977 at include/linux/bpf_mprog.h:198 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
WARNING: CPU: 0 PID: 25977 at include/linux/bpf_mprog.h:198 bpf_mprog_pos_after+0x194/0x2b0 kernel/bpf/mprog.c:216
Modules linked in:
CPU: 0 PID: 25977 Comm: syz-executor.0 Not tainted 6.6.0-rc3-syzkaller #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_after+0x194/0x2b0 kernel/bpf/mprog.c:216
Code: e8 03 42 80 3c 38 00 0f 85 f2 00 00 00 4d 3b 65 00 0f 85 26 ff ff ff e8 fa 5a e3 ff 8d 43 01 89 44 24 14 eb 48 e8 ec 5a e3 ff <0f> 0b e9 36 ff ff ff e8 e0 5a e3 ff 4c 89 f2 48 b8 00 00 00 00 00
RSP: 0018:ffffc900113d7ac8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888021b01dc0 RSI: ffffffff81a46bd4 RDI: 0000000000000005
RBP: 0000000000000040 R08: 0000000000000005 R09: 000000000000003f
R10: 0000000000000040 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88807d3bf418 R14: ffffc900113d7b98 R15: dffffc0000000000
FS:  00007f96275086c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f96253ddd58 CR3: 000000003ff0a000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 bpf_mprog_attach+0x433/0xfe0 kernel/bpf/mprog.c:266
 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:0x7f962687cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f96275080c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f962699bf80 RCX: 00007f962687cae9
RDX: 0000000000000020 RSI: 0000000020000140 RDI: 0000000000000008
RBP: 00007f96268c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f962699bf80 R15: 00007ffd87829f68
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/26 14:44 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root WARNING in bpf_mprog_pos_after
2023/09/18 10:26 net-next d692873cbe86 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_after
2023/09/14 05:11 net-next ca5ab9638e92 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce WARNING in bpf_mprog_pos_after
* Struck through repros no longer work on HEAD.