linux-xiaomi-chiron/tools/testing/selftests/bpf
Daniel Borkmann 20182390c4 bpf: fix replace_map_fd_with_map_ptr's ldimm64 second imm field
Non-zero imm value in the second part of the ldimm64 instruction for
BPF_PSEUDO_MAP_FD is invalid, and thus must be rejected. The map fd
only ever sits in the first instructions' imm field. None of the BPF
loaders known to us are using it, so risk of regression is minimal.
For clarity and consistency, the few insn->{src_reg,imm} occurrences
are rewritten into insn[0].{src_reg,imm}. Add a test case to the BPF
selftest suite as well.

Fixes: 0246e64d9a ("bpf: handle pseudo BPF_LD_IMM64 insn")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-07 08:47:13 -08:00
..
gnu
include/uapi/linux
prog_tests selftests: bpf: test_progs: initialize duration in singal_pending test 2019-03-07 10:46:25 +01:00
progs
verifier bpf: fix replace_map_fd_with_map_ptr's ldimm64 second imm field 2019-03-07 08:47:13 -08:00
.gitignore selftests/bpf: fix btf_dedup testing code 2019-03-01 01:31:47 +01:00
bpf_endian.h
bpf_helpers.h bpf: sync bpf.h to tools and update bpf_helpers.h 2019-03-02 10:48:27 -08:00
bpf_rand.h
bpf_rlimit.h
bpf_util.h
cgroup_helpers.c
cgroup_helpers.h
config
flow_dissector_load.c
flow_dissector_load.h
get_cgroup_id_user.c
Makefile selftests: bpf: fix compilation with out-of-tree $(OUTPUT) 2019-03-07 10:44:32 +01:00
netcnt_common.h
tcp_client.py
tcp_server.py
test_align.c
test_btf.c selftests/bpf: add btf_dedup test of FWD/STRUCT resolution 2019-03-01 01:31:48 +01:00
test_cgroup_storage.c
test_dev_cgroup.c
test_flow_dissector.c
test_flow_dissector.sh
test_iptunnel_common.h
test_kmod.sh
test_libbpf.sh
test_libbpf_open.c tools: libbpf: add a correctly named define for map iteration 2019-03-01 00:53:45 +01:00
test_lirc_mode2.sh
test_lirc_mode2_user.c
test_lpm_map.c
test_lru_map.c
test_lwt_ip_encap.sh selftests/bpf: test that GSO works in lwt_ip_encap 2019-03-07 10:41:40 +01:00
test_lwt_seg6local.sh
test_maps.c
test_netcnt.c
test_offload.py
test_progs.c selftests: bpf: break up test_progs - misc 2019-03-02 11:10:40 -08:00
test_progs.h selftests: bpf: break up test_progs - misc 2019-03-02 11:10:40 -08:00
test_queue_stack_map.h
test_section_names.c
test_select_reuseport.c
test_select_reuseport_common.h
test_skb_cgroup_id.sh
test_skb_cgroup_id_user.c
test_sock.c
test_sock_addr.c
test_sock_addr.sh
test_sock_fields.c selftests/bpf: set unlimited RLIMIT_MEMLOCK for test_sock_fields 2019-03-02 01:06:23 +01:00
test_socket_cookie.c
test_sockmap.c
test_sockmap_kern.h
test_tag.c
test_tcpbpf.h
test_tcpbpf_user.c
test_tcpnotify.h
test_tcpnotify_user.c
test_tunnel.sh
test_verifier.c
test_verifier_log.c
test_xdp_meta.sh
test_xdp_redirect.sh
test_xdp_vlan.sh
trace_helpers.c
trace_helpers.h
urandom_read.c
with_addr.sh
with_tunnels.sh