diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-06-02 17:06:31 -0400 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-06-03 10:42:06 -0400 |
commit | 06be0864c77ae6861632a678a6378511a4828d6e (patch) | |
tree | 1dcb6db94fcedbfe8c04352b3ad4e379a69b1fd5 /tools/include/linux | |
parent | 25c1013e0464340aeb090a11c6d0b154bc52afd7 (diff) |
bpf: test case for map pointer poison with calls/branches
Add several test cases where the same or different map pointers
originate from different paths in the program and execute a map
lookup or tail call at a common location.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/include/linux')
-rw-r--r-- | tools/include/linux/filter.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/include/linux/filter.h b/tools/include/linux/filter.h index c5e512da8d8a..af55acf73e75 100644 --- a/tools/include/linux/filter.h +++ b/tools/include/linux/filter.h | |||
@@ -263,6 +263,16 @@ | |||
263 | #define BPF_LD_MAP_FD(DST, MAP_FD) \ | 263 | #define BPF_LD_MAP_FD(DST, MAP_FD) \ |
264 | BPF_LD_IMM64_RAW(DST, BPF_PSEUDO_MAP_FD, MAP_FD) | 264 | BPF_LD_IMM64_RAW(DST, BPF_PSEUDO_MAP_FD, MAP_FD) |
265 | 265 | ||
266 | /* Relative call */ | ||
267 | |||
268 | #define BPF_CALL_REL(TGT) \ | ||
269 | ((struct bpf_insn) { \ | ||
270 | .code = BPF_JMP | BPF_CALL, \ | ||
271 | .dst_reg = 0, \ | ||
272 | .src_reg = BPF_PSEUDO_CALL, \ | ||
273 | .off = 0, \ | ||
274 | .imm = TGT }) | ||
275 | |||
266 | /* Program exit */ | 276 | /* Program exit */ |
267 | 277 | ||
268 | #define BPF_EXIT_INSN() \ | 278 | #define BPF_EXIT_INSN() \ |