ubpf icon indicating copy to clipboard operation
ubpf copied to clipboard

Interest in verifier passes?

Open jpsamaroo opened this issue 5 years ago • 3 comments

I'm interested in adding support to ubpf for verifier passes that are similar in purpose to what the kernel has. My primary question is: are these passes desired? If so, should they be optional, and should they be the default?

Secondarily, what kinds of passes should we start with? I've already developed a pass to detect unreachable instructions and a pass to detect loops which work decently well on simple examples; I'd be happy to send these upstream for review.

jpsamaroo avatar Oct 27 '20 23:10 jpsamaroo

Maybe re-use an existing verifier: eBPF verifier

Alan-Jowett avatar Jan 05 '21 18:01 Alan-Jowett

ebpf-verifier is C++ (and a lot of it), and has non-trivial dependencies like gmp and boost. I think ubpf could pretty easily implement much of the same functionality (including some basic abstract interpretation) in simple C without bloating the codebase or adding dependencies.

jpsamaroo avatar Jan 06 '21 16:01 jpsamaroo

I'm interested in adding support to ubpf for verifier passes that are similar in purpose to what the kernel has. My primary question is: are these passes desired?

Yeah, definitely!

If so, should they be optional, and should they be the default?

I think verifier passes should be opt-in, at least at first. Once they are stable/complete enough, we can consider making them opt-out.

Secondarily, what kinds of passes should we start with? I've already developed a pass to detect unreachable instructions and a pass to detect loops which work decently well on simple examples; I'd be happy to send these upstream for review.

I'd start with the easiest first, but that's really up to you. Detecting dead code and loops can be a good start as we could then take that for granted in other passes.

pchaigno avatar Jan 19 '21 17:01 pchaigno