bpf: Set meta->raw_mode for pointers close to use
authorLorenz Bauer <lmb@cloudflare.com>
Mon, 21 Sep 2020 12:12:24 +0000 (13:12 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 21 Sep 2020 22:00:41 +0000 (15:00 -0700)
commita2bbe7cc90755283f1db719eb757616cefd2a9fd
treeb78a59c19e7c238ad4819cba514fa5a290adcc89
parentfeec70401672bd9b0268ae59ec5efd15d86ae138
bpf: Set meta->raw_mode for pointers close to use

If we encounter a pointer to memory, we set meta->raw_mode depending
on the type of memory we point at. What isn't obvious is that this
information is only used when the next memory size argument is
encountered.

Move the assignment closer to where it's used, and add a comment that
explains what is going on.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200921121227.255763-9-lmb@cloudflare.com
kernel/bpf/verifier.c