]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bpf: move {prev_,}insn_idx into verifier env
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 11 Feb 2019 05:25:00 +0000 (05:25 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Mon, 4 Mar 2019 04:43:37 +0000 (23:43 -0500)
commitf93a623fd0e0aab06527fab92672e52ca0b2b92c
tree2c92885f2052d93bc724a5e0283ff833cc582f01
parente60e198a843295ce403a351c9abd8c6b44123af5
bpf: move {prev_,}insn_idx into verifier env

Move prev_insn_idx and insn_idx from the do_check() function into
the verifier environment, so they can be read inside the various
helper functions for handling the instructions. It's easier to put
this into the environment rather than changing all call-sites only
to pass it along. insn_idx is useful in particular since this later
on allows to hold state in env->insn_aux_data[env->insn_idx].

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
CVE-2019-7308

(backported from commit c08435ec7f2bc8f4109401f696fd55159b4b40cb)
[tyhicks: Backport around missing verbose logging message]
[tyhicks: Backport around minor whitespace difference]
[tyhicks: Backport around lack of bpf function call support]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/linux/bpf_verifier.h
kernel/bpf/verifier.c