]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
bpf: Move sanitize_val_alu out of op switch
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 24 Mar 2021 10:25:39 +0000 (11:25 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:54:07 +0000 (09:54 +0200)
commit46023efe38fefa16f6ab3fce62ad3ae1333b5180
tree98b00bf0163351e694281eace7fe47d4bc40c8a4
parent1e1331d68668f9d7f9121c1612fbe80b8916a96e
bpf: Move sanitize_val_alu out of op switch

BugLink: https://bugs.launchpad.net/bugs/1926999
commit f528819334881fd622fdadeddb3f7edaed8b7c9b upstream.

Add a small sanitize_needed() helper function and move sanitize_val_alu()
out of the main opcode switch. In upcoming work, we'll move sanitize_ptr_alu()
as well out of its opcode switch so this helps to streamline both.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/bpf/verifier.c