Re: [PATCH bpf-next v6 4/5] selftests/bpf: Use vmlinux.h in socket_cookie_prog.c

2021-01-27 Thread Andrii Nakryiko
On Tue, Jan 26, 2021 at 10:36 AM Florent Revest wrote: > > When migrating from the bpf.h's to the vmlinux.h's definition of struct > bps_sock, an interesting LLVM behavior happened. LLVM started producing > two fetches of ctx->sk in the sockops program this means that the > verifier could not

[PATCH bpf-next v6 4/5] selftests/bpf: Use vmlinux.h in socket_cookie_prog.c

2021-01-26 Thread Florent Revest
When migrating from the bpf.h's to the vmlinux.h's definition of struct bps_sock, an interesting LLVM behavior happened. LLVM started producing two fetches of ctx->sk in the sockops program this means that the verifier could not keep track of the NULL-check on ctx->sk. Therefore, we need to