OSDN Git Service

bpf: adjust insn_aux_data when patching insns
authorAlexei Starovoitov <ast@fb.com>
Thu, 16 Mar 2017 01:26:41 +0000 (18:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:35:31 +0000 (09:35 +0100)
commit648064515d0d91d10d255ab1e3afa3ecffc2943a
treee68c4d0ded78a733a0354cbbf2d16af17ecf9220
parent19614eee0644a59a8ea2509a6fbc0e771644a4f2
bpf: adjust insn_aux_data when patching insns

commit 8041902dae5299c1f194ba42d14383f734631009 upstream.

convert_ctx_accesses() replaces single bpf instruction with a set of
instructions. Adjust corresponding insn_aux_data while patching.
It's needed to make sure subsequent 'for(all insn)' loops
have matching insn and insn_aux_data.

Signed-off-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