[syzbot] [bpf?] WARNING in do_misc_fixups

3 views
Skip to first unread message

syzbot

unread,
Aug 4, 2025, 1:08:34 AM8/4/25
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, jo...@kernel.org, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@fomichev.me, so...@kernel.org, syzkall...@googlegroups.com, yongho...@linux.dev
Hello,

syzbot found the following issue on:

HEAD commit: a6923c06a3b2 Merge tag 'bpf-fixes' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1561dcf0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f89bb9497754f485
dashboard link: https://syzkaller.appspot.com/bug?extid=a9ed3d9132939852d0df
compiler: aarch64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=165d0aa2580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=117bd834580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-a6923c06.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9862ca8219e0/vmlinux-a6923c06.xz
kernel image: https://storage.googleapis.com/syzbot-assets/042ebe320cfd/Image-a6923c06.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+a9ed3d...@syzkaller.appspotmail.com

------------[ cut here ]------------
verifier bug: not inlined functions bpf_probe_read_kernel_str#115 is missing func(1)
WARNING: CPU: 1 PID: 3594 at kernel/bpf/verifier.c:22838 do_misc_fixups+0x1784/0x1ab4 kernel/bpf/verifier.c:22838
Modules linked in:
CPU: 1 UID: 0 PID: 3594 Comm: syz.2.17 Not tainted 6.16.0-syzkaller-11105-ga6923c06a3b2 #0 PREEMPT
Hardware name: linux,dummy-virt (DT)
pstate: 61402009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : do_misc_fixups+0x1784/0x1ab4 kernel/bpf/verifier.c:22838
lr : do_misc_fixups+0x1784/0x1ab4 kernel/bpf/verifier.c:22838
sp : ffff80008936b9a0
x29: ffff80008936b9a0 x28: f5ff8000832f5000 x27: 000000000000000a
x26: f8f0000007ba8000 x25: 0000000000000000 x24: f8f0000007bae200
x23: 000000000000f0ff x22: 000000000000000a x21: f8f0000007bae128
x20: f8f0000007ba8aa8 x19: ffff80008243e828 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: ffff800081b73b80
x14: 0000000000000342 x13: 0000000000000000 x12: 0000000000000002
x11: 00000000000000c0 x10: 646e0773d90f24cc x9 : 73727a981a23afd7
x8 : fcf0000007bb36f8 x7 : 0000000000000190 x6 : 0000003978391654
x5 : 0000000000000001 x4 : fbffff3fffffffff x3 : 000000000000ffff
x2 : 0000000000000000 x1 : 0000000000000000 x0 : fcf0000007bb2500
Call trace:
do_misc_fixups+0x1784/0x1ab4 kernel/bpf/verifier.c:22838 (P)
bpf_check+0x1308/0x2a8c kernel/bpf/verifier.c:24739
bpf_prog_load+0x634/0xb74 kernel/bpf/syscall.c:2979
__sys_bpf+0x2e0/0x1a3c kernel/bpf/syscall.c:6029
__do_sys_bpf kernel/bpf/syscall.c:6139 [inline]
__se_sys_bpf kernel/bpf/syscall.c:6137 [inline]
__arm64_sys_bpf+0x24/0x34 kernel/bpf/syscall.c:6137
__invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
invoke_syscall+0x48/0x110 arch/arm64/kernel/syscall.c:49
el0_svc_common.constprop.0+0x40/0xe0 arch/arm64/kernel/syscall.c:132
do_el0_svc+0x1c/0x28 arch/arm64/kernel/syscall.c:151
el0_svc+0x34/0x10c arch/arm64/kernel/entry-common.c:879
el0t_64_sync_handler+0xa0/0xe4 arch/arm64/kernel/entry-common.c:898
el0t_64_sync+0x1a4/0x1a8 arch/arm64/kernel/entry.S:596
---[ end trace 0000000000000000 ]---


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Alexei Starovoitov

unread,
Aug 4, 2025, 12:05:39 PM8/4/25
to syzbot, Andrii Nakryiko, Alexei Starovoitov, bpf, Daniel Borkmann, Eduard, Hao Luo, John Fastabend, Jiri Olsa, KP Singh, LKML, Martin KaFai Lau, Stanislav Fomichev, Song Liu, syzkaller-bugs, Yonghong Song
On Sun, Aug 3, 2025 at 10:08 PM syzbot
<syzbot+a9ed3d...@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: a6923c06a3b2 Merge tag 'bpf-fixes' of git://git.kernel.org..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1561dcf0580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=f89bb9497754f485
> dashboard link: https://syzkaller.appspot.com/bug?extid=a9ed3d9132939852d0df
> compiler: aarch64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> userspace arch: arm64
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=165d0aa2580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=117bd834580000
>
> Downloadable assets:
> disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-a6923c06.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/9862ca8219e0/vmlinux-a6923c06.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/042ebe320cfd/Image-a6923c06.gz.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+a9ed3d...@syzkaller.appspotmail.com
>
> ------------[ cut here ]------------
> verifier bug: not inlined functions bpf_probe_read_kernel_str#115 is missing func(1)
> WARNING: CPU: 1 PID: 3594 at kernel/bpf/verifier.c:22838 do_misc_fixups+0x1784/0x1ab4 kernel/bpf/verifier.c:22838

This is an odd config with BPF_SYSCALL=y and BPF_EVENTS=n.
One approach to mitigate this is to add a check that fn->func is valid
in get_helper_proto().

Jiri Olsa

unread,
Aug 5, 2025, 9:53:09 AM8/5/25
to syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, s...@fomichev.me, so...@kernel.org, syzkall...@googlegroups.com, yongho...@linux.dev
trying suggested fix by Alexei

jirka


#syz test

---
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 0806295945e4..6aa303f76849 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -11344,6 +11344,13 @@ static bool can_elide_value_nullness(enum bpf_map_type type)
}
}

+static bool is_valid_proto(const struct bpf_func_proto *fn, int func_id)
+{
+ if (func_id == BPF_FUNC_tail_call)
+ return true;
+ return fn && fn->func;
+}
+
static int get_helper_proto(struct bpf_verifier_env *env, int func_id,
const struct bpf_func_proto **ptr)
{
@@ -11354,7 +11361,7 @@ static int get_helper_proto(struct bpf_verifier_env *env, int func_id,
return -EINVAL;

*ptr = env->ops->get_func_proto(func_id, env->prog);
- return *ptr ? 0 : -EINVAL;
+ return is_valid_proto(*ptr, func_id) ? 0 : -EINVAL;
}

static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn,

syzbot

unread,
Aug 5, 2025, 10:23:08 AM8/5/25
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, edd...@gmail.com, hao...@google.com, john.fa...@gmail.com, kps...@kernel.org, linux-...@vger.kernel.org, marti...@linux.dev, olsa...@gmail.com, s...@fomichev.me, so...@kernel.org, syzkall...@googlegroups.com, yongho...@linux.dev
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+a9ed3d...@syzkaller.appspotmail.com
Tested-by: syzbot+a9ed3d...@syzkaller.appspotmail.com

Tested on:

commit: 5998f2bc Merge tag 'exfat-for-6.17-rc1' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17da86a2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=853dee08ee43cbe9
dashboard link: https://syzkaller.appspot.com/bug?extid=a9ed3d9132939852d0df
compiler: aarch64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
patch: https://syzkaller.appspot.com/x/patch.diff?x=1365c2f0580000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages