syzbot


WARNING in bpf_mprog_attach

Status: fixed on 2023/12/21 03:45
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+baa44e3dbbe48e05c1ad@syzkaller.appspotmail.com
Fix commit: f9b0e1088bbf bpf, mprog: Fix maximum program check on mprog attachment
First crash: 235d, last: 227d
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_attach 0 (1) 2023/09/26 20:47
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/09/29 19:25 36m daniel@iogearbox.net https://github.com/cilium/linux.git pr/mprog-fix OK log

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_pos_before kernel/bpf/mprog.c:200 [inline]
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_attach+0x584/0xb88 kernel/bpf/mprog.c:258
Modules linked in:
CPU: 1 PID: 6072 Comm: syz-executor183 Not tainted 6.6.0-rc3-syzkaller-gbf6547d8715b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
pc : bpf_mprog_pos_before kernel/bpf/mprog.c:200 [inline]
pc : bpf_mprog_attach+0x584/0xb88 kernel/bpf/mprog.c:258
lr : bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
lr : bpf_mprog_pos_before kernel/bpf/mprog.c:200 [inline]
lr : bpf_mprog_attach+0x584/0xb88 kernel/bpf/mprog.c:258
sp : ffff800096767920
x29: ffff800096767a00 x28: 0000000000000040 x27: 1fffe0001983e841
x26: 0000000000000000 x25: ffff0000cc1f4208 x24: 00000000ffffffde
x23: ffff8000967679a0 x22: ffff8000967679c0 x21: ffff0000cc1f4008
x20: ffff0000cc1f4628 x19: dfff800000000000 x18: 0000000000000000
x17: 0000000000000000 x16: ffff80008a576f00 x15: 0000000000000002
x14: 1ffff00012cecf34 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : ffff0000d4921bc0 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000008 x4 : 0000000000000000 x3 : 0000000000000010
x2 : 0000000000000000 x1 : 0000000000000040 x0 : 000000000000003f
Call trace:
 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
 bpf_mprog_pos_before kernel/bpf/mprog.c:200 [inline]
 bpf_mprog_attach+0x584/0xb88 kernel/bpf/mprog.c:258
 tcx_prog_attach+0x23c/0x6ac kernel/bpf/tcx.c:39
 bpf_prog_attach+0x19c/0x340 kernel/bpf/syscall.c:3848
 __sys_bpf+0x2e8/0x5dc kernel/bpf/syscall.c:5344
 __do_sys_bpf kernel/bpf/syscall.c:5439 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5437 [inline]
 __arm64_sys_bpf+0x80/0x98 kernel/bpf/syscall.c:5437
 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
irq event stamp: 576
hardirqs last  enabled at (575): [<ffff800080034500>] local_daif_restore+0x1c/0x3c arch/arm64/include/asm/daifflags.h:75
hardirqs last disabled at (576): [<ffff80008a625394>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:436
softirqs last  enabled at (562): [<ffff8000805caa34>] spin_unlock_bh include/linux/spinlock.h:396 [inline]
softirqs last  enabled at (562): [<ffff8000805caa34>] bpf_prog_by_id+0x144/0x168 kernel/bpf/syscall.c:4083
softirqs last disabled at (560): [<ffff8000805ca92c>] spin_lock_bh include/linux/spinlock.h:356 [inline]
softirqs last disabled at (560): [<ffff8000805ca92c>] bpf_prog_by_id+0x3c/0x168 kernel/bpf/syscall.c:4077
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_insert+0x2bc/0x3f8 kernel/bpf/mprog.c:131
Modules linked in:
CPU: 1 PID: 6072 Comm: syz-executor183 Tainted: G        W          6.6.0-rc3-syzkaller-gbf6547d8715b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
pc : bpf_mprog_insert+0x2bc/0x3f8 kernel/bpf/mprog.c:131
lr : bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
lr : bpf_mprog_insert+0x2bc/0x3f8 kernel/bpf/mprog.c:131
sp : ffff8000967678c0
x29: ffff8000967678c0 x28: 0000000000000040 x27: 1fffe0001983e841
x26: dfff800000000000 x25: 0000000000000040 x24: 0000000000000008
x23: ffff0000cc1f4008 x22: 00000000ffffffff x21: ffff0000cc1f4208
x20: ffff8000967679c0 x19: ffff800096767ac0 x18: 0000000000000000
x17: 0000000000000000 x16: ffff80008a576f00 x15: 0000000000000002
x14: 1ffff00012cecf34 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : ffff0000d4921bc0 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000008 x4 : 0000000000000008 x3 : 00000000ffffffff
x2 : ffff8000967679c0 x1 : 0000000000000040 x0 : 000000000000003f
Call trace:
 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
 bpf_mprog_insert+0x2bc/0x3f8 kernel/bpf/mprog.c:131
 bpf_mprog_attach+0xa40/0xb88 kernel/bpf/mprog.c:288
 tcx_prog_attach+0x23c/0x6ac kernel/bpf/tcx.c:39
 bpf_prog_attach+0x19c/0x340 kernel/bpf/syscall.c:3848
 __sys_bpf+0x2e8/0x5dc kernel/bpf/syscall.c:5344
 __do_sys_bpf kernel/bpf/syscall.c:5439 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5437 [inline]
 __arm64_sys_bpf+0x80/0x98 kernel/bpf/syscall.c:5437
 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
irq event stamp: 724
hardirqs last  enabled at (723): [<ffff80008a6253dc>] el1_dbg+0x6c/0x80 arch/arm64/kernel/entry-common.c:439
hardirqs last disabled at (724): [<ffff80008a625394>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:436
softirqs last  enabled at (594): [<ffff8000800218ec>] softirq_handle_end kernel/softirq.c:399 [inline]
softirqs last  enabled at (594): [<ffff8000800218ec>] __do_softirq+0xac0/0xd54 kernel/softirq.c:582
softirqs last disabled at (579): [<ffff80008002aad4>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_entry_grow include/linux/bpf_mprog.h:277 [inline]
WARNING: CPU: 1 PID: 6072 at include/linux/bpf_mprog.h:198 bpf_mprog_insert+0x2d0/0x3f8 kernel/bpf/mprog.c:142
Modules linked in:
CPU: 1 PID: 6072 Comm: syz-executor183 Tainted: G        W          6.6.0-rc3-syzkaller-gbf6547d8715b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
pc : bpf_mprog_entry_grow include/linux/bpf_mprog.h:277 [inline]
pc : bpf_mprog_insert+0x2d0/0x3f8 kernel/bpf/mprog.c:142
lr : bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
lr : bpf_mprog_entry_grow include/linux/bpf_mprog.h:277 [inline]
lr : bpf_mprog_insert+0x2d0/0x3f8 kernel/bpf/mprog.c:142
sp : ffff8000967678c0
x29: ffff8000967678c0 x28: 1fffe0001983e882 x27: 1fffe0001983e841
x26: dfff800000000000 x25: 0000000000000040 x24: ffff0000cc1f4628
x23: ffff0000cc1f4410 x22: 0000000000000000 x21: ffff0000cc1f4210
x20: ffff8000967679c0 x19: ffff800096767ac0 x18: 0000000000000000
x17: 0000000000000000 x16: ffff80008a576ca0 x15: ffff80009503e000
x14: ffff80009509e000 x13: ffff80009503e000 x12: ffff80009509e000
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
x8 : ffff0000d4921bc0 x7 : ffff800093fee000 x6 : ffff80009501e000
x5 : ffff0000cc1f4410 x4 : ffff0000cc1f4208 x3 : ffff0000cc1f4390
x2 : fffffffffffffff0 x1 : 0000000000000040 x0 : 000000000000003f
Call trace:
 bpf_mprog_total include/linux/bpf_mprog.h:198 [inline]
 bpf_mprog_entry_grow include/linux/bpf_mprog.h:277 [inline]
 bpf_mprog_insert+0x2d0/0x3f8 kernel/bpf/mprog.c:142
 bpf_mprog_attach+0xa40/0xb88 kernel/bpf/mprog.c:288
 tcx_prog_attach+0x23c/0x6ac kernel/bpf/tcx.c:39
 bpf_prog_attach+0x19c/0x340 kernel/bpf/syscall.c:3848
 __sys_bpf+0x2e8/0x5dc kernel/bpf/syscall.c:5344
 __do_sys_bpf kernel/bpf/syscall.c:5439 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5437 [inline]
 __arm64_sys_bpf+0x80/0x98 kernel/bpf/syscall.c:5437
 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678
 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591
irq event stamp: 746
hardirqs last  enabled at (745): [<ffff80008a627868>] __exit_to_kernel_mode arch/arm64/kernel/entry-common.c:84 [inline]
hardirqs last  enabled at (745): [<ffff80008a627868>] exit_to_kernel_mode+0xdc/0x10c arch/arm64/kernel/entry-common.c:94
hardirqs last disabled at (746): [<ffff80008a625394>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:436
softirqs last  enabled at (740): [<ffff8000800218ec>] softirq_handle_end kernel/softirq.c:399 [inline]
softirqs last  enabled at (740): [<ffff8000800218ec>] __do_softirq+0xac0/0xd54 kernel/softirq.c:582
softirqs last disabled at (727): [<ffff80008002aad4>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:80
---[ end trace 0000000000000000 ]---

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/26 11:07 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bf6547d8715b 0b6a67ac .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING in bpf_mprog_attach
2023/10/04 09:46 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2e530aeb342b 65faba36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING in bpf_mprog_attach
2023/09/26 09:55 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bf6547d8715b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING in bpf_mprog_attach
* Struck through repros no longer work on HEAD.