|
6 | 6 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1), |
7 | 7 | BPF_EXIT_INSN(), |
8 | 8 | }, |
9 | | - .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
| 9 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
10 | 10 | .errstr = "R0 tried to subtract pointer from scalar", |
11 | 11 | .result = REJECT, |
12 | 12 | }, |
|
21 | 21 | BPF_ALU64_REG(BPF_SUB, BPF_REG_1, BPF_REG_0), |
22 | 22 | BPF_EXIT_INSN(), |
23 | 23 | }, |
24 | | - .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", |
| 24 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
25 | 25 | .result_unpriv = REJECT, |
26 | 26 | .result = ACCEPT, |
27 | 27 | .retval = 1, |
|
34 | 34 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1), |
35 | 35 | BPF_EXIT_INSN(), |
36 | 36 | }, |
37 | | - .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
| 37 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
38 | 38 | .errstr = "R0 tried to subtract pointer from scalar", |
39 | 39 | .result = REJECT, |
40 | 40 | }, |
41 | 41 | { |
42 | 42 | "check deducing bounds from const, 4", |
43 | 43 | .insns = { |
| 44 | + BPF_MOV64_REG(BPF_REG_6, BPF_REG_1), |
44 | 45 | BPF_MOV64_IMM(BPF_REG_0, 0), |
45 | 46 | BPF_JMP_IMM(BPF_JSLE, BPF_REG_0, 0, 1), |
46 | 47 | BPF_EXIT_INSN(), |
47 | 48 | BPF_JMP_IMM(BPF_JSGE, BPF_REG_0, 0, 1), |
48 | 49 | BPF_EXIT_INSN(), |
49 | | - BPF_ALU64_REG(BPF_SUB, BPF_REG_1, BPF_REG_0), |
| 50 | + BPF_ALU64_REG(BPF_SUB, BPF_REG_6, BPF_REG_0), |
50 | 51 | BPF_EXIT_INSN(), |
51 | 52 | }, |
52 | | - .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", |
| 53 | + .errstr_unpriv = "R6 has pointer with unsupported alu operation", |
53 | 54 | .result_unpriv = REJECT, |
54 | 55 | .result = ACCEPT, |
55 | 56 | }, |
|
61 | 62 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1), |
62 | 63 | BPF_EXIT_INSN(), |
63 | 64 | }, |
64 | | - .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
| 65 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
65 | 66 | .errstr = "R0 tried to subtract pointer from scalar", |
66 | 67 | .result = REJECT, |
67 | 68 | }, |
|
74 | 75 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1), |
75 | 76 | BPF_EXIT_INSN(), |
76 | 77 | }, |
77 | | - .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
| 78 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
78 | 79 | .errstr = "R0 tried to subtract pointer from scalar", |
79 | 80 | .result = REJECT, |
80 | 81 | }, |
|
88 | 89 | offsetof(struct __sk_buff, mark)), |
89 | 90 | BPF_EXIT_INSN(), |
90 | 91 | }, |
91 | | - .errstr_unpriv = "R1 tried to sub from different maps, paths, or prohibited types", |
| 92 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
92 | 93 | .errstr = "dereference of modified ctx ptr", |
93 | 94 | .result = REJECT, |
94 | 95 | .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS, |
|
103 | 104 | offsetof(struct __sk_buff, mark)), |
104 | 105 | BPF_EXIT_INSN(), |
105 | 106 | }, |
106 | | - .errstr_unpriv = "R1 tried to add from different maps, paths, or prohibited types", |
| 107 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
107 | 108 | .errstr = "dereference of modified ctx ptr", |
108 | 109 | .result = REJECT, |
109 | 110 | .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS, |
|
116 | 117 | BPF_ALU64_REG(BPF_SUB, BPF_REG_0, BPF_REG_1), |
117 | 118 | BPF_EXIT_INSN(), |
118 | 119 | }, |
119 | | - .errstr_unpriv = "R0 tried to sub from different maps, paths, or prohibited types", |
| 120 | + .errstr_unpriv = "R1 has pointer with unsupported alu operation", |
120 | 121 | .errstr = "R0 tried to subtract pointer from scalar", |
121 | 122 | .result = REJECT, |
122 | 123 | }, |
|
0 commit comments