net: bpf: let clang shut up

Let clang warning shut up and initialize the allocated area
with zeroes.

  CC	net/bpf.o
net/bpf.c:297:16: warning: The left expression of the compound assignment
       is an uninitialized value. The computed value will also be garbage
                curr[1].code |= (uint16_t) rand();
                ~~~~~~~~~~~~ ^
net/bpf.c:299:16: warning: The left expression of the compound assignment
       is an uninitialized value. The computed value will also be garbage
                curr[2].code |= (uint16_t) rand();
                ~~~~~~~~~~~~ ^

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
minor: move offsetof into trinity.h

Move it there since it's of generic use somewhere in future
else as well.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
prctl: enable seccomp generator invocation

Allow trinity to use the recently added seccomp bpf generator
that was introduced in 3d0d78 ("bpf: add randomized seccomp
filter generated by markov chain"). The last two arguments for
that call can be left as random, the kernel does not seem to
care about it.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Read pid_max from /proc

I was hitting this on my system, where it's 65536. So fix the todo and
read it from /proc.

I left a fallback to the hardcoded values in case /proc is not mounted
or something else goes wrong.