kernel_optimize_test/tools/testing/selftests/bpf
Jakub Kicinski 83d163124c bpf: verifier: propagate liveness on all frames
Commit 7640ead939 ("bpf: verifier: make sure callees don't prune
with caller differences") connected up parentage chains of all
frames of the stack.  It didn't, however, ensure propagate_liveness()
propagates all liveness information along those chains.

This means pruning happening in the callee may generate explored
states with incomplete liveness for the chains in lower frames
of the stack.

The included selftest is similar to the prior one from commit
7640ead939 ("bpf: verifier: make sure callees don't prune with
caller differences"), where callee would prune regardless of the
difference in r8 state.

Now we also initialize r9 to 0 or 1 based on a result from get_random().
r9 is never read so the walk with r9 = 0 gets pruned (correctly) after
the walk with r9 = 1 completes.

The selftest is so arranged that the pruning will happen in the
callee.  Since callee does not propagate read marks of r8, the
explored state at the pruning point prior to the callee will
now ignore r8.

Propagate liveness on all frames of the stack when pruning.

Fixes: f4d7e40a5b ("bpf: introduce function calls (verification)")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-03-21 19:57:02 -07:00
..
gnu
include/uapi/linux
prog_tests selftests/bpf: fix segfault of test_progs when prog loading failed 2019-03-12 21:55:54 +01:00
progs bpf: Add an example for bpf_get_listener_sock 2019-03-13 12:04:35 -07:00
verifier bpf: verifier: propagate liveness on all frames 2019-03-21 19:57:02 -07:00
.gitignore selftests/bpf: fix btf_dedup testing code 2019-03-01 01:31:47 +01:00
bpf_endian.h
bpf_helpers.h bpf: Add an example for bpf_get_listener_sock 2019-03-13 12:04:35 -07:00
bpf_rand.h
bpf_rlimit.h
bpf_util.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-02-16 22:56:34 -08:00
cgroup_helpers.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
cgroup_helpers.h
config selftests/bpf: add config fragment CONFIG_FTRACE_SYSCALLS 2018-11-28 22:13:06 +01:00
flow_dissector_load.c selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow dissector 2019-01-29 01:08:29 +01:00
flow_dissector_load.h selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow dissector 2019-01-29 01:08:29 +01:00
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 selftests/bpf: use localhost in tcp_{server,client}.py 2019-02-04 21:29:27 +01:00
tcp_server.py selftests/bpf: use localhost in tcp_{server,client}.py 2019-02-04 21:29:27 +01:00
test_align.c bpf: Add BPF_F_ANY_ALIGNMENT. 2018-11-30 21:38:48 -08:00
test_btf.c selftests/bpf: add fwd enum resolution test for btf_dedup 2019-03-14 13:53:18 -07:00
test_cgroup_storage.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_dev_cgroup.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_flow_dissector.c selftests: bpf: remove duplicated include 2019-01-29 00:09:26 +01:00
test_flow_dissector.sh
test_iptunnel_common.h
test_kmod.sh
test_libbpf_open.c tools: libbpf: add a correctly named define for map iteration 2019-03-01 00:53:45 +01:00
test_libbpf.sh
test_lirc_mode2_user.c media: bpf: add bpf function to report mouse movement 2018-12-09 14:37:18 -08:00
test_lirc_mode2.sh media: bpf: add bpf function to report mouse movement 2018-12-09 14:37:18 -08:00
test_lpm_map.c bpf, lpm: fix lookup bug in map_delete_elem 2019-02-22 16:17:53 +01:00
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 bpf: test_maps: fix possible out of bound access warning 2019-02-06 15:48:43 +01:00
test_netcnt.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_offload.py selftests/bpf: test reading the offloaded program 2019-02-06 15:35:42 +01:00
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_common.h
test_select_reuseport.c
test_skb_cgroup_id_user.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_skb_cgroup_id.sh
test_sock_addr.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_sock_addr.sh
test_sock_fields.c bpf: Add an example for bpf_get_listener_sock 2019-03-13 12:04:35 -07:00
test_sock.c tools/bpf: add log_level to bpf_load_program_attr 2019-02-07 18:22:31 -08:00
test_socket_cookie.c libbpf: Show supported ELF section names when failing to guess prog/attach type 2019-01-23 12:27:04 +01:00
test_sockmap_kern.h bpf: test_sockmap, add options for msg_pop_data() helper 2018-11-28 22:07:57 +01:00
test_sockmap.c selftests: bpf: remove duplicated include 2019-01-29 00:09:26 +01:00
test_tag.c
test_tcpbpf_user.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_tcpbpf.h
test_tcpnotify_user.c selftests/bpf: don't hardcode iptables/nc path in test_tcpnotify_user 2019-01-23 12:56:30 +01:00
test_tcpnotify.h
test_tunnel.sh
test_verifier_log.c
test_verifier.c selftests/bpf: add bpf_spin_lock verifier tests 2019-02-01 20:55:39 +01:00
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