fshahinfar1 / kashk

Generate BPF kernel offload from source code of applications
2 stars 0 forks source link

Fail path return value #7

Closed fshahinfar1 closed 6 months ago

fshahinfar1 commented 10 months ago

It is possible to fail in a function (e.g., in access out of range check). Currently, we terminate the function by returning zero (cast to the return type). This is not correct, there are cases that cause invalid behavior. Moreover, these cases result in BPF program not passing the verifier.

What should be done? I am already passing a flag to some function which need fallback. This out-of-range errors also mean fallback to user space, so it seems reasonable from a high level to treat them the same.

fshahinfar1 commented 6 months ago

I am trying to use a better algorithm for detecting and generating failure paths (read #11). I also have some idea about treating verifier checks fails as a failure path.

fshahinfar1 commented 6 months ago

It is now possible to add fallback points in bound-checks and other transformations made to create BPF program.