bpf: Support new sign-extension load insns
authorYonghong Song <yonghong.song@linux.dev>
Fri, 28 Jul 2023 01:11:56 +0000 (18:11 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 28 Jul 2023 01:52:33 +0000 (18:52 -0700)
commit1f9a1ea821ff25353a0e80d971e7958cd55b47a3
tree3761503de2b1677a7d392b52710ee428d1a023d6
parent10d78a66a5f29fbbde1b09b5139c17c436b08c6e
bpf: Support new sign-extension load insns

Add interpreter/jit support for new sign-extension load insns
which adds a new mode (BPF_MEMSX).
Also add verifier support to recognize these insns and to
do proper verification with new insns. In verifier, besides
to deduce proper bounds for the dst_reg, probed memory access
is also properly handled.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230728011156.3711870-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/x86/net/bpf_jit_comp.c
include/linux/filter.h
include/uapi/linux/bpf.h
kernel/bpf/core.c
kernel/bpf/verifier.c
tools/include/uapi/linux/bpf.h