kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.67k stars 333 forks source link

Chained CNI with Cilium and eBPF enabled causes crashes #9846

Open mhkarimi1383 opened 7 months ago

mhkarimi1383 commented 7 months ago

What happened?

Helm Values:

cni:
  enabled: true
  chained: true
  logLevel: debug
  netDir: /etc/cni/net.d
  binDir: /opt/cni/bin
  confName: 05-cilium.conflist

experimental:
  ebpf:
    enabled: true

Debug Log of CNI Pods:

2024-04-06T09:12:53.950655Z warn    OS CA Cert could not be found for agent
warning: found 3 cgroup2 mounts, only first one (/sys/fs/cgroup) will be used (ignored: [/sys/fs/cgroup, /host/var/run/cilium/cgroupv2, /host/var/run/containerd/io.containerd.runtime.v2.task/k8s.io/74d7de3c9efbc7f9d75f413b6ffb08331c648ac6207893767ddf87392f95fbc2/rootfs/sys/fs/cgroup])
Using cgroup2 mount: /sys/fs/cgroup
warning: expected bpf mount: /sys/fs/bpf cannot be found - ignoring
warning: cannot find any bpf mounts - will try to manually mount /sys/fs/bpf
Running:  /app/bpf/mb_connect --bpffs /sys/fs/bpf --verbose --cgroup /sys/fs/cgroup
libbpf: loading object 'mb_connect_bpf' from buffer
libbpf: elf: section(3) cgroup/connect4, size 6376, link 0, flags 6, type=1
libbpf: sec 'cgroup/connect4': found program 'mb_sock_connect4' at insn offset 0 (0 bytes), code size 797 insns (6376 bytes)
libbpf: elf: section(4) .relcgroup/connect4, size 128, link 14, flags 40, type=9
libbpf: elf: section(5) license, size 4, link 0, flags 3, type=1
libbpf: license of mb_connect_bpf is GPL
libbpf: elf: section(6) .maps, size 160, link 0, flags 3, type=1
libbpf: elf: section(7) .rodata.str1.1, size 129, link 0, flags 32, type=1
libbpf: elf: section(8) .data, size 4, link 0, flags 3, type=1
libbpf: elf: section(9) .BTF, size 58116, link 0, flags 0, type=1
libbpf: elf: section(11) .BTF.ext, size 8796, link 0, flags 0, type=1
libbpf: elf: section(14) .symtab, size 888, link 1, flags 0, type=2
libbpf: looking for externs among 37 symbols...
libbpf: collected 0 externs total
libbpf: map 'cookie_orig_dst': at sec_idx 6, offset 0.
libbpf: map 'cookie_orig_dst': found type = 9.
libbpf: map 'cookie_orig_dst': found key_size = 8.
libbpf: map 'cookie_orig_dst': found value_size = 24.
libbpf: map 'cookie_orig_dst': found max_entries = 65535.
libbpf: map 'cookie_orig_dst': found pinning = 1.
libbpf: map 'netns_pod_ips': at sec_idx 6, offset 40.
libbpf: map 'netns_pod_ips': found type = 9.
libbpf: map 'netns_pod_ips': found key_size = 8.
libbpf: map 'netns_pod_ips': found value_size = 16.
libbpf: map 'netns_pod_ips': found max_entries = 65535.
libbpf: map 'netns_pod_ips': found pinning = 1.
libbpf: map 'local_pod_ips': at sec_idx 6, offset 80.
libbpf: map 'local_pod_ips': found type = 9.
libbpf: map 'local_pod_ips': found key_size = 16.
libbpf: map 'local_pod_ips': found value_size = 244.
libbpf: map 'local_pod_ips': found max_entries = 65535.
libbpf: map 'local_pod_ips': found pinning = 1.
libbpf: map 'process_ip': at sec_idx 6, offset 120.
libbpf: map 'process_ip': found type = 9.
libbpf: map 'process_ip': found key_size = 4.
libbpf: map 'process_ip': found value_size = 4.
libbpf: map 'process_ip': found max_entries = 1024.
libbpf: map 'process_ip': found pinning = 1.
libbpf: map '.rodata.str1.1' (global data): at sec_idx 7, offset 0, flags 480.
libbpf: map 4 is ".rodata.str1.1"
libbpf: map 'mb_conne.data' (global data): at sec_idx 8, offset 0, flags 400.
libbpf: map 5 is "mb_conne.data"
libbpf: sec '.relcgroup/connect4': collecting relocation for section(3) 'cgroup/connect4'
libbpf: sec '.relcgroup/connect4': relo #0: insn #73 against 'netns_pod_ips'
libbpf: prog 'mb_sock_connect4': found map 1 (netns_pod_ips, sec 6, off 40) for insn #73
libbpf: sec '.relcgroup/connect4': relo #1: insn #112 against 'cookie_orig_dst'
libbpf: prog 'mb_sock_connect4': found map 0 (cookie_orig_dst, sec 6, off 0) for insn #112
libbpf: sec '.relcgroup/connect4': relo #2: insn #178 against 'cookie_orig_dst'
libbpf: prog 'mb_sock_connect4': found map 0 (cookie_orig_dst, sec 6, off 0) for insn #178
libbpf: sec '.relcgroup/connect4': relo #3: insn #214 against 'local_pod_ips'
libbpf: prog 'mb_sock_connect4': found map 2 (local_pod_ips, sec 6, off 80) for insn #214
libbpf: sec '.relcgroup/connect4': relo #4: insn #340 against 'process_ip'
libbpf: prog 'mb_sock_connect4': found map 3 (process_ip, sec 6, off 120) for insn #340
libbpf: sec '.relcgroup/connect4': relo #5: insn #360 against 'cookie_orig_dst'
libbpf: prog 'mb_sock_connect4': found map 0 (cookie_orig_dst, sec 6, off 0) for insn #360
libbpf: sec '.relcgroup/connect4': relo #6: insn #399 against 'local_pod_ips'
libbpf: prog 'mb_sock_connect4': found map 2 (local_pod_ips, sec 6, off 80) for insn #399
libbpf: sec '.relcgroup/connect4': relo #7: insn #622 against '.data'
libbpf: prog 'mb_sock_connect4': found data map 5 (mb_conne.data, sec 8, off 0) for insn 622
libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
libbpf: found no pinned map to reuse at '/sys/fs/bpf/cookie_orig_dst'
libbpf: map 'cookie_orig_dst': created successfully, fd=4
libbpf: pinned map '/sys/fs/bpf/cookie_orig_dst'
libbpf: found no pinned map to reuse at '/sys/fs/bpf/netns_pod_ips'
libbpf: map 'netns_pod_ips': created successfully, fd=5
libbpf: pinned map '/sys/fs/bpf/netns_pod_ips'
libbpf: found no pinned map to reuse at '/sys/fs/bpf/local_pod_ips'
libbpf: map 'local_pod_ips': created successfully, fd=6
libbpf: pinned map '/sys/fs/bpf/local_pod_ips'
libbpf: found no pinned map to reuse at '/sys/fs/bpf/process_ip'
libbpf: map 'process_ip': created successfully, fd=7
libbpf: pinned map '/sys/fs/bpf/process_ip'
libbpf: map '.rodata.str1.1': created successfully, fd=8
libbpf: map 'mb_conne.data': created successfully, fd=9
libbpf: sec 'cgroup/connect4': found 66 CO-RE relocations
libbpf: CO-RE relocating [30] struct bpf_sock_addr: found target candidate [78549] struct bpf_sock_addr in [vmlinux]
libbpf: prog 'mb_sock_connect4': relo #0: <byte_off> [30] struct bpf_sock_addr.protocol (0:6 @ offset 36)
libbpf: prog 'mb_sock_connect4': relo #0: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.protocol (0:6 @ offset 36)
libbpf: prog 'mb_sock_connect4': relo #0: patched insn #2 (LDX/ST/STX) off 36 -> 36
libbpf: CO-RE relocating [38] struct bpf_sock_tuple: found target candidate [97737] struct bpf_sock_tuple in [vmlinux]
libbpf: prog 'mb_sock_connect4': relo #1: <byte_off> [38] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sock_connect4': relo #1: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sock_connect4': relo #1: patched insn #14 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_sock_connect4': relo #2: <byte_off> [38] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #2: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #2: patched insn #15 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #3: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #3: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #3: patched insn #23 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #4: <byte_off> [38] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sock_connect4': relo #4: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sock_connect4': relo #4: patched insn #35 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_sock_connect4': relo #5: <byte_off> [38] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #5: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #5: patched insn #36 (LDX/ST/STX) off 4 -> 4
libbpf: CO-RE relocating [47] struct task_struct: found target candidate [239] struct task_struct in [vmlinux]
libbpf: prog 'mb_sock_connect4': relo #6: <byte_off> [47] struct task_struct.nsproxy (0:92 @ offset 1672)
libbpf: prog 'mb_sock_connect4': relo #6: matching candidate #0 <byte_off> [239] struct task_struct.nsproxy (0:127 @ offset 3064)
libbpf: prog 'mb_sock_connect4': relo #6: patched insn #48 (ALU/ALU64) imm 1672 -> 3064
libbpf: CO-RE relocating [321] struct nsproxy: found target candidate [704] struct nsproxy in [vmlinux]
libbpf: prog 'mb_sock_connect4': relo #7: <byte_off> [321] struct nsproxy.net_ns (0:5 @ offset 40)
libbpf: prog 'mb_sock_connect4': relo #7: matching candidate #0 <byte_off> [704] struct nsproxy.net_ns (0:5 @ offset 40)
libbpf: prog 'mb_sock_connect4': relo #7: patched insn #56 (ALU/ALU64) imm 40 -> 40
libbpf: CO-RE relocating [328] struct net: found target candidate [1806] struct net in [vmlinux]
libbpf: prog 'mb_sock_connect4': relo #8: <byte_off> [328] struct net.ns.inum (0:15:2 @ offset 136)
libbpf: prog 'mb_sock_connect4': relo #8: matching candidate #0 <byte_off> [1806] struct net.ns.inum (0:14:2 @ offset 136)
libbpf: prog 'mb_sock_connect4': relo #8: patched insn #62 (ALU/ALU64) imm 136 -> 136
libbpf: prog 'mb_sock_connect4': relo #9: <byte_off> [30] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #9: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #9: patched insn #88 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #10: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #10: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #10: patched insn #104 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #11: <byte_off> [38] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sock_connect4': relo #11: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sock_connect4': relo #11: patched insn #147 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_sock_connect4': relo #12: <byte_off> [38] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #12: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #12: patched insn #149 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #13: <byte_off> [30] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #13: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #13: patched insn #165 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #14: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #14: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #14: patched insn #169 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #15: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #15: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #15: patched insn #204 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #16: <byte_off> [30] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #16: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #16: patched insn #206 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #17: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #17: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #17: patched insn #224 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #18: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #18: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #18: patched insn #234 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #19: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #19: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #19: patched insn #239 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #20: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #20: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #20: patched insn #244 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #21: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #21: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #21: patched insn #249 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #22: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #22: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #22: patched insn #254 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #23: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #23: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #23: patched insn #259 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #24: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #24: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #24: patched insn #264 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #25: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #25: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #25: patched insn #269 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #26: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #26: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #26: patched insn #274 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #27: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #27: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #27: patched insn #279 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #28: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #28: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #28: patched insn #286 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #29: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #29: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #29: patched insn #291 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #30: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #30: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #30: patched insn #296 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #31: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #31: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #31: patched insn #301 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #32: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #32: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #32: patched insn #306 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #33: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #33: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #33: patched insn #311 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #34: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #34: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #34: patched insn #316 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #35: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #35: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #35: patched insn #321 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #36: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #36: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #36: patched insn #326 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #37: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #37: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #37: patched insn #331 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #38: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #38: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #38: patched insn #349 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #39: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #39: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #39: patched insn #391 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #40: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #40: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #40: patched insn #406 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #41: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #41: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #41: patched insn #411 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #42: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #42: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #42: patched insn #416 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #43: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #43: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #43: patched insn #421 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #44: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #44: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #44: patched insn #426 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #45: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #45: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #45: patched insn #431 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #46: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #46: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #46: patched insn #436 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #47: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #47: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #47: patched insn #441 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #48: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #48: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #48: patched insn #446 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #49: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #49: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #49: patched insn #451 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #50: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #50: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #50: patched insn #581 (LDX/ST/STX) off 24 -> 24
libbpf: CO-RE relocating [683] struct sockaddr_in: found target candidate [12732] struct sockaddr_in in [vmlinux]
libbpf: prog 'mb_sock_connect4': relo #51: <byte_off> [683] struct sockaddr_in.sin_addr.s_addr (0:2:0 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #51: matching candidate #0 <byte_off> [12732] struct sockaddr_in.sin_addr.s_addr (0:2:0 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #51: patched insn #598 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #52: <byte_off> [683] struct sockaddr_in.sin_port (0:1 @ offset 2)
libbpf: prog 'mb_sock_connect4': relo #52: matching candidate #0 <byte_off> [12732] struct sockaddr_in.sin_port (0:1 @ offset 2)
libbpf: prog 'mb_sock_connect4': relo #52: patched insn #600 (LDX/ST/STX) off 2 -> 2
libbpf: prog 'mb_sock_connect4': relo #53: <byte_off> [683] struct sockaddr_in.sin_family (0:0 @ offset 0)
libbpf: prog 'mb_sock_connect4': relo #53: matching candidate #0 <byte_off> [12732] struct sockaddr_in.sin_family (0:0 @ offset 0)
libbpf: prog 'mb_sock_connect4': relo #53: patched insn #602 (LDX/ST/STX) off 0 -> 0
libbpf: prog 'mb_sock_connect4': relo #54: <byte_off> [30] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #54: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #54: patched insn #620 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #55: <byte_off> [30] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #55: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sock_connect4': relo #55: patched insn #630 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sock_connect4': relo #56: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #56: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #56: patched insn #638 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #57: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #57: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #57: patched insn #753 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #58: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #58: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #58: patched insn #758 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #59: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #59: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #59: patched insn #763 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #60: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #60: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #60: patched insn #768 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #61: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #61: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #61: patched insn #773 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #62: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #62: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #62: patched insn #778 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #63: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #63: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #63: patched insn #783 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #64: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #64: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #64: patched insn #788 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': relo #65: <byte_off> [30] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #65: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sock_connect4': relo #65: patched insn #793 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sock_connect4': pinned at '/sys/fs/bpf/connect/cgroup_connect4'
attaching mb_sock_connect4 program failed with error: -1
#### ENV
cgroup          : /sys/fs/cgroup
bpffs           : /sys/fs/bpf
verbose         : true
####
Running:  /app/bpf/mb_sockops --cgroup /sys/fs/cgroup --bpffs /sys/fs/bpf --verbose
libbpf: loading object 'mb_sockops_bpf' from buffer
libbpf: elf: section(3) sockops, size 1120, link 0, flags 6, type=1
libbpf: sec 'sockops': found program 'mb_sockops' at insn offset 0 (0 bytes), code size 140 insns (1120 bytes)
libbpf: elf: section(4) .relsockops, size 96, link 13, flags 40, type=9
libbpf: elf: section(5) license, size 4, link 0, flags 3, type=1
libbpf: license of mb_sockops_bpf is GPL
libbpf: elf: section(6) .maps, size 160, link 0, flags 3, type=1
libbpf: elf: section(7) .rodata.str1.1, size 40, link 0, flags 32, type=1
libbpf: elf: section(8) .BTF, size 3597, link 0, flags 0, type=1
libbpf: elf: section(10) .BTF.ext, size 1068, link 0, flags 0, type=1
libbpf: elf: section(13) .symtab, size 336, link 1, flags 0, type=2
libbpf: looking for externs among 14 symbols...
libbpf: collected 0 externs total
libbpf: map 'cookie_orig_dst': at sec_idx 6, offset 0.
libbpf: map 'cookie_orig_dst': found type = 9.
libbpf: map 'cookie_orig_dst': found key_size = 8.
libbpf: map 'cookie_orig_dst': found value_size = 24.
libbpf: map 'cookie_orig_dst': found max_entries = 65535.
libbpf: map 'cookie_orig_dst': found pinning = 1.
libbpf: map 'process_ip': at sec_idx 6, offset 40.
libbpf: map 'process_ip': found type = 9.
libbpf: map 'process_ip': found key_size = 4.
libbpf: map 'process_ip': found value_size = 4.
libbpf: map 'process_ip': found max_entries = 1024.
libbpf: map 'process_ip': found pinning = 1.
libbpf: map 'pair_orig_dst': at sec_idx 6, offset 80.
libbpf: map 'pair_orig_dst': found type = 9.
libbpf: map 'pair_orig_dst': found key_size = 36.
libbpf: map 'pair_orig_dst': found value_size = 24.
libbpf: map 'pair_orig_dst': found max_entries = 65535.
libbpf: map 'pair_orig_dst': found pinning = 1.
libbpf: map 'sock_pair_map': at sec_idx 6, offset 120.
libbpf: map 'sock_pair_map': found type = 18.
libbpf: map 'sock_pair_map': found key_size = 36.
libbpf: map 'sock_pair_map': found value_size = 4.
libbpf: map 'sock_pair_map': found max_entries = 65535.
libbpf: map 'sock_pair_map': found pinning = 1.
libbpf: map '.rodata.str1.1' (global data): at sec_idx 7, offset 0, flags 480.
libbpf: map 4 is ".rodata.str1.1"
libbpf: sec '.relsockops': collecting relocation for section(3) 'sockops'
libbpf: sec '.relsockops': relo #0: insn #29 against 'cookie_orig_dst'
libbpf: prog 'mb_sockops': found map 0 (cookie_orig_dst, sec 6, off 0) for insn #29
libbpf: sec '.relsockops': relo #1: insn #65 against 'process_ip'
libbpf: prog 'mb_sockops': found map 1 (process_ip, sec 6, off 40) for insn #65
libbpf: sec '.relsockops': relo #2: insn #108 against 'sock_pair_map'
libbpf: prog 'mb_sockops': found map 3 (sock_pair_map, sec 6, off 120) for insn #108
libbpf: sec '.relsockops': relo #3: insn #118 against 'process_ip'
libbpf: prog 'mb_sockops': found map 1 (process_ip, sec 6, off 40) for insn #118
libbpf: sec '.relsockops': relo #4: insn #127 against 'pair_orig_dst'
libbpf: prog 'mb_sockops': found map 2 (pair_orig_dst, sec 6, off 80) for insn #127
libbpf: sec '.relsockops': relo #5: insn #133 against 'sock_pair_map'
libbpf: prog 'mb_sockops': found map 3 (sock_pair_map, sec 6, off 120) for insn #133
libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
libbpf: reused pinned map at '/sys/fs/bpf/cookie_orig_dst'
libbpf: map 'cookie_orig_dst': skipping creation (preset fd=5)
libbpf: reused pinned map at '/sys/fs/bpf/process_ip'
libbpf: map 'process_ip': skipping creation (preset fd=6)
libbpf: found no pinned map to reuse at '/sys/fs/bpf/pair_orig_dst'
libbpf: map 'pair_orig_dst': created successfully, fd=4
libbpf: pinned map '/sys/fs/bpf/pair_orig_dst'
libbpf: found no pinned map to reuse at '/sys/fs/bpf/sock_pair_map'
libbpf: map 'sock_pair_map': created successfully, fd=7
libbpf: pinned map '/sys/fs/bpf/sock_pair_map'
libbpf: map '.rodata.str1.1': created successfully, fd=8
libbpf: sec 'sockops': found 12 CO-RE relocations
libbpf: CO-RE relocating [30] struct bpf_sock_ops: found target candidate [78553] struct bpf_sock_ops in [vmlinux]
libbpf: prog 'mb_sockops': relo #0: <byte_off> [30] struct bpf_sock_ops.op (0:0 @ offset 0)
libbpf: prog 'mb_sockops': relo #0: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.op (0:0 @ offset 0)
libbpf: prog 'mb_sockops': relo #0: patched insn #1 (LDX/ST/STX) off 0 -> 0
libbpf: prog 'mb_sockops': relo #1: <byte_off> [30] struct bpf_sock_ops.family (0:2 @ offset 20)
libbpf: prog 'mb_sockops': relo #1: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.family (0:2 @ offset 20)
libbpf: prog 'mb_sockops': relo #1: patched insn #7 (LDX/ST/STX) off 20 -> 20
libbpf: prog 'mb_sockops': relo #2: <byte_off> [30] struct bpf_sock_ops.local_ip4 (0:4 @ offset 28)
libbpf: prog 'mb_sockops': relo #2: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.local_ip4 (0:4 @ offset 28)
libbpf: prog 'mb_sockops': relo #2: patched insn #12 (LDX/ST/STX) off 28 -> 28
libbpf: prog 'mb_sockops': relo #3: <byte_off> [30] struct bpf_sock_ops.local_port (0:8 @ offset 68)
libbpf: prog 'mb_sockops': relo #3: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.local_port (0:8 @ offset 68)
libbpf: prog 'mb_sockops': relo #3: patched insn #17 (LDX/ST/STX) off 68 -> 68
libbpf: prog 'mb_sockops': relo #4: <byte_off> [30] struct bpf_sock_ops.remote_ip4 (0:3 @ offset 24)
libbpf: prog 'mb_sockops': relo #4: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.remote_ip4 (0:3 @ offset 24)
libbpf: prog 'mb_sockops': relo #4: patched insn #20 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sockops': relo #5: <byte_off> [30] struct bpf_sock_ops.remote_port (0:7 @ offset 64)
libbpf: prog 'mb_sockops': relo #5: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.remote_port (0:7 @ offset 64)
libbpf: prog 'mb_sockops': relo #5: patched insn #24 (LDX/ST/STX) off 64 -> 64
libbpf: prog 'mb_sockops': relo #6: <byte_off> [30] struct bpf_sock_ops.remote_ip4 (0:3 @ offset 24)
libbpf: prog 'mb_sockops': relo #6: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.remote_ip4 (0:3 @ offset 24)
libbpf: prog 'mb_sockops': relo #6: patched insn #53 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sockops': relo #7: <byte_off> [30] struct bpf_sock_ops.local_ip4 (0:4 @ offset 28)
libbpf: prog 'mb_sockops': relo #7: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.local_ip4 (0:4 @ offset 28)
libbpf: prog 'mb_sockops': relo #7: patched insn #55 (LDX/ST/STX) off 28 -> 28
libbpf: prog 'mb_sockops': relo #8: <byte_off> [30] struct bpf_sock_ops.remote_port (0:7 @ offset 64)
libbpf: prog 'mb_sockops': relo #8: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.remote_port (0:7 @ offset 64)
libbpf: prog 'mb_sockops': relo #8: patched insn #69 (LDX/ST/STX) off 64 -> 64
libbpf: prog 'mb_sockops': relo #9: <byte_off> [30] struct bpf_sock_ops.local_port (0:8 @ offset 68)
libbpf: prog 'mb_sockops': relo #9: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.local_port (0:8 @ offset 68)
libbpf: prog 'mb_sockops': relo #9: patched insn #98 (LDX/ST/STX) off 68 -> 68
libbpf: prog 'mb_sockops': relo #10: <byte_off> [30] struct bpf_sock_ops.local_port (0:8 @ offset 68)
libbpf: prog 'mb_sockops': relo #10: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.local_port (0:8 @ offset 68)
libbpf: prog 'mb_sockops': relo #10: patched insn #100 (LDX/ST/STX) off 68 -> 68
libbpf: prog 'mb_sockops': relo #11: <byte_off> [30] struct bpf_sock_ops.remote_ip4 (0:3 @ offset 24)
libbpf: prog 'mb_sockops': relo #11: matching candidate #0 <byte_off> [78553] struct bpf_sock_ops.remote_ip4 (0:3 @ offset 24)
libbpf: prog 'mb_sockops': relo #11: patched insn #103 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sockops': pinned at '/sys/fs/bpf/sockops'
#### ENV
cgroup          : /sys/fs/cgroup
bpffs           : /sys/fs/bpf
verbose         : true
####

