Mod note: Normally this would fit well within my "small project" criteria, however I'm going to use a rare executive call here to let this go to the front page, because I think there's also an entire interesting conversation to be had on the utility of this approach, whether it has any use cases, costs/benefits, etc., that is, a general discussion of the utility of Go in a kernel rather than necessarily this project specifically.
WARN: There's no such thing as a perfectly sandboxed environment (gestures broadly to this past week year). caveat emptor.
With that out of the way, eBPF gives you access to the kernel space without having to write an entire kernel module while providing additional tooling to help the developer help themself like extra verification that your program will remain within its sandboxed environment, helper functions, an entire library of data types for working with storage: bpf maps, and more.
As u/cookieengineer suggested, Cilium's go-ebpf is the icing on the cake, allowing these programs to be written in Go and compiled down to C and subsequently loaded.
77
u/jerf 2d ago
Mod note: Normally this would fit well within my "small project" criteria, however I'm going to use a rare executive call here to let this go to the front page, because I think there's also an entire interesting conversation to be had on the utility of this approach, whether it has any use cases, costs/benefits, etc., that is, a general discussion of the utility of Go in a kernel rather than necessarily this project specifically.
14
u/m33-m33 2d ago
As en experiment, or homelab IOT it could be fun.
1
u/ianchen0119 13h ago
This is awesome. Now do eBPF in Go