Lines Matching refs:prog

43                 BPFProgram *prog,  in bpf_prog_allow_list_device()  argument
51 assert(prog); in bpf_prog_allow_list_device()
75 r = bpf_program_add_instructions(prog, insn + 3, ELEMENTSOF(insn) - 3); in bpf_prog_allow_list_device()
77 r = bpf_program_add_instructions(prog, insn, ELEMENTSOF(insn)); in bpf_prog_allow_list_device()
85 BPFProgram *prog, in bpf_prog_allow_list_major() argument
92 assert(prog); in bpf_prog_allow_list_major()
115 r = bpf_program_add_instructions(prog, insn + 3, ELEMENTSOF(insn) - 3); in bpf_prog_allow_list_major()
117 r = bpf_program_add_instructions(prog, insn, ELEMENTSOF(insn)); in bpf_prog_allow_list_major()
125 BPFProgram *prog, in bpf_prog_allow_list_class() argument
131 assert(prog); in bpf_prog_allow_list_class()
153 r = bpf_program_add_instructions(prog, insn + 3, ELEMENTSOF(insn) - 3); in bpf_prog_allow_list_class()
155 r = bpf_program_add_instructions(prog, insn, ELEMENTSOF(insn)); in bpf_prog_allow_list_class()
187 _cleanup_(bpf_program_freep) BPFProgram *prog = NULL; in bpf_devices_cgroup_init()
195 r = bpf_program_new(BPF_PROG_TYPE_CGROUP_DEVICE, "sd_devices", &prog); in bpf_devices_cgroup_init()
200 r = bpf_program_add_instructions(prog, pre_insn, ELEMENTSOF(pre_insn)); in bpf_devices_cgroup_init()
205 *ret = TAKE_PTR(prog); in bpf_devices_cgroup_init()
211 BPFProgram **prog, in bpf_devices_apply_policy() argument
222 assert(prog); in bpf_devices_apply_policy()
223 if (!*prog) in bpf_devices_apply_policy()
241 r = bpf_program_add_instructions(*prog, post_insn, ELEMENTSOF(post_insn)); in bpf_devices_apply_policy()
246 for (size_t off = 0; off < (*prog)->n_instructions; off++) { in bpf_devices_apply_policy()
247 struct bpf_insn *ins = &((*prog)->instructions[off]); in bpf_devices_apply_policy()
250 ins->off = (*prog)->n_instructions - off - 1; in bpf_devices_apply_policy()
254 r = bpf_program_add_instructions(*prog, exit_insn, ELEMENTSOF(exit_insn)); in bpf_devices_apply_policy()
262 r = bpf_program_cgroup_attach(*prog, BPF_CGROUP_DEVICE, controller_path, BPF_F_ALLOW_MULTI); in bpf_devices_apply_policy()
271 *prog_installed = TAKE_PTR(*prog); in bpf_devices_apply_policy()
331 BPFProgram *prog, in allow_list_device_pattern() argument
341 if (!prog) in allow_list_device_pattern()
345 return bpf_prog_allow_list_device(prog, type, *maj, *min, acc); in allow_list_device_pattern()
347 return bpf_prog_allow_list_major(prog, type, *maj, acc); in allow_list_device_pattern()
349 return bpf_prog_allow_list_class(prog, type, acc); in allow_list_device_pattern()
375 BPFProgram *prog, in bpf_devices_allow_list_device() argument
410 return allow_list_device_pattern(prog, path, S_ISCHR(mode) ? 'c' : 'b', &maj, &min, acc); in bpf_devices_allow_list_device()
414 BPFProgram *prog, in bpf_devices_allow_list_major() argument
429 return allow_list_device_pattern(prog, path, type, NULL, NULL, acc); in bpf_devices_allow_list_major()
434 return allow_list_device_pattern(prog, path, type, &maj, NULL, acc); in bpf_devices_allow_list_major()
491 (void) allow_list_device_pattern(prog, path, type, &maj, NULL, acc); in bpf_devices_allow_list_major()
502 BPFProgram *prog, in bpf_devices_allow_list_static() argument
520 k = bpf_devices_allow_list_device(prog, path, node, acc); in bpf_devices_allow_list_static()
526 k = bpf_devices_allow_list_major(prog, path, "pts", 'c', "rw"); in bpf_devices_allow_list_static()