Conversation

Jarkko Sakkinen

Edited 5 days ago
Do rustc eBPF branches unroll loops if they have const limit known by compiler?

I'm just thinking of theory of running tpm2_protocol inside eBPF filter i.e., is it possible and how much effort it would take it realize.

would be just a cool demo

it has lot of characteristics i.e. no-alloc (fully in-stack) and test program compiles without cargo with just rustc.

#linux #kernel #ebpf #rust #tpm
1
0
1

@jarkko it must, because eBPF does not allow backward jumps.

not sure how far you'll get with your TPM prot because... well how would you even access the tpm without additinal support from in-kernel software? also, there is a length limit to these programs.

1
0
0
@devcoffee there's no need to access tpm i'd just like to know if i can run the parser inside eBPF
1
0
0

Jarkko Sakkinen

Edited 4 days ago
I actually would have to test run it which I might do. It does have fixed-limited loops which I would imagine eBPF compiler to be able to unroll but other than that I'm not sure if there are backward jumps in tpm2_protocol. I'll try this some day :-)

Obviously it will fail when if I deploy it to filter but it is still interesting to see how and where.
0
0
0