by nickysielicki · 1y ago · 0 comments
Ask an LLM to write a simple ebpf program which kills any program with a specific name/path. Even crappy local models can handle this with ease.
If you’re talking about more complicated map-based programs, you’re probably right that it will struggle a bit, but it will still figure it out. The eBPF api is not very different than any other C api at the end of the day. It will do fine without the standard library, if you ask it to.
The issue here is the static formal validation the kernel does before loading your eBPF program.
(Even humans don't really know how it works. You need to use specific byte width types and access memory in specific patterns or the validation will fail.)
1. If you meant XDP, you should have said XDP, not eBPF.
2. The kernel does that validation on all ebpf code that it loads, regardless of whether XDP is involved.
3. Humans know how it works.