AltraMayor/gatekeeper

Ubuntu 24.04 starts gatekeeper and this error occurs

ShawnLeung87 opened this issue · 6 comments

rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/declined.bpf", sname="pkt") successfully creates 0x78aaf80a4000(jit={.func=0x78aaf80a3000,.sz=8});
resolve_xsym(1): EBPF_PSEUDO_CALL to external function: init_ctx_to_cookie
rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/grantedv2.bpf", sname="init") successfully creates 0x78aaf80a2000(jit={.func=0x78aaf80a1000,.sz=400});
resolve_xsym(1): EBPF_PSEUDO_CALL to external function: pkt_ctx_to_cookie
resolve_xsym(4): EBPF_PSEUDO_CALL to external function: pkt_ctx_to_pkt
resolve_xsym(34): EBPF_PSEUDO_CALL to external function: gk_bpf_prep_for_tx
rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/grantedv2.bpf", sname="pkt") successfully creates 0x78aaf80a0000(jit={.func=0x78aaf809f000,.sz=384});
resolve_xsym(1): EBPF_PSEUDO_CALL to external function: init_ctx_to_cookie
rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/web.bpf", sname="init") successfully creates 0x78aaf809e000(jit={.func=0x78aaf809d000,.sz=400});
resolve_xsym(1): EBPF_PSEUDO_CALL to external function: pkt_ctx_to_cookie
resolve_xsym(4): EBPF_PSEUDO_CALL to external function: pkt_ctx_to_pkt
resolve_xsym(147): EBPF_PSEUDO_CALL to external function: gk_bpf_prep_for_tx
rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/web.bpf", sname="pkt") successfully creates 0x78aaf7e5d000(jit={.func=0x78aaf7e5c000,.sz=1008});
resolve_xsym(1): EBPF_PSEUDO_CALL to external function: init_ctx_to_cookie
rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/tcp-services.bpf", sname="init") successfully creates 0x78aaf7e5b000(jit={.func=0x78aaf7e5a000,.sz=858});
resolve_xsym(1): EBPF_PSEUDO_CALL to external function: pkt_ctx_to_cookie
resolve_xsym(4): EBPF_PSEUDO_CALL to external function: pkt_ctx_to_pkt
resolve_xsym(, 1288) error code: -2
rte_bpf_elf_load(fname="/opt/gatekeeper/lua/bpf/tcp-services.bpf", sname="pkt") failed, error code: 2
Main/6 2024-09-27 19:17:17 ERR gk_load_bpf_flow_handler(): file "/opt/gatekeeper/lua/bpf/tcp-services.bpf" does not have the BPF program "pkt"; rte_errno = 2: No such file or directory
Main/6 2024-09-27 19:17:17 ERR config: /opt/gatekeeper/lua/gk.lua:116: Failed to load BPF program: /opt/gatekeeper/lua/bpf/tcp-services.bpf

The error message resolve_xsym(, 1288) error code: -2 suggests that tcp-services.bpf is not freshly compiled from bpf/tcp-services.c available on our repository. Have you compiled and copied the BPFs that come with Gatekeeper v1.2.0 RC2 to /opt/gatekeeper/lua/bpf/? If yes, have you edited bpf/tcp-services.c in any capacity?

bpf is the default bpf for the project. The code was copied from the master branch today.

Is it because of clang version problem?
My server clang version is
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@MX32
Selected multilib: .;@m64

I was able to reproduce the problem on a fresh install. Thank you.

Could you apply pull request #712, recompile and copy the BPFs, and try again?

It works, most of the bpfs I wrote can run normally. There is a BPF exception, which should be due to the syntax change of the new version of clang. I will take the time to check the wrong BPF after the holiday is over.