Running:  /app/bpf/mb_get_sockopts --bpffs /sys/fs/bpf --verbose --cgroup /sys/fs/cgroup
libbpf: loading object 'mb_get_sockopts_bpf' from buffer
libbpf: elf: section(3) cgroup/getsockopt, size 736, link 0, flags 6, type=1
libbpf: sec 'cgroup/getsockopt': found program 'mb_get_sockopt' at insn offset 0 (0 bytes), code size 92 insns (736 bytes)
libbpf: elf: section(4) .relcgroup/getsockopt, size 16, link 13, flags 40, type=9
libbpf: elf: section(5) .maps, size 40, link 0, flags 3, type=1
libbpf: elf: section(6) .rodata.str1.1, size 47, link 0, flags 32, type=1
libbpf: elf: section(7) license, size 4, link 0, flags 3, type=1
libbpf: license of mb_get_sockopts_bpf is GPL
libbpf: elf: section(8) .BTF, size 2804, link 0, flags 0, type=1
libbpf: elf: section(10) .BTF.ext, size 1036, link 0, flags 0, type=1
libbpf: elf: section(13) .symtab, size 192, link 1, flags 0, type=2
libbpf: looking for externs among 8 symbols...
libbpf: collected 0 externs total
libbpf: map 'pair_orig_dst': at sec_idx 5, offset 0.
libbpf: map 'pair_orig_dst': found type = 9.
libbpf: map 'pair_orig_dst': found key_size = 36.
libbpf: map 'pair_orig_dst': found value_size = 24.
libbpf: map 'pair_orig_dst': found max_entries = 65535.
libbpf: map 'pair_orig_dst': found pinning = 1.
libbpf: map '.rodata.str1.1' (global data): at sec_idx 6, offset 0, flags 480.
libbpf: map 1 is ".rodata.str1.1"
libbpf: sec '.relcgroup/getsockopt': collecting relocation for section(3) 'cgroup/getsockopt'
libbpf: sec '.relcgroup/getsockopt': relo #0: insn #30 against 'pair_orig_dst'
libbpf: prog 'mb_get_sockopt': found map 0 (pair_orig_dst, sec 5, off 0) for insn #30
libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
libbpf: reused pinned map at '/sys/fs/bpf/pair_orig_dst'
libbpf: map 'pair_orig_dst': skipping creation (preset fd=5)
libbpf: map '.rodata.str1.1': created successfully, fd=4
libbpf: sec 'cgroup/getsockopt': found 20 CO-RE relocations
libbpf: CO-RE relocating [16] struct bpf_sockopt: found target candidate [78556] struct bpf_sockopt in [vmlinux]
libbpf: prog 'mb_get_sockopt': relo #0: <byte_off> [16] struct bpf_sockopt.optlen (0:5 @ offset 32)
libbpf: prog 'mb_get_sockopt': relo #0: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.optlen (0:5 @ offset 32)
libbpf: prog 'mb_get_sockopt': relo #0: patched insn #1 (LDX/ST/STX) off 32 -> 32
libbpf: prog 'mb_get_sockopt': relo #1: <byte_off> [16] struct bpf_sockopt.optlen (0:5 @ offset 32)
libbpf: prog 'mb_get_sockopt': relo #1: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.optlen (0:5 @ offset 32)
libbpf: prog 'mb_get_sockopt': relo #1: patched insn #7 (LDX/ST/STX) off 32 -> 32
libbpf: prog 'mb_get_sockopt': relo #2: <byte_off> [16] struct bpf_sockopt.optname (0:4 @ offset 28)
libbpf: prog 'mb_get_sockopt': relo #2: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.optname (0:4 @ offset 28)
libbpf: prog 'mb_get_sockopt': relo #2: patched insn #8 (LDX/ST/STX) off 28 -> 28
libbpf: prog 'mb_get_sockopt': relo #3: <byte_off> [16] struct bpf_sockopt.sk (0:0:0 @ offset 0)
libbpf: prog 'mb_get_sockopt': relo #3: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.sk (0:0:0 @ offset 0)
libbpf: prog 'mb_get_sockopt': relo #3: patched insn #10 (LDX/ST/STX) off 0 -> 0
libbpf: CO-RE relocating [25] struct bpf_sock: found target candidate [31507] struct bpf_sock in [vmlinux]
libbpf: prog 'mb_get_sockopt': relo #4: <byte_off> [25] struct bpf_sock.src_port (0:8 @ offset 44)
libbpf: prog 'mb_get_sockopt': relo #4: matching candidate #0 <byte_off> [31507] struct bpf_sock.src_port (0:8 @ offset 44)
libbpf: prog 'mb_get_sockopt': relo #4: patched insn #12 (LDX/ST/STX) off 44 -> 44
libbpf: prog 'mb_get_sockopt': relo #5: <byte_off> [25] struct bpf_sock.dst_port (0:9 @ offset 48)
libbpf: prog 'mb_get_sockopt': relo #5: matching candidate #0 <byte_off> [31507] struct bpf_sock.dst_port (0:9 @ offset 48)
libbpf: prog 'mb_get_sockopt': relo #5: patched insn #15 (LDX/ST/STX) off 48 -> 48
libbpf: prog 'mb_get_sockopt': relo #5: patched insn #15 (LDX/ST/STX) mem_sz 4 -> 2
libbpf: prog 'mb_get_sockopt': relo #6: <byte_off> [25] struct bpf_sock.family (0:1 @ offset 4)
libbpf: prog 'mb_get_sockopt': relo #6: matching candidate #0 <byte_off> [31507] struct bpf_sock.family (0:1 @ offset 4)
libbpf: prog 'mb_get_sockopt': relo #6: patched insn #17 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_get_sockopt': relo #7: <byte_off> [25] struct bpf_sock.src_ip4 (0:6 @ offset 24)
libbpf: prog 'mb_get_sockopt': relo #7: matching candidate #0 <byte_off> [31507] struct bpf_sock.src_ip4 (0:6 @ offset 24)
libbpf: prog 'mb_get_sockopt': relo #7: patched insn #19 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_get_sockopt': relo #8: <byte_off> [25] struct bpf_sock.dst_ip4 (0:10 @ offset 52)
libbpf: prog 'mb_get_sockopt': relo #8: matching candidate #0 <byte_off> [31507] struct bpf_sock.dst_ip4 (0:10 @ offset 52)
libbpf: prog 'mb_get_sockopt': relo #8: patched insn #24 (LDX/ST/STX) off 52 -> 52
libbpf: prog 'mb_get_sockopt': relo #9: <byte_off> [16] struct bpf_sockopt.optval_end (0:2:0 @ offset 16)
libbpf: prog 'mb_get_sockopt': relo #9: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.optval_end (0:2:0 @ offset 16)
libbpf: prog 'mb_get_sockopt': relo #9: patched insn #34 (LDX/ST/STX) off 16 -> 16
libbpf: prog 'mb_get_sockopt': relo #10: <byte_off> [16] struct bpf_sockopt.optval (0:1:0 @ offset 8)
libbpf: prog 'mb_get_sockopt': relo #10: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.optval (0:1:0 @ offset 8)
libbpf: prog 'mb_get_sockopt': relo #10: patched insn #35 (LDX/ST/STX) off 8 -> 8
libbpf: prog 'mb_get_sockopt': relo #11: <byte_off> [16] struct bpf_sockopt.optname (0:4 @ offset 28)
libbpf: prog 'mb_get_sockopt': relo #11: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.optname (0:4 @ offset 28)
libbpf: prog 'mb_get_sockopt': relo #11: patched insn #60 (LDX/ST/STX) off 28 -> 28
libbpf: prog 'mb_get_sockopt': relo #12: <byte_off> [16] struct bpf_sockopt.retval (0:6 @ offset 36)
libbpf: prog 'mb_get_sockopt': relo #12: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.retval (0:6 @ offset 36)
libbpf: prog 'mb_get_sockopt': relo #12: patched insn #67 (LDX/ST/STX) off 36 -> 36
libbpf: prog 'mb_get_sockopt': relo #13: <byte_off> [16] struct bpf_sockopt.sk (0:0:0 @ offset 0)
libbpf: prog 'mb_get_sockopt': relo #13: matching candidate #0 <byte_off> [78556] struct bpf_sockopt.sk (0:0:0 @ offset 0)
libbpf: prog 'mb_get_sockopt': relo #13: patched insn #68 (LDX/ST/STX) off 0 -> 0
libbpf: prog 'mb_get_sockopt': relo #14: <byte_off> [25] struct bpf_sock.family (0:1 @ offset 4)
libbpf: prog 'mb_get_sockopt': relo #14: matching candidate #0 <byte_off> [31507] struct bpf_sock.family (0:1 @ offset 4)
libbpf: prog 'mb_get_sockopt': relo #14: patched insn #71 (LDX/ST/STX) off 4 -> 4
libbpf: CO-RE relocating [29] struct sockaddr_in: found target candidate [12732] struct sockaddr_in in [vmlinux]
libbpf: prog 'mb_get_sockopt': relo #15: <byte_off> [29] struct sockaddr_in.sin_family (0:0 @ offset 0)
libbpf: prog 'mb_get_sockopt': relo #15: matching candidate #0 <byte_off> [12732] struct sockaddr_in.sin_family (0:0 @ offset 0)
libbpf: prog 'mb_get_sockopt': relo #15: patched insn #72 (LDX/ST/STX) off 0 -> 0
libbpf: prog 'mb_get_sockopt': relo #16: <byte_off> [29] struct sockaddr_in.sin_port (0:1 @ offset 2)
libbpf: prog 'mb_get_sockopt': relo #16: matching candidate #0 <byte_off> [12732] struct sockaddr_in.sin_port (0:1 @ offset 2)
libbpf: prog 'mb_get_sockopt': relo #16: patched insn #74 (LDX/ST/STX) off 2 -> 2
libbpf: prog 'mb_get_sockopt': relo #17: <byte_off> [29] struct sockaddr_in.sin_addr.s_addr (0:2:0 @ offset 4)
libbpf: prog 'mb_get_sockopt': relo #17: matching candidate #0 <byte_off> [12732] struct sockaddr_in.sin_addr.s_addr (0:2:0 @ offset 4)
libbpf: prog 'mb_get_sockopt': relo #17: patched insn #76 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_get_sockopt': relo #18: <byte_off> [29] struct sockaddr_in.__pad (0:3 @ offset 8)
libbpf: prog 'mb_get_sockopt': relo #18: matching candidate #0 <byte_off> [12732] struct sockaddr_in.__pad (0:3 @ offset 8)
libbpf: prog 'mb_get_sockopt': relo #18: patched insn #77 (ALU/ALU64) imm 8 -> 8
libbpf: prog 'mb_get_sockopt': relo #19: <byte_off> [29] struct sockaddr_in.__pad (0:3 @ offset 8)
libbpf: prog 'mb_get_sockopt': relo #19: matching candidate #0 <byte_off> [12732] struct sockaddr_in.__pad (0:3 @ offset 8)
libbpf: prog 'mb_get_sockopt': relo #19: patched insn #81 (LDX/ST/STX) off 8 -> 8
libbpf: prog 'mb_get_sockopt': pinned at '/sys/fs/bpf/get_sockopts'
#### ENV
cgroup          : /sys/fs/cgroup
bpffs           : /sys/fs/bpf
verbose         : true
####

