Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 24.04 starts gatekeeper and this error occurs #711

Closed
ShawnLeung87 opened this issue Sep 27, 2024 · 6 comments
Closed

Ubuntu 24.04 starts gatekeeper and this error occurs #711

ShawnLeung87 opened this issue Sep 27, 2024 · 6 comments
Labels
Milestone

Comments

@ShawnLeung87
Copy link

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

@AltraMayor
Copy link
Owner

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?

@ShawnLeung87
Copy link
Author

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

@ShawnLeung87
Copy link
Author

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

@AltraMayor
Copy link
Owner

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

@AltraMayor
Copy link
Owner

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

@AltraMayor AltraMayor added this to the Version 1.2 milestone Sep 27, 2024
@AltraMayor AltraMayor added the bug label Sep 27, 2024
@ShawnLeung87
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants