Re:eBPF will help solve service mesh by getting rid of sidecars
by tptacek on Thursday December 09, 2021 @10:48AM
(#29498723)
The complexity is an issue (but sidecars are plenty complex too), but the security not so much. BPF C is incredibly limiting (you can't even have loops if the verifier can't prove to its satisfaction that the loop has a low static bound). It's nothing at all like writing kernel C.
[ Parent
| on HN ]
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++.
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!)