bpf: don't (ab)use instructions to store state
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 21 Sep 2016 10:43:56 +0000 (11:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:35:30 +0000 (09:35 +0100)
commit0748b80e432584502d1559b1a51b7df58f5e2fce
tree56eee4cc9b17d060e973c03f7de53e6c990c0709
parent087a92287dbae61b4ee1e76d7c20c81710109422
bpf: don't (ab)use instructions to store state

commit 3df126f35f88dc76eea33769f85a3c3bb8ce6c6b upstream.

Storing state in reserved fields of instructions makes
it impossible to run verifier on programs already
marked as read-only. Allocate and use an array of
per-instruction state instead.

While touching the error path rename and move existing
jump target.

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/verifier.c