News for hackers. Stuff that matters.
Re:Notes on BPF and eBPF by xyzzy_plugh on Sunday January 02, 2022 @06:04PM (#29775092)
I've crashed multiple kernels with eBPF programs. I don't buy this argument at all.
Re:Notes on BPF and eBPF by zokula on Sunday January 02, 2022 @08:13PM (#29776151)
I call bullshit! Ebpf programs cannot crash the kernel since they cannot be run if they contain bugs in the first place.
Re:Notes on BPF and eBPF by xyzzy_plugh on Sunday January 02, 2022 @11:25PM (#29777323)
The kernel, however, can and does have bugs. I've seen several thousand hosts get taken down with a perfectly correct eBPF program due to a buggy kernel.
Re:Notes on BPF and eBPF by daenz on Sunday January 02, 2022 @08:31PM (#29776274)
That assumes that the virtual machine has no bugs
Re:Notes on BPF and eBPF by tptacek on Sunday January 02, 2022 @08:38PM (#29776330)
Not so much (eBPF VM bugs are pretty rare, as you'd expect, since the VM is very simple) --- you're much more likely to run into bugs in the C-code helpers the kernel exports. If you're malicious, you can also hit verifier bugs that'll give your eBPF code raw pointers, but I don't think you're likely to stumble on them accidentally.
Re:Notes on BPF and eBPF by stormbrew on Sunday January 02, 2022 @07:28PM (#29775783)
I said 'less' rather than 'at all' for a reason. I'm not really sure what to tell you if you disagree that it's a lot easier to accidentally crash your kernel with a from-scratch module than ebpf though. That's an experience pretty drastically at odds with mine.
Re:Notes on BPF and eBPF by tptacek on Sunday January 02, 2022 @08:37PM (#29776324)
Can you describe some of those bugs? What helpers were you using? I've been doing bonkers stuff with eBPF for the last year and, while I've definitely had bugs, none of them took my kernel down.
Re:Notes on BPF and eBPF by xyzzy_plugh on Sunday January 02, 2022 @11:21PM (#29777302)
I no longer have access to the code, and the kernel has since been patched. Mostly doing some observability around new network connections.

We definitely hit this one at some point: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1763454

We also ran into a couple of similar but unrelated panic bugs on much newer kernels on non-Ubuntu distros.

Re:Notes on BPF and eBPF by roblabla on Sunday January 02, 2022 @07:15PM (#29775688)
Those would be considered kernel bugs though, and should be getting fixed when reported. While a crash in a kernel module is just a bug in the kernel module itself
Re:Notes on BPF and eBPF by justicezyx on Saturday January 08, 2022 @03:10PM (#29855653)
Could you share the ebpf program and the external dependencies that can reproduce the crash?

It'll be valuable to learn this, so that we might be able to proactively address them. Ebpf is the core of our product.