Live data from Hacker News

eBPF – The Future of Networking and Security

cilium.io

21–30 of 38 posts

Re: eBPF – The Future of Networking and Security

#21

The future ought to be capabilities. All this policy scripting stuff is just drudgery make-work that gets us nowhere.

Can you provide more context on why you feel that's true (or even possible)?

For the last few years, I managed the Container Runtime group at Facebook. My experience has been:

1. `if (has_capability(..., X)) { ... }` gets put into code pretty haphazardly in a way that's not necessarily super well structured. Once it's there, it's ABI, and you're screwed if you want to iterate on it. That's why cap_sys_admin is /almost/ root.

2. If you wanted to do the right thing from the jump (e.g. for bpf itself), you'd have to add a new capability. This is a heavy lift for something that might not actually get any traction. It requires changing a bunch of common tools, and you likely end up breaking a bunch of applications.

3. Debugging capability failures is a pain in the ass. We ended up building and deploying capability tracing infrastructure just to figure out what people are actually using.

4. For gradual roll outs of enforcement/changes, you need the flexibility to warn first, enforce second. We did large scale monitoring of all such changes to make sure we didn't break the workloads.

5. Even if you nail all of the above, the ability to make finer-than-capability-grained decisions (i.e. binding to port 20 or 80 is okay but not port 22) is really valuable.

I'm all for kernel abstractions that just work and solve all problems for all people, but I think the overwhelming trend has been towards kernel interfaces that provide a lot of flexibility and then more opinionated libraries/tools that kind of let us have our cake and eat it to (io_uring => liburing, bpf => libbpf, btrfs => btrfstools).

Re: eBPF – The Future of Networking and Security

#22
post #16
post #11

Earlier quoted context omitted.

BPF wasn't originally conceived of as a reference monitor or ACL system; in fact, originally, it was believed that operating systems would use BPF-style packet filters to do pretty much all their demuxing.

AFAIK BPF wasn’t conceived as anything security-related, it was just an optimization.

From the article:

Buggy kernel code will crash your machine. The kernel is not protected from a buggy kernel module. I think people assumed that this is just how things are; that's the price to do kernel programming. eBPF changed this dogma. It brought safety to kernel programming.

"It brought safety to kernel programming" , if you use eBPF and don't expose bugs in the parser, or checking or validation systems. (These have already happened).

Re: eBPF – The Future of Networking and Security

#23
post #16

Earlier quoted context omitted.

AFAIK BPF wasn’t conceived as anything security-related, it was just an optimization.