Running:  /app/bpf/mb_sendmsg --bpffs /sys/fs/bpf --verbose --cgroup /sys/fs/cgroup
libbpf: loading object 'mb_sendmsg_bpf' from buffer
libbpf: elf: section(3) cgroup/sendmsg4, size 752, link 0, flags 6, type=1
libbpf: sec 'cgroup/sendmsg4': found program 'mb_sendmsg4' at insn offset 0 (0 bytes), code size 94 insns (752 bytes)
libbpf: elf: section(4) .relcgroup/sendmsg4, size 16, link 13, flags 40, type=9
libbpf: elf: section(5) .maps, size 40, link 0, flags 3, type=1
libbpf: elf: section(6) .rodata.str1.1, size 40, link 0, flags 32, type=1
libbpf: elf: section(7) license, size 4, link 0, flags 3, type=1
libbpf: license of mb_sendmsg_bpf is GPL
libbpf: elf: section(8) .BTF, size 2353, link 0, flags 0, type=1
libbpf: elf: section(10) .BTF.ext, size 780, link 0, flags 0, type=1
libbpf: elf: section(13) .symtab, size 216, link 1, flags 0, type=2
libbpf: looking for externs among 9 symbols...
libbpf: collected 0 externs total
libbpf: map 'cookie_orig_dst': at sec_idx 5, offset 0.
libbpf: map 'cookie_orig_dst': found type = 9.
libbpf: map 'cookie_orig_dst': found key_size = 8.
libbpf: map 'cookie_orig_dst': found value_size = 24.
libbpf: map 'cookie_orig_dst': found max_entries = 65535.
libbpf: map 'cookie_orig_dst': found pinning = 1.
libbpf: map '.rodata.str1.1' (global data): at sec_idx 6, offset 0, flags 480.
libbpf: map 1 is ".rodata.str1.1"
libbpf: sec '.relcgroup/sendmsg4': collecting relocation for section(3) 'cgroup/sendmsg4'
libbpf: sec '.relcgroup/sendmsg4': relo #0: insn #63 against 'cookie_orig_dst'
libbpf: prog 'mb_sendmsg4': found map 0 (cookie_orig_dst, sec 5, off 0) for insn #63
libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
libbpf: reused pinned map at '/sys/fs/bpf/cookie_orig_dst'
libbpf: map 'cookie_orig_dst': skipping creation (preset fd=5)
libbpf: map '.rodata.str1.1': created successfully, fd=4
libbpf: sec 'cgroup/sendmsg4': found 9 CO-RE relocations
libbpf: CO-RE relocating [16] struct bpf_sock_addr: found target candidate [78549] struct bpf_sock_addr in [vmlinux]
libbpf: prog 'mb_sendmsg4': relo #0: <byte_off> [16] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sendmsg4': relo #0: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sendmsg4': relo #0: patched insn #1 (LDX/ST/STX) off 24 -> 24
libbpf: CO-RE relocating [24] struct bpf_sock_tuple: found target candidate [97737] struct bpf_sock_tuple in [vmlinux]
libbpf: prog 'mb_sendmsg4': relo #1: <byte_off> [24] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sendmsg4': relo #1: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sendmsg4': relo #1: patched insn #13 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_sendmsg4': relo #2: <byte_off> [24] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #2: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #2: patched insn #14 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sendmsg4': relo #3: <byte_off> [24] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sendmsg4': relo #3: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_sendmsg4': relo #3: patched insn #32 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_sendmsg4': relo #4: <byte_off> [24] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #4: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #4: patched insn #34 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sendmsg4': relo #5: <byte_off> [16] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #5: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #5: patched insn #53 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sendmsg4': relo #6: <byte_off> [16] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sendmsg4': relo #6: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sendmsg4': relo #6: patched insn #57 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sendmsg4': relo #7: <byte_off> [16] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sendmsg4': relo #7: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_sendmsg4': relo #7: patched insn #89 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_sendmsg4': relo #8: <byte_off> [16] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #8: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_sendmsg4': relo #8: patched insn #91 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_sendmsg4': pinned at '/sys/fs/bpf/sendmsg'
attaching mb_sendmsg4 program failed with error: -1
#### ENV
cgroup          : /sys/fs/cgroup
bpffs           : /sys/fs/bpf
verbose         : true
####
Running:  /app/bpf/mb_recvmsg --verbose --cgroup /sys/fs/cgroup --bpffs /sys/fs/bpf
libbpf: loading object 'mb_recvmsg_bpf' from buffer
libbpf: elf: section(3) cgroup/recvmsg4, size 616, link 0, flags 6, type=1
libbpf: sec 'cgroup/recvmsg4': found program 'mb_recvmsg4' at insn offset 0 (0 bytes), code size 77 insns (616 bytes)
libbpf: elf: section(4) .relcgroup/recvmsg4, size 16, link 13, flags 40, type=9
libbpf: elf: section(5) .maps, size 40, link 0, flags 3, type=1
libbpf: elf: section(6) .rodata.str1.1, size 29, link 0, flags 32, type=1
libbpf: elf: section(7) license, size 4, link 0, flags 3, type=1
libbpf: license of mb_recvmsg_bpf is GPL
libbpf: elf: section(8) .BTF, size 2149, link 0, flags 0, type=1
libbpf: elf: section(10) .BTF.ext, size 636, link 0, flags 0, type=1
libbpf: elf: section(13) .symtab, size 216, link 1, flags 0, type=2
libbpf: looking for externs among 9 symbols...
libbpf: collected 0 externs total
libbpf: map 'cookie_orig_dst': at sec_idx 5, offset 0.
libbpf: map 'cookie_orig_dst': found type = 9.
libbpf: map 'cookie_orig_dst': found key_size = 8.
libbpf: map 'cookie_orig_dst': found value_size = 24.
libbpf: map 'cookie_orig_dst': found max_entries = 65535.
libbpf: map 'cookie_orig_dst': found pinning = 1.
libbpf: map '.rodata.str1.1' (global data): at sec_idx 6, offset 0, flags 480.
libbpf: map 1 is ".rodata.str1.1"
libbpf: sec '.relcgroup/recvmsg4': collecting relocation for section(3) 'cgroup/recvmsg4'
libbpf: sec '.relcgroup/recvmsg4': relo #0: insn #49 against 'cookie_orig_dst'
libbpf: prog 'mb_recvmsg4': found map 0 (cookie_orig_dst, sec 5, off 0) for insn #49
libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
libbpf: reused pinned map at '/sys/fs/bpf/cookie_orig_dst'
libbpf: map 'cookie_orig_dst': skipping creation (preset fd=5)
libbpf: map '.rodata.str1.1': created successfully, fd=4
libbpf: sec 'cgroup/recvmsg4': found 7 CO-RE relocations
libbpf: CO-RE relocating [16] struct bpf_sock_addr: found target candidate [78549] struct bpf_sock_addr in [vmlinux]
libbpf: prog 'mb_recvmsg4': relo #0: <byte_off> [16] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_recvmsg4': relo #0: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_recvmsg4': relo #0: patched insn #1 (LDX/ST/STX) off 24 -> 24
libbpf: CO-RE relocating [24] struct bpf_sock_tuple: found target candidate [97737] struct bpf_sock_tuple in [vmlinux]
libbpf: prog 'mb_recvmsg4': relo #1: <byte_off> [24] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_recvmsg4': relo #1: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_recvmsg4': relo #1: patched insn #13 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_recvmsg4': relo #2: <byte_off> [24] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_recvmsg4': relo #2: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_recvmsg4': relo #2: patched insn #14 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_recvmsg4': relo #3: <byte_off> [24] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_recvmsg4': relo #3: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.dport (0:0:0:3 @ offset 10)
libbpf: prog 'mb_recvmsg4': relo #3: patched insn #32 (LDX/ST/STX) off 10 -> 10
libbpf: prog 'mb_recvmsg4': relo #4: <byte_off> [24] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_recvmsg4': relo #4: matching candidate #0 <byte_off> [97737] struct bpf_sock_tuple.ipv4.daddr (0:0:0:1 @ offset 4)
libbpf: prog 'mb_recvmsg4': relo #4: patched insn #34 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_recvmsg4': relo #5: <byte_off> [16] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_recvmsg4': relo #5: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_port (0:3 @ offset 24)
libbpf: prog 'mb_recvmsg4': relo #5: patched insn #54 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_recvmsg4': relo #6: <byte_off> [16] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_recvmsg4': relo #6: matching candidate #0 <byte_off> [78549] struct bpf_sock_addr.user_ip4 (0:1 @ offset 4)
libbpf: prog 'mb_recvmsg4': relo #6: patched insn #56 (LDX/ST/STX) off 4 -> 4
libbpf: prog 'mb_recvmsg4': pinned at '/sys/fs/bpf/recvmsg'
attaching mb_recvmsg4 program failed with error: -1
#### ENV
cgroup          : /sys/fs/cgroup
bpffs           : /sys/fs/bpf
verbose         : true
####
Running:  /app/bpf/mb_redir --bpffs /sys/fs/bpf --verbose
libbpf: loading object 'mb_redir_bpf' from buffer
libbpf: elf: section(3) sk_msg, size 232, link 0, flags 6, type=1
libbpf: sec 'sk_msg': found program 'mb_msg_redir' at insn offset 0 (0 bytes), code size 29 insns (232 bytes)
libbpf: elf: section(4) .relsk_msg, size 16, link 12, flags 40, type=9
libbpf: elf: section(5) .maps, size 40, link 0, flags 3, type=1
libbpf: elf: section(6) license, size 4, link 0, flags 3, type=1
libbpf: license of mb_redir_bpf is GPL
libbpf: elf: section(7) .BTF, size 1539, link 0, flags 0, type=1
libbpf: elf: section(9) .BTF.ext, size 428, link 0, flags 0, type=1
libbpf: elf: section(12) .symtab, size 144, link 1, flags 0, type=2
libbpf: looking for externs among 6 symbols...
libbpf: collected 0 externs total
libbpf: map 'sock_pair_map': at sec_idx 5, offset 0.
libbpf: map 'sock_pair_map': found type = 18.
libbpf: map 'sock_pair_map': found key_size = 36.
libbpf: map 'sock_pair_map': found value_size = 4.
libbpf: map 'sock_pair_map': found max_entries = 65535.
libbpf: map 'sock_pair_map': found pinning = 1.
libbpf: sec '.relsk_msg': collecting relocation for section(3) 'sk_msg'
libbpf: sec '.relsk_msg': relo #0: insn #23 against 'sock_pair_map'
libbpf: prog 'mb_msg_redir': found map 0 (sock_pair_map, sec 5, off 0) for insn #23
libbpf: loading kernel BTF '/sys/kernel/btf/vmlinux': 0
libbpf: reused pinned map at '/sys/fs/bpf/sock_pair_map'
libbpf: map 'sock_pair_map': skipping creation (preset fd=5)
libbpf: sec 'sk_msg': found 5 CO-RE relocations
libbpf: CO-RE relocating [16] struct sk_msg_md: found target candidate [78546] struct sk_msg_md in [vmlinux]
libbpf: prog 'mb_msg_redir': relo #0: <byte_off> [16] struct sk_msg_md.local_port (0:8 @ offset 64)
libbpf: prog 'mb_msg_redir': relo #0: matching candidate #0 <byte_off> [78546] struct sk_msg_md.local_port (0:8 @ offset 64)
libbpf: prog 'mb_msg_redir': relo #0: patched insn #5 (LDX/ST/STX) off 64 -> 64
libbpf: prog 'mb_msg_redir': relo #1: <byte_off> [16] struct sk_msg_md.remote_port (0:7 @ offset 60)
libbpf: prog 'mb_msg_redir': relo #1: matching candidate #0 <byte_off> [78546] struct sk_msg_md.remote_port (0:7 @ offset 60)
libbpf: prog 'mb_msg_redir': relo #1: patched insn #8 (LDX/ST/STX) off 60 -> 60
libbpf: prog 'mb_msg_redir': relo #2: <byte_off> [16] struct sk_msg_md.family (0:2 @ offset 16)
libbpf: prog 'mb_msg_redir': relo #2: matching candidate #0 <byte_off> [78546] struct sk_msg_md.family (0:2 @ offset 16)
libbpf: prog 'mb_msg_redir': relo #2: patched insn #11 (LDX/ST/STX) off 16 -> 16
libbpf: prog 'mb_msg_redir': relo #3: <byte_off> [16] struct sk_msg_md.local_ip4 (0:4 @ offset 24)
libbpf: prog 'mb_msg_redir': relo #3: matching candidate #0 <byte_off> [78546] struct sk_msg_md.local_ip4 (0:4 @ offset 24)
libbpf: prog 'mb_msg_redir': relo #3: patched insn #13 (LDX/ST/STX) off 24 -> 24
libbpf: prog 'mb_msg_redir': relo #4: <byte_off> [16] struct sk_msg_md.remote_ip4 (0:3 @ offset 20)
libbpf: prog 'mb_msg_redir': relo #4: matching candidate #0 <byte_off> [78546] struct sk_msg_md.remote_ip4 (0:3 @ offset 20)
libbpf: prog 'mb_msg_redir': relo #4: patched insn #17 (LDX/ST/STX) off 20 -> 20
libbpf: prog 'mb_msg_redir': pinned at '/sys/fs/bpf/redir'
#### ENV
bpffs           : /sys/fs/bpf
verbose         : true
####

