bpf: adjust insn_aux_data when patching insns
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 22 Dec 2017 15:29:02 +0000 (16:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:23:47 +0000 (14:23 +0100)
commit565f012f5abb2d2bba8e03efcd1dba7577245011
tree265d31e3d3549fed2d4d275326d183e7280ba5f0
parent3b6c84bc64490529c33bd5f0f9e2c6256031f398
bpf: adjust insn_aux_data when patching insns

From: Alexei Starovoitov <ast@fb.com>

[ Upstream commit 8041902dae5299c1f194ba42d14383f734631009 ]

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/verifier.c