cilium / ebpf

ebpf-go is a pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.

Home Page:https://ebpf-go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for cgroup unix socket address hooks

slayerjain opened this issue · comments

Support for unix socketse have been added and released with linux kernel v6.7 and it would be nice to have it in cillium too.

ref: torvalds/linux@8b3cba9

Hi @slayerjain, please do you have any examples of programs (using the cgroup Unix socket hook) where you encountered failures in loading or performing operations with cilium/ebpf? I've created a sample program based on the kernel's self-tests, and it appears to load correctly. https://github.com/torvalds/linux/blob/712e14250dd2907346617eba275c46f53db8fae7/tools/testing/selftests/bpf/progs/connect_unix_prog.c#L14

@kwakubiney Are you sure? A new cgroup hook generally means we need to add a new attach type. The sys.BPF_CGROUP_UNIX_* constants have already been synced into our internal sys/ package, but there's no section prefix matcher in elf_sections.go for it yet. If loading succeeds, that may be a bug.

IIRC, it loaded normally. I'll dust off the test I made and confirm @ti-mo

@ti-mo There are corresponding section prefixes in elf_sections.go introduced by this commit : c6b5844