Skip to content

number of funcs in func_info doesn't match number of subprogs #177

@leiqi96

Description

@leiqi96

Environment: ubuntu 21.04 kernel 5.11.0

  1. It fails to load epf-lsm program.
    Error: the BPF_PROG_LOAD syscall failed. Verifier output: func#0 @0 number of funcs in func_info doesn't match number of subprogs verification time 13 usec stack depth 0 processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0

Here is the log used by strace
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_LSM, insn_cnt=192, insns=0x561ac794b510, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 11, 0), prog_flags=0, prog_name="sb_mount", prog_ifindex=0, expected_attach_type=BPF_LSM_MAC, prog_btf_fd=10, func_info_rec_size=8, func_info=0x561ac77b82f0, func_info_cnt=2, line_info_rec_size=16, line_info=0x561ac77b87f0, line_info_cnt=69, attach_btf_id=32269, attach_prog_fd=0}, 144) = -1 EINVAL (Invalid argument)

I searched the linux kernel 5.11.0 and found the error is raising when eBPF verifier trying to compare attr->func_info_cnt and env->subprog_cnt but I don't understand why.

  1. I also want to know which library is used to load ebpf program

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions