News for hackers. Stuff that matters.
Re:eBPF will help solve service mesh by getting rid of sidecars by the_duke on Thursday December 09, 2021 @11:54AM (#29499763)
You don't have to use C.

There are two projects that enable writing eBPF with Rust [1][2]. I'm sure there is an equivalent with nicer wrappers for C++.

[1] https://github.com/foniod/redbpf

[2] https://github.com/aya-rs/aya

Re:eBPF will help solve service mesh by getting rid of sidecars by tptacek on Thursday December 09, 2021 @01:25PM (#29501018)
It doesn't make any difference which language you use; the security promises are coming from the verifier, which is analyzing the CFG of the compiled program. C is what most people use, since the underlying APIs are in C, and since the verifier is so limiting that most high-level constructions are off the table.
Re:eBPF will help solve service mesh by getting rid of sidecars by the_duke on Thursday December 09, 2021 @03:52PM (#29502780)
Sure, I was not implying that Rust would have any security benefits fir eBPF.

Just that you can even write eBPF code in more convenient languages.

Re:eBPF will help solve service mesh by getting rid of sidecars by tptacek on Thursday December 09, 2021 @04:23PM (#29503130)
This has come up here a bunch of times (we do a lot of work in Rust). I've been a little skeptical that Rust is a win here, for basically the reason I gave upthread: you can't really do much with Rust in eBPF, because the verifier won't let you; it seems to me like you'd be writing a dialect of Rust-shaped C. But we did a recent work sample challenge for Rust candidates that included an eBPF component, and a couple good submissions used Rust eBPF, so maybe I'm wrong about that.

I'm also biased because I love writing C code (I know, both viscerally and intellectually, that I should virtually never do so; eBPF is the one sane exception!)