aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/net/bpf_jit_comp.c2
-rw-r--r--include/linux/filter.h50
-rw-r--r--kernel/bpf/core.c2
-rw-r--r--kernel/seccomp.c2
-rw-r--r--lib/test_bpf.c4
-rw-r--r--net/core/filter.c18
6 files changed, 39 insertions, 39 deletions
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 99bef86ed6df..71737a83f022 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -214,7 +214,7 @@ struct jit_context {
214static int do_jit(struct sk_filter *bpf_prog, int *addrs, u8 *image, 214static int do_jit(struct sk_filter *bpf_prog, int *addrs, u8 *image,
215 int oldproglen, struct jit_context *ctx) 215 int oldproglen, struct jit_context *ctx)
216{ 216{
217 struct sock_filter_int *insn = bpf_prog->insnsi; 217 struct bpf_insn *insn = bpf_prog->insnsi;
218 int insn_cnt = bpf_prog->len; 218 int insn_cnt = bpf_prog->len;
219 u8 temp[64]; 219 u8 temp[64];
220 int i; 220 int i;
diff --git a/include/linux/filter.h b/include/linux/filter.h
index c43c8258e682..20dd50ef7271 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -82,7 +82,7 @@ enum {
82/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ 82/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
83 83
84#define BPF_ALU64_REG(OP, DST, SRC) \ 84#define BPF_ALU64_REG(OP, DST, SRC) \
85 ((struct sock_filter_int) { \ 85 ((struct bpf_insn) { \
86 .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \ 86 .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \
87 .dst_reg = DST, \ 87 .dst_reg = DST, \
88 .src_reg = SRC, \ 88 .src_reg = SRC, \
@@ -90,7 +90,7 @@ enum {
90 .imm = 0 }) 90 .imm = 0 })
91 91
92#define BPF_ALU32_REG(OP, DST, SRC) \ 92#define BPF_ALU32_REG(OP, DST, SRC) \
93 ((struct sock_filter_int) { \ 93 ((struct bpf_insn) { \
94 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \ 94 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
95 .dst_reg = DST, \ 95 .dst_reg = DST, \
96 .src_reg = SRC, \ 96 .src_reg = SRC, \
@@ -100,7 +100,7 @@ enum {
100/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */ 100/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */
101 101
102#define BPF_ALU64_IMM(OP, DST, IMM) \ 102#define BPF_ALU64_IMM(OP, DST, IMM) \
103 ((struct sock_filter_int) { \ 103 ((struct bpf_insn) { \
104 .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \ 104 .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
105 .dst_reg = DST, \ 105 .dst_reg = DST, \
106 .src_reg = 0, \ 106 .src_reg = 0, \
@@ -108,7 +108,7 @@ enum {
108 .imm = IMM }) 108 .imm = IMM })
109 109
110#define BPF_ALU32_IMM(OP, DST, IMM) \ 110#define BPF_ALU32_IMM(OP, DST, IMM) \
111 ((struct sock_filter_int) { \ 111 ((struct bpf_insn) { \
112 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \ 112 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
113 .dst_reg = DST, \ 113 .dst_reg = DST, \
114 .src_reg = 0, \ 114 .src_reg = 0, \
@@ -118,7 +118,7 @@ enum {
118/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */ 118/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */
119 119
120#define BPF_ENDIAN(TYPE, DST, LEN) \ 120#define BPF_ENDIAN(TYPE, DST, LEN) \
121 ((struct sock_filter_int) { \ 121 ((struct bpf_insn) { \
122 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \ 122 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
123 .dst_reg = DST, \ 123 .dst_reg = DST, \
124 .src_reg = 0, \ 124 .src_reg = 0, \
@@ -128,7 +128,7 @@ enum {
128/* Short form of mov, dst_reg = src_reg */ 128/* Short form of mov, dst_reg = src_reg */
129 129
130#define BPF_MOV64_REG(DST, SRC) \ 130#define BPF_MOV64_REG(DST, SRC) \
131 ((struct sock_filter_int) { \ 131 ((struct bpf_insn) { \
132 .code = BPF_ALU64 | BPF_MOV | BPF_X, \ 132 .code = BPF_ALU64 | BPF_MOV | BPF_X, \
133 .dst_reg = DST, \ 133 .dst_reg = DST, \
134 .src_reg = SRC, \ 134 .src_reg = SRC, \
@@ -136,7 +136,7 @@ enum {
136 .imm = 0 }) 136 .imm = 0 })
137 137
138#define BPF_MOV32_REG(DST, SRC) \ 138#define BPF_MOV32_REG(DST, SRC) \
139 ((struct sock_filter_int) { \ 139 ((struct bpf_insn) { \
140 .code = BPF_ALU | BPF_MOV | BPF_X, \ 140 .code = BPF_ALU | BPF_MOV | BPF_X, \
141 .dst_reg = DST, \ 141 .dst_reg = DST, \
142 .src_reg = SRC, \ 142 .src_reg = SRC, \
@@ -146,7 +146,7 @@ enum {
146/* Short form of mov, dst_reg = imm32 */ 146/* Short form of mov, dst_reg = imm32 */
147 147
148#define BPF_MOV64_IMM(DST, IMM) \ 148#define BPF_MOV64_IMM(DST, IMM) \
149 ((struct sock_filter_int) { \ 149 ((struct bpf_insn) { \
150 .code = BPF_ALU64 | BPF_MOV | BPF_K, \ 150 .code = BPF_ALU64 | BPF_MOV | BPF_K, \
151 .dst_reg = DST, \ 151 .dst_reg = DST, \
152 .src_reg = 0, \ 152 .src_reg = 0, \
@@ -154,7 +154,7 @@ enum {
154 .imm = IMM }) 154 .imm = IMM })
155 155
156#define BPF_MOV32_IMM(DST, IMM) \ 156#define BPF_MOV32_IMM(DST, IMM) \
157 ((struct sock_filter_int) { \ 157 ((struct bpf_insn) { \
158 .code = BPF_ALU | BPF_MOV | BPF_K, \ 158 .code = BPF_ALU | BPF_MOV | BPF_K, \
159 .dst_reg = DST, \ 159 .dst_reg = DST, \
160 .src_reg = 0, \ 160 .src_reg = 0, \
@@ -164,7 +164,7 @@ enum {
164/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */ 164/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */
165 165
166#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \ 166#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \
167 ((struct sock_filter_int) { \ 167 ((struct bpf_insn) { \
168 .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \ 168 .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \
169 .dst_reg = DST, \ 169 .dst_reg = DST, \
170 .src_reg = SRC, \ 170 .src_reg = SRC, \
@@ -172,7 +172,7 @@ enum {
172 .imm = IMM }) 172 .imm = IMM })
173 173
174#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \ 174#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \
175 ((struct sock_filter_int) { \ 175 ((struct bpf_insn) { \
176 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \ 176 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
177 .dst_reg = DST, \ 177 .dst_reg = DST, \
178 .src_reg = SRC, \ 178 .src_reg = SRC, \
@@ -182,7 +182,7 @@ enum {
182/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */ 182/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */
183 183
184#define BPF_LD_ABS(SIZE, IMM) \ 184#define BPF_LD_ABS(SIZE, IMM) \
185 ((struct sock_filter_int) { \ 185 ((struct bpf_insn) { \
186 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \ 186 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \
187 .dst_reg = 0, \ 187 .dst_reg = 0, \
188 .src_reg = 0, \ 188 .src_reg = 0, \
@@ -192,7 +192,7 @@ enum {
192/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */ 192/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */
193 193
194#define BPF_LD_IND(SIZE, SRC, IMM) \ 194#define BPF_LD_IND(SIZE, SRC, IMM) \
195 ((struct sock_filter_int) { \ 195 ((struct bpf_insn) { \
196 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \ 196 .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \
197 .dst_reg = 0, \ 197 .dst_reg = 0, \
198 .src_reg = SRC, \ 198 .src_reg = SRC, \
@@ -202,7 +202,7 @@ enum {
202/* Memory load, dst_reg = *(uint *) (src_reg + off16) */ 202/* Memory load, dst_reg = *(uint *) (src_reg + off16) */
203 203
204#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \ 204#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
205 ((struct sock_filter_int) { \ 205 ((struct bpf_insn) { \
206 .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \ 206 .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
207 .dst_reg = DST, \ 207 .dst_reg = DST, \
208 .src_reg = SRC, \ 208 .src_reg = SRC, \
@@ -212,7 +212,7 @@ enum {
212/* Memory store, *(uint *) (dst_reg + off16) = src_reg */ 212/* Memory store, *(uint *) (dst_reg + off16) = src_reg */
213 213
214#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \ 214#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
215 ((struct sock_filter_int) { \ 215 ((struct bpf_insn) { \
216 .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \ 216 .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
217 .dst_reg = DST, \ 217 .dst_reg = DST, \
218 .src_reg = SRC, \ 218 .src_reg = SRC, \
@@ -222,7 +222,7 @@ enum {
222/* Memory store, *(uint *) (dst_reg + off16) = imm32 */ 222/* Memory store, *(uint *) (dst_reg + off16) = imm32 */
223 223
224#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \ 224#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
225 ((struct sock_filter_int) { \ 225 ((struct bpf_insn) { \
226 .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \ 226 .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
227 .dst_reg = DST, \ 227 .dst_reg = DST, \
228 .src_reg = 0, \ 228 .src_reg = 0, \
@@ -232,7 +232,7 @@ enum {
232/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */ 232/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */
233 233
234#define BPF_JMP_REG(OP, DST, SRC, OFF) \ 234#define BPF_JMP_REG(OP, DST, SRC, OFF) \
235 ((struct sock_filter_int) { \ 235 ((struct bpf_insn) { \
236 .code = BPF_JMP | BPF_OP(OP) | BPF_X, \ 236 .code = BPF_JMP | BPF_OP(OP) | BPF_X, \
237 .dst_reg = DST, \ 237 .dst_reg = DST, \
238 .src_reg = SRC, \ 238 .src_reg = SRC, \
@@ -242,7 +242,7 @@ enum {
242/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */ 242/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */
243 243
244#define BPF_JMP_IMM(OP, DST, IMM, OFF) \ 244#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
245 ((struct sock_filter_int) { \ 245 ((struct bpf_insn) { \
246 .code = BPF_JMP | BPF_OP(OP) | BPF_K, \ 246 .code = BPF_JMP | BPF_OP(OP) | BPF_K, \
247 .dst_reg = DST, \ 247 .dst_reg = DST, \
248 .src_reg = 0, \ 248 .src_reg = 0, \
@@ -252,7 +252,7 @@ enum {
252/* Function call */ 252/* Function call */
253 253
254#define BPF_EMIT_CALL(FUNC) \ 254#define BPF_EMIT_CALL(FUNC) \
255 ((struct sock_filter_int) { \ 255 ((struct bpf_insn) { \
256 .code = BPF_JMP | BPF_CALL, \ 256 .code = BPF_JMP | BPF_CALL, \
257 .dst_reg = 0, \ 257 .dst_reg = 0, \
258 .src_reg = 0, \ 258 .src_reg = 0, \
@@ -262,7 +262,7 @@ enum {
262/* Raw code statement block */ 262/* Raw code statement block */
263 263
264#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ 264#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
265 ((struct sock_filter_int) { \ 265 ((struct bpf_insn) { \
266 .code = CODE, \ 266 .code = CODE, \
267 .dst_reg = DST, \ 267 .dst_reg = DST, \
268 .src_reg = SRC, \ 268 .src_reg = SRC, \
@@ -272,7 +272,7 @@ enum {
272/* Program exit */ 272/* Program exit */
273 273
274#define BPF_EXIT_INSN() \ 274#define BPF_EXIT_INSN() \
275 ((struct sock_filter_int) { \ 275 ((struct bpf_insn) { \
276 .code = BPF_JMP | BPF_EXIT, \ 276 .code = BPF_JMP | BPF_EXIT, \
277 .dst_reg = 0, \ 277 .dst_reg = 0, \
278 .src_reg = 0, \ 278 .src_reg = 0, \
@@ -298,7 +298,7 @@ enum {
298/* Macro to invoke filter function. */ 298/* Macro to invoke filter function. */
299#define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi) 299#define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi)
300 300
301struct sock_filter_int { 301struct bpf_insn {
302 __u8 code; /* opcode */ 302 __u8 code; /* opcode */
303 __u8 dst_reg:4; /* dest register */ 303 __u8 dst_reg:4; /* dest register */
304 __u8 src_reg:4; /* source register */ 304 __u8 src_reg:4; /* source register */
@@ -330,10 +330,10 @@ struct sk_filter {
330 struct sock_fprog_kern *orig_prog; /* Original BPF program */ 330 struct sock_fprog_kern *orig_prog; /* Original BPF program */
331 struct rcu_head rcu; 331 struct rcu_head rcu;
332 unsigned int (*bpf_func)(const struct sk_buff *skb, 332 unsigned int (*bpf_func)(const struct sk_buff *skb,
333 const struct sock_filter_int *filter); 333 const struct bpf_insn *filter);
334 union { 334 union {
335 struct sock_filter insns[0]; 335 struct sock_filter insns[0];
336 struct sock_filter_int insnsi[0]; 336 struct bpf_insn insnsi[0];
337 struct work_struct work; 337 struct work_struct work;
338 }; 338 };
339}; 339};
@@ -353,7 +353,7 @@ void sk_filter_select_runtime(struct sk_filter *fp);
353void sk_filter_free(struct sk_filter *fp); 353void sk_filter_free(struct sk_filter *fp);
354 354
355int sk_convert_filter(struct sock_filter *prog, int len, 355int sk_convert_filter(struct sock_filter *prog, int len,
356 struct sock_filter_int *new_prog, int *new_len); 356 struct bpf_insn *new_prog, int *new_len);
357 357
358int sk_unattached_filter_create(struct sk_filter **pfp, 358int sk_unattached_filter_create(struct sk_filter **pfp,
359 struct sock_fprog_kern *fprog); 359 struct sock_fprog_kern *fprog);
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 77a240a1ce11..265a02cc822d 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -81,7 +81,7 @@ noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
81 * keep, 0 for none. @ctx is the data we are operating on, @insn is the 81 * keep, 0 for none. @ctx is the data we are operating on, @insn is the
82 * array of filter instructions. 82 * array of filter instructions.
83 */ 83 */
84static unsigned int __sk_run_filter(void *ctx, const struct sock_filter_int *insn) 84static unsigned int __sk_run_filter(void *ctx, const struct bpf_insn *insn)
85{ 85{
86 u64 stack[MAX_BPF_STACK / sizeof(u64)]; 86 u64 stack[MAX_BPF_STACK / sizeof(u64)];
87 u64 regs[MAX_BPF_REG], tmp; 87 u64 regs[MAX_BPF_REG], tmp;
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 301bbc24739c..565743db5384 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -248,7 +248,7 @@ static long seccomp_attach_filter(struct sock_fprog *fprog)
248 if (ret) 248 if (ret)
249 goto free_prog; 249 goto free_prog;
250 250
251 /* Convert 'sock_filter' insns to 'sock_filter_int' insns */ 251 /* Convert 'sock_filter' insns to 'bpf_insn' insns */
252 ret = sk_convert_filter(fp, fprog->len, NULL, &new_len); 252 ret = sk_convert_filter(fp, fprog->len, NULL, &new_len);
253 if (ret) 253 if (ret)
254 goto free_prog; 254 goto free_prog;
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index c579e0f58818..5f48623ee1a7 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -66,7 +66,7 @@ struct bpf_test {
66 const char *descr; 66 const char *descr;
67 union { 67 union {
68 struct sock_filter insns[MAX_INSNS]; 68 struct sock_filter insns[MAX_INSNS];
69 struct sock_filter_int insns_int[MAX_INSNS]; 69 struct bpf_insn insns_int[MAX_INSNS];
70 } u; 70 } u;
71 __u8 aux; 71 __u8 aux;
72 __u8 data[MAX_DATA]; 72 __u8 data[MAX_DATA];
@@ -1807,7 +1807,7 @@ static struct sk_filter *generate_filter(int which, int *err)
1807 1807
1808 fp->len = flen; 1808 fp->len = flen;
1809 memcpy(fp->insnsi, tests[which].u.insns_int, 1809 memcpy(fp->insnsi, tests[which].u.insns_int,
1810 fp->len * sizeof(struct sock_filter_int)); 1810 fp->len * sizeof(struct bpf_insn));
1811 1811
1812 sk_filter_select_runtime(fp); 1812 sk_filter_select_runtime(fp);
1813 break; 1813 break;
diff --git a/net/core/filter.c b/net/core/filter.c
index 1d0e9492e4fa..f3b2d5e9fe5f 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -174,9 +174,9 @@ static u64 __get_random_u32(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
174} 174}
175 175
176static bool convert_bpf_extensions(struct sock_filter *fp, 176static bool convert_bpf_extensions(struct sock_filter *fp,
177 struct sock_filter_int **insnp) 177 struct bpf_insn **insnp)
178{ 178{
179 struct sock_filter_int *insn = *insnp; 179 struct bpf_insn *insn = *insnp;
180 180
181 switch (fp->k) { 181 switch (fp->k) {
182 case SKF_AD_OFF + SKF_AD_PROTOCOL: 182 case SKF_AD_OFF + SKF_AD_PROTOCOL:
@@ -326,7 +326,7 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
326 * 326 *
327 * 2) 2nd pass to remap in two passes: 1st pass finds new 327 * 2) 2nd pass to remap in two passes: 1st pass finds new
328 * jump offsets, 2nd pass remapping: 328 * jump offsets, 2nd pass remapping:
329 * new_prog = kmalloc(sizeof(struct sock_filter_int) * new_len); 329 * new_prog = kmalloc(sizeof(struct bpf_insn) * new_len);
330 * sk_convert_filter(old_prog, old_len, new_prog, &new_len); 330 * sk_convert_filter(old_prog, old_len, new_prog, &new_len);
331 * 331 *
332 * User BPF's register A is mapped to our BPF register 6, user BPF 332 * User BPF's register A is mapped to our BPF register 6, user BPF
@@ -336,10 +336,10 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
336 * ctx == 'struct seccomp_data *'. 336 * ctx == 'struct seccomp_data *'.
337 */ 337 */
338int sk_convert_filter(struct sock_filter *prog, int len, 338int sk_convert_filter(struct sock_filter *prog, int len,
339 struct sock_filter_int *new_prog, int *new_len) 339 struct bpf_insn *new_prog, int *new_len)
340{ 340{
341 int new_flen = 0, pass = 0, target, i; 341 int new_flen = 0, pass = 0, target, i;
342 struct sock_filter_int *new_insn; 342 struct bpf_insn *new_insn;
343 struct sock_filter *fp; 343 struct sock_filter *fp;
344 int *addrs = NULL; 344 int *addrs = NULL;
345 u8 bpf_src; 345 u8 bpf_src;
@@ -365,8 +365,8 @@ do_pass:
365 new_insn++; 365 new_insn++;
366 366
367 for (i = 0; i < len; fp++, i++) { 367 for (i = 0; i < len; fp++, i++) {
368 struct sock_filter_int tmp_insns[6] = { }; 368 struct bpf_insn tmp_insns[6] = { };
369 struct sock_filter_int *insn = tmp_insns; 369 struct bpf_insn *insn = tmp_insns;
370 370
371 if (addrs) 371 if (addrs)
372 addrs[i] = new_insn - new_prog; 372 addrs[i] = new_insn - new_prog;
@@ -913,7 +913,7 @@ static struct sk_filter *__sk_migrate_filter(struct sk_filter *fp,
913 * representation. 913 * representation.
914 */ 914 */
915 BUILD_BUG_ON(sizeof(struct sock_filter) != 915 BUILD_BUG_ON(sizeof(struct sock_filter) !=
916 sizeof(struct sock_filter_int)); 916 sizeof(struct bpf_insn));
917 917
918 /* Conversion cannot happen on overlapping memory areas, 918 /* Conversion cannot happen on overlapping memory areas,
919 * so we need to keep the user BPF around until the 2nd 919 * so we need to keep the user BPF around until the 2nd
@@ -945,7 +945,7 @@ static struct sk_filter *__sk_migrate_filter(struct sk_filter *fp,
945 945
946 fp->len = new_len; 946 fp->len = new_len;
947 947
948 /* 2nd pass: remap sock_filter insns into sock_filter_int insns. */ 948 /* 2nd pass: remap sock_filter insns into bpf_insn insns. */
949 err = sk_convert_filter(old_prog, old_len, fp->insnsi, &new_len); 949 err = sk_convert_filter(old_prog, old_len, fp->insnsi, &new_len);
950 if (err) 950 if (err)
951 /* 2nd sk_convert_filter() can fail only if it fails 951 /* 2nd sk_convert_filter() can fail only if it fails