diff options
author | Alexei Starovoitov <ast@kernel.org> | 2019-06-15 12:12:18 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-06-19 02:22:51 +0200 |
commit | fc559a70d57c6ee5443f7a750858503e94cdc941 (patch) | |
tree | 83cbbd86ed11bccb5ee5eb088f45e91bbfcc3253 /tools/testing/selftests/bpf/verifier/direct_packet_access.c | |
parent | f7cf25b2026dc8441e0fa3a202c2aa8a56211e30 (diff) | |
download | linux-fc559a70d57c6ee5443f7a750858503e94cdc941.tar.gz linux-fc559a70d57c6ee5443f7a750858503e94cdc941.tar.bz2 linux-fc559a70d57c6ee5443f7a750858503e94cdc941.zip |
selftests/bpf: fix tests due to const spill/fill
fix tests that incorrectly assumed that the verifier
cannot track constants through stack.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/verifier/direct_packet_access.c')
-rw-r--r-- | tools/testing/selftests/bpf/verifier/direct_packet_access.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/verifier/direct_packet_access.c b/tools/testing/selftests/bpf/verifier/direct_packet_access.c index d5c596fdc4b9..2c5fbe7bcd27 100644 --- a/tools/testing/selftests/bpf/verifier/direct_packet_access.c +++ b/tools/testing/selftests/bpf/verifier/direct_packet_access.c @@ -511,7 +511,8 @@ offsetof(struct __sk_buff, data)), BPF_LDX_MEM(BPF_W, BPF_REG_3, BPF_REG_1, offsetof(struct __sk_buff, data_end)), - BPF_MOV64_IMM(BPF_REG_0, 0xffffffff), + BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_1, + offsetof(struct __sk_buff, mark)), BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, -8), BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -8), BPF_ALU64_IMM(BPF_AND, BPF_REG_0, 0xffff), |