Error: failed to load ebpf programs: loading and attaching ebpf programs failed:
    unexpected exit code: 255, err: exit status 255
    unexpected exit code: 255, err: exit status 255
    unexpected exit code: 255, err: exit status 255
Usage:
  mbctl [flags]

Flags:
      --cni-bin-dir string      /opt/cni/bin mount path (default "/host/opt/cni/bin")
      --cni-config-dir string   /etc/cni/net.d mount path (default "/host/etc/cni/net.d")
      --cni-mode                Enable Merbridge CNI plugin
  -d, --debug                   Debug mode
      --enable-hot-restart      enable hot restart
  -h, --help                    help for mbctl
      --host-proc string        /proc mount path (default "/host/proc")
      --host-var-run string     /var/run mount path (default "/host/var/run")
  -k, --kind                    Enable when Kubernetes is running in Kind
      --kubeconfig string       Kubernetes configuration file
      --kubecontext string      The name of the kube config context to use
  -m, --mode string             Service mesh mode, current support istio, linkerd and kuma (default "istio")
  -r, --use-reconnect           Use re-connect mode for same-node acceleration (default true)

I think volumes and mount paths are wrong in some environments (e.g. KubeSpray)

Cilium Volumes:

Volumes:
  cilium-run:
    Type:          HostPath (bare host directory volume)
    Path:          /var/run/cilium
    HostPathType:  DirectoryOrCreate
  bpf-maps:
    Type:          HostPath (bare host directory volume)
    Path:          /sys/fs/bpf
    HostPathType:  DirectoryOrCreate
  hostproc:
    Type:          HostPath (bare host directory volume)
    Path:          /proc
    HostPathType:  Directory
  cilium-cgroup:
    Type:          HostPath (bare host directory volume)
    Path:          /run/cilium/cgroupv2
    HostPathType:  DirectoryOrCreate
  cni-path:
    Type:          HostPath (bare host directory volume)
    Path:          /opt/cni/bin
    HostPathType:  DirectoryOrCreate
  etc-cni-netd:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/cni/net.d
    HostPathType:  DirectoryOrCreate
  lib-modules:
    Type:          HostPath (bare host directory volume)
    Path:          /lib/modules
    HostPathType:  
  xtables-lock:
    Type:          HostPath (bare host directory volume)
    Path:          /run/xtables.lock
    HostPathType:  FileOrCreate
  etcd-config-path:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      cilium-config
    Optional:  false
  etcd-secrets:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/cilium/certs
    HostPathType:  
  clustermesh-secrets:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  cilium-clustermesh
    Optional:    true
  cilium-config-path:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      cilium-config
    Optional:  false