From the article: Buggy kernel code will crash your machine. The kernel is not protected from a buggy kernel module. I think people assumed that this is just how things are; that's the price to do kernel programming. eBPF changed this dogma. It brought safety to kernel programming. "It brought safety to kernel programming" , if you use eBPF and don't expose bugs in the parser, or checking or validation systems. (Thes…

He means security in the sense of adding new security controls to Linux. Yes, the core idea of BPF (e- or otherwise) is that the code can be verified not to harm the kernel.

Re: eBPF – The Future of Networking and Security

#24
post #6

Earlier quoted context omitted.

Even looking at the original BPF which focused on filtering packets as they are forwarded to userspace (think tcpdump)[1] and looking at the extensions that eBPF provides on top to hook into various subsystems[2,3], it's clear that this is going far beyond the use cases originally envisioned. I'd love to see an eBPF paper to follow up / contrast with the '93 USENIX BPF paper. [1]: https://www.tcpdump.org/papers/bpf-u…

FWIW: I just wrote a long-ish post on the history from BPF (and before BPF) to eBPF and XDP: https://fly.io/blog/bpf-xdp-packet-filters-and-udp/ An interesting fact is that packet filtering as a problem domain has been dominated by in-kernel virtual machines going back into the 1980s; it's an idea that comes all the way from Xerox.

Need to know what's type of water the people at Xerox Palo Alto were drinking.

They pioneered many groundbreaking and game changing works on computing including (but not limited to) windowing desktop environment, integrated programming/structural editor with CEDAR/Tioga, SQL (team moved to Oracle), Ethernet networks, laser printer, VLSI and Jupiter operational transform for distributed computing (precursor to CRDT). Each of this technology is now an industry of its own.

Re: eBPF – The Future of Networking and Security

#25

The future ought to be capabilities. All this policy scripting stuff is just drudgery make-work that gets us nowhere.

Can you provide more context on why you feel that's true (or even possible)? For the last few years, I managed the Container Runtime group at Facebook. My experience has been: 1. `if (has_capability(..., X)) { ... }` gets put into code pretty haphazardly in a way that's not necessarily super well structured. Once it's there, it's ABI, and you're screwed if you want to iterate on it. That's why cap_sys_admin is /almos…

Are we talking about POSIX capabilities or object capabilities?

Re: eBPF – The Future of Networking and Security

#26
post #6

Earlier quoted context omitted.

FWIW: I just wrote a long-ish post on the history from BPF (and before BPF) to eBPF and XDP: https://fly.io/blog/bpf-xdp-packet-filters-and-udp/ An interesting fact is that packet filtering as a problem domain has been dominated by in-kernel virtual machines going back into the 1980s; it's an idea that comes all the way from Xerox.

Need to know what's type of water the people at Xerox Palo Alto were drinking. They pioneered many groundbreaking and game changing works on computing including (but not limited to) windowing desktop environment, integrated programming/structural editor with CEDAR/Tioga, SQL (team moved to Oracle), Ethernet networks, laser printer, VLSI and Jupiter operational transform for distributed computing (precursor to CRDT).…

I kinda feel like Dealers of Lightning should be required reading at this point[1], both for the breadth of invention and how they squandered it.

[1] https://www.amazon.com/Dealers-Lightning-Xerox-PARC-Computer...

Re: eBPF – The Future of Networking and Security

#27
post #15
post #10

Earlier quoted context omitted.

Disagree (see sibling post). Classic BPF could have been translated into any virtual machine design they came up with (because classic BPF is incredibly simple). When McCanne came up with the same design in 1998, his team called it "BPF+", for the same reason eBPF is called eBPF --- because it is pretty much an evolution of the earlier idea.

I'm not going to argue with you. You can read up on initial naming and framing in slides of netconf and plumbers conferences as well as LKML archives.

Remember when Microsoft claimed to invent various computing technologies, even though they had been around since the 70s or earlier?

That’s the type of history you’re articulating here.

Re: eBPF – The Future of Networking and Security

#28
post #27
post #15

Earlier quoted context omitted.

I'm not going to argue with you. You can read up on initial naming and framing in slides of netconf and plumbers conferences as well as LKML archives.

Remember when Microsoft claimed to invent various computing technologies, even though they had been around since the 70s or earlier? That’s the type of history you’re articulating here.

To be clear: the dispute over the history of BPF/eBPF is not interesting, and I don't want to litigate it anymore than they do.

I'm just here to say that eBPF and BPF are in fact pretty closely related. The eBPF design is uncannily similar to Begel, McCanne, and Graham's BPF+ design[1]; in particular, the BPF+ paper spends a fair amount of time describing an SSA-based compiler for a RISC-y register ISA, and eBPF... just uses (at this point) LLVM for a RISC-y register ISA.

Most notably, the fundamental execution integrity model has, until pretty recently, remained the same --- forward jumps only, limited program size. And that's to me the defining feature of the architecture.

The lineage isn't important to me, so much as the sort of continuous unbroken line from BPF to eBPF, regardless of what LKML says.

[1]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.597...

Re: eBPF – The Future of Networking and Security

#29

eBPF is also used high throughput blockchain, Solana https://github.com/solana-labs/rbpf Unlike more common Rust + LLVM + WASM toolchain, Solana smart contracts use Rust + LLVM + eBPF.

Solana uses a custom Rust re-implementation of a custom C re-implementation of the Linux BPF VM for what appears to be licensing reasons. Notably, it's jitting all bytecode without a verifier or emitting runtime bounds checks[0]. I suspect you can pop a shell on every single computer on their testnet somewhere between "trivially" and "extremely trivially".

They appear to be running some kind of "open security test"[1] but are only paying out their own imaginary funny money. I'd suggest you run for the hills as fast as you can instead of considering Solana.

0: https://github.com/solana-labs/rbpf/blob/f7007d6ae8728e61401... 1: https://forums.solana.com/t/tour-de-sol-stage-1-details/317

Re: eBPF – The Future of Networking and Security

#30

The future ought to be capabilities. All this policy scripting stuff is just drudgery make-work that gets us nowhere.

Can you provide more context on why you feel that's true (or even possible)? For the last few years, I managed the Container Runtime group at Facebook. My experience has been: 1. `if (has_capability(..., X)) { ... }` gets put into code pretty haphazardly in a way that's not necessarily super well structured. Once it's there, it's ABI, and you're screwed if you want to iterate on it. That's why cap_sys_admin is /almos…

What POSIX and the linux kernel calls "capabilities" unfortunately result in quite a bit of confusion, which I believe is the cause of your post. POSIX capabilities bear little resemblance to actual capability based security (where a capability is a send/recv-able token that references an object and a set of rights for interacting with that object).
Post reply on HN