|
2409 | 2409 | .errstr_unpriv = "",
|
2410 | 2410 | .prog_type = BPF_PROG_TYPE_CGROUP_SKB,
|
2411 | 2411 | },
|
| 2412 | +{ |
| 2413 | + "calls: several args with ref_obj_id", |
| 2414 | + .insns = { |
| 2415 | + /* Reserve at least sizeof(struct iphdr) bytes in the ring buffer. |
| 2416 | + * With a smaller size, the verifier would reject the call to |
| 2417 | + * bpf_tcp_raw_gen_syncookie_ipv4 before we can reach the |
| 2418 | + * ref_obj_id error. |
| 2419 | + */ |
| 2420 | + BPF_MOV64_IMM(BPF_REG_2, 20), |
| 2421 | + BPF_MOV64_IMM(BPF_REG_3, 0), |
| 2422 | + BPF_LD_MAP_FD(BPF_REG_1, 0), |
| 2423 | + BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_ringbuf_reserve), |
| 2424 | + /* if r0 == 0 goto <exit> */ |
| 2425 | + BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 3), |
| 2426 | + BPF_MOV64_REG(BPF_REG_1, BPF_REG_0), |
| 2427 | + BPF_MOV64_REG(BPF_REG_2, BPF_REG_0), |
| 2428 | + BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_tcp_raw_gen_syncookie_ipv4), |
| 2429 | + BPF_EXIT_INSN(), |
| 2430 | + }, |
| 2431 | + .fixup_map_ringbuf = { 2 }, |
| 2432 | + .result = REJECT, |
| 2433 | + .errstr = "more than one arg with ref_obj_id", |
| 2434 | + .prog_type = BPF_PROG_TYPE_SCHED_CLS, |
| 2435 | +}, |
0 commit comments