Cilium Volume Mounts:

      /etc/cilium/certs from etcd-secrets (ro)
      /host/etc/cni/net.d from etc-cni-netd (rw)
      /lib/modules from lib-modules (ro)
      /run/xtables.lock from xtables-lock (rw)
      /sys/fs/bpf from bpf-maps (rw)
      /tmp/cilium/config-map from cilium-config-path (ro)
      /var/lib/cilium/clustermesh from clustermesh-secrets (ro)
      /var/lib/cilium/tls/hubble from hubble-tls (ro)
      /var/lib/etcd-config from etcd-config-path (ro)
      /var/run/cilium from cilium-run (rw)
jakubdyszkiewicz commented 7 months ago

Triage: what's the host OS/kernel version?

mhkarimi1383 commented 7 months ago

@jakubdyszkiewicz

OS: Debian GNU/Linux 12 (bookworm) Kernel: 6.1.0-18-amd64 Container Runtime: containerd://1.7.13 K8s: v1.28.6

mhkarimi1383 commented 7 months ago

I can supply my Cilium CNI variables/configs if needed

lukidzi commented 7 months ago

Could you provide Cilium CNI config? Also, did you set up it on some cloud-provided cluster(aws,azure,gke..) or by yourself(k3d/self-managed k8s/kind)?

