~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/bpf/verifier/prevent_map_lookup.c

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 {
  2         "prevent map lookup in sockmap",
  3         .insns = {
  4         BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
  5         BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
  6         BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
  7         BPF_LD_MAP_FD(BPF_REG_1, 0),
  8         BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem),
  9         BPF_EXIT_INSN(),
 10         },
 11         .fixup_map_sockmap = { 3 },
 12         .result = REJECT,
 13         .errstr = "cannot pass map_type 15 into func bpf_map_lookup_elem",
 14         .prog_type = BPF_PROG_TYPE_SOCK_OPS,
 15 },
 16 {
 17         "prevent map lookup in sockhash",
 18         .insns = {
 19         BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
 20         BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
 21         BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
 22         BPF_LD_MAP_FD(BPF_REG_1, 0),
 23         BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem),
 24         BPF_EXIT_INSN(),
 25         },
 26         .fixup_map_sockhash = { 3 },
 27         .result = REJECT,
 28         .errstr = "cannot pass map_type 18 into func bpf_map_lookup_elem",
 29         .prog_type = BPF_PROG_TYPE_SOCK_OPS,
 30 },
 31 {
 32         "prevent map lookup in stack trace",
 33         .insns = {
 34         BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
 35         BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
 36         BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
 37         BPF_LD_MAP_FD(BPF_REG_1, 0),
 38         BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem),
 39         BPF_EXIT_INSN(),
 40         },
 41         .fixup_map_stacktrace = { 3 },
 42         .result = REJECT,
 43         .errstr = "cannot pass map_type 7 into func bpf_map_lookup_elem",
 44         .prog_type = BPF_PROG_TYPE_PERF_EVENT,
 45 },
 46 {
 47         "prevent map lookup in prog array",
 48         .insns = {
 49         BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
 50         BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
 51         BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
 52         BPF_LD_MAP_FD(BPF_REG_1, 0),
 53         BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_map_lookup_elem),
 54         BPF_EXIT_INSN(),
 55         },
 56         .fixup_prog2 = { 3 },
 57         .result = REJECT,
 58         .errstr = "cannot pass map_type 3 into func bpf_map_lookup_elem",
 59 },
 60 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp