I am working with seccomp BPF and need to set the jump values (jt
/jf
/k
) of a jump statement (conditional jump/jump always) as the value stored in the accumulator. Is this possible? I have a hunch that it is not, because the BPF verifier cannot check the jump values before loading the filter. If not, are there any workarounds?
struct sock_filter filter =
{
BPF_STMT(BPF_LD | BPF_W | BPF_ABS, offsetof(struct seccomp_data, nr)),
BPF_STMT(BPF_JMP | BPF_JA, /* Value stored in the accumulator */),
...
}
I tried looking here but I couldn't figure out any way to do it. My knowledge of BPF is also rather elementary and only within the purview of seccomp. Can you help me? Thanks for your time.