mhkarimi1383 commented 7 months ago

Sure,

cilium_version: "v1.15.3"

cilium_debug: false

cilium_enable_ipv4: true
cilium_enable_ipv6: false

cilium_enable_bandwidth_manager: true

# Overlay Network Mode
cilium_tunnel_mode: "vxlan"

cilium_enable_prometheus: true
cilium_kube_proxy_replacement: strict
cilium_cluster_id: 1

cilium_native_routing_cidr: "10.0.0.0/8"

# cilium_encryption_enabled: false

cilium_enable_hubble: true
cilium_enable_hubble_metrics: true
cilium_hubble_metrics:
  - dns
  - drop
  - tcp
  - flow
  - icmp
  - http
cilium_hubble_install: true
cilium_hubble_tls_generate: true

cilium_operator_replicas: 2

cilium_config_extra_vars:
  bpf-lb-sock-hostns-only: "true"

cilium_cluster_name: cluster-01

cilium_enable_ipv4_masquerade: true
cilium_enable_bpf_masquerade: true
cilium_enable_well_known_identities: true

I have my own private network and my cluster is installed using KubeSpray (Kubeadm) on my own Network/Hardware

lukidzi commented 7 months ago

I've managed to setup everything https://gist.github.com/lukidzi/c078c1b2be8d1cb0cfab4f28de51846c I couldn't start a cluster with your cilium setup because my CoreDNS on the worker node didn't start.

