bpf: Remove superfluous aux sanitation on subprog rejection
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 29 Jun 2021 09:39:15 +0000 (09:39 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 16 Jul 2021 14:57:07 +0000 (16:57 +0200)
commit59089a189e3adde4cf85f2ce479738d1ae4c514d
tree81315726907207daefefe7da05258a7890a96f7e
parent20192d9c9f6ae447c461285c915502ffbddf5696
bpf: Remove superfluous aux sanitation on subprog rejection

Follow-up to fe9a5ca7e370 ("bpf: Do not mark insn as seen under speculative
path verification"). The sanitize_insn_aux_data() helper does not serve a
particular purpose in today's code. The original intention for the helper
was that if function-by-function verification fails, a given program would
be cleared from temporary insn_aux_data[], and then its verification would
be re-attempted in the context of the main program a second time.

However, a failure in do_check_subprogs() will skip do_check_main() and
propagate the error to the user instead, thus such situation can never occur.
Given its interaction is not compatible to the Spectre v1 mitigation (due to
comparing aux->seen with env->pass_cnt), just remove sanitize_insn_aux_data()
to avoid future bugs in this area.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c