I didn't have the same issue but noticed other things

  1. OOM, I had to increase kuma-cni memory to 400m to not crash anymore
  2. Some strange logs in kuma-cni
    β”‚ time="2024-04-11T15:46:59Z" level=info msg="CNI config file /host/etc/cni/net.d/05-cilium.conflist exists. Proceeding." func="cni-server.getCNIConfigFilepath()" file="install.go:310"                                             β”‚
    β”‚ time="2024-04-11T15:46:59Z" level=info msg="Created CNI config /host/etc/cni/net.d/05-cilium.conflist" func="cni-server.writeCNIConfig()" file="install.go:267"                                                                    β”‚
    β”‚ time="2024-04-11T15:46:59Z" level=info msg="Restarting Merbridge CNI installer..." func="cni-server.(*Installer).Run()" file="install.go:113"                                                                                      β”‚
    β”‚ time="2024-04-11T15:47:00Z" level=info msg="Copied /app/merbridge-cni to /host/opt/cni/bin." func="cni-server.copyBinaries()" file="install.go:363"                                                                                β”‚
    β”‚ time="2024-04-11T15:47:00Z" level=info msg="write kubeconfig file /host/etc/cni/net.d/ZZZ-merbridge-cni-kubeconfig with: \n# Kubeconfig file for Merbridge CNI plugin.\napiVersion: v1\nkind: Config\nclusters:\n- name: local\n   β”‚
    β”‚ cluster:\n    server: https://[10.233.0.1]:443\n    insecure-skip-tls-verify: true\nusers:\n- name: merbridge-cni\n  user:\n    token: \"&lt;redacted&gt;\"\ncontexts:\n- name: merbridge-cni-context\n  context:\n    cluster: lo β”‚
    β”‚ cal\n    user: merbridge-cni\ncurrent-context: merbridge-cni-context\n" func="cni-server.createKubeconfigFile()" file="install.go:453"                                                                                             β”‚
    β”‚ time="2024-04-11T15:47:00Z" level=info msg="CNI config file /host/etc/cni/net.d/05-cilium.conflist exists. Proceeding." func="cni-server.getCNIConfigFilepath()" file="install.go:310"                                             β”‚
    β”‚ time="2024-04-11T15:47:00Z" level=info msg="Created CNI config /host/etc/cni/net.d/05-cilium.conflist" func="cni-server.writeCNIConfig()" file="install.go:267"                                                                    β”‚
    β”‚ time="2024-04-11T15:47:00Z" level=info msg="Restarting Merbridge CNI installer..." func="cni-server.(*Installer).Run()" file="install.go:113"                                                                                      β”‚
    β”‚ time="2024-04-11T15:47:01Z" level=info msg="Copied /app/merbridge-cni to /host/opt/cni/bin." func="cni-server.copyBinaries()" file="install.go:363"                                                                                β”‚
    β”‚ time="2024-04-11T15:47:01Z" level=info msg="write kubeconfig file /host/etc/cni/net.d/ZZZ-merbridge-cni-kubeconfig with: \n# Kubeconfig file for Merbridge CNI plugin.\napiVersion: v1\nkind: Config\nclusters:\n- name: local\n   β”‚
    β”‚ cluster:\n    server: https://[10.233.0.1]:443\n    insecure-skip-tls-verify: true\nusers:\n- name: merbridge-cni\n  user:\n    token: \"&lt;redacted&gt;\"\ncontexts:\n- name: merbridge-cni-context\n  context:\n    cluster: lo β”‚
    β”‚ cal\n    user: merbridge-cni\ncurrent-context: merbridge-cni-context\n" func="cni-server.createKubeconfigFile()" file="install.go:453"                                                                                             β”‚
    β”‚ time="2024-04-11T15:47:01Z" level=info msg="CNI config file /host/etc/cni/net.d/05-cilium.conflist exists. Proceeding." func="cni-server.getCNIConfigFilepath()" file="install.go:310"                                             β”‚
    β”‚ time="2024-04-11T15:47:01Z" level=info msg="Created CNI config /host/etc/cni/net.d/05-cilium.conflist" func="cni-server.writeCNIConfig()" file="install.go:267"                                                                    β”‚
    β”‚ time="2024-04-11T15:47:01Z" level=info msg="Invalid configuration. merbridge CNI config removed from CNI config file: /host/etc/cni/net.d/05-cilium.conflist" func="cni-server.sleepCheckInstall()" file="install.go:332"

    apart from logs traffic seems to work

I've also created GKE cluster 1.28.7 with V2 network policy which uses Cilium and it works. Not a Cilium config expert maybe something is wrong with this configuration :/

For sure we need to review some error messages and verify how it works now.

mhkarimi1383 commented 7 months ago

@lukidzi Hi Thanks a lot for your work But I think some of my configs in cilium are not present in your configs

Also I have noticed that IP of the service is in a bigger range than K8s IPAM Range, can you also set?

cilium_ipam_mode: kubernetes

I think something could be wrong with my other variables, like

cilium_config_extra_vars:
  bpf-lb-sock-hostns-only: "true"
mhkarimi1383 commented 7 months ago

I mean when using cilium's native ipam mode, It will use cilium_native_routing_cidr, Also can you try disabling GCloud integration with Kubespray (if enabled)?

lukidzi commented 7 months ago

I am not a cilium specialist but with your configuration, my coreDNS couldn't start. There was a loop in a config and after fixing it I couldn't connect to the Kubernetes control-plane. To start everything I've used the official guide from the repository. I can't try all the cases because don't have access to the bare machine. I noticed that some things in ebpf require reviewing:

I mean when using cilium's native ipam mode, It will use cilium_native_routing_cidr, Also can you try disabling GCloud integration with Kubespray (if enabled)?

I think it's not enabled by default I've used

mhkarimi1383 commented 7 months ago

Tomorrow I will share my entire inventory (with sensitive data masked) with steps to run the cluster

mhkarimi1383 commented 7 months ago

@lukidzi

Hi, Sorry for being late, here is my entire kubespray inventory runnning run.sh script will bring up the cluster, before running that ensure PRIVATEKEY_PATH variable in prep.sh is correct and servers information are correct in inventory/inventory.ini

kubespray.zip

mhkarimi1383 commented 6 months ago

@lukidzi Any updates?

lukidzi commented 4 months ago

Thank you for all the information, @mhkarimi1383. It seems this issue is more related to your configuration. We have accepted it because we believe that the documentation and some updates are required in these areas. We welcome and appreciate contributions from the community, so if you’re interested in helping out, we’d be grateful for your support.

mhkarimi1383 commented 4 months ago

@lukidzi Hi thanks I'm appropriated to contribute but can you give me steps to debug and find out where is the problem in my configurations

github-actions[bot] commented 1 month ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.