Skip to contentSkip to conversation

Question about LSM with eBPF

DISCUSSION Roberto Sassu 1 participant 1 message Feb 11, 2022 BPF

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines

From: Roberto Sassu
Sent: Friday, February 11, 2022 12:58 PM
Hi

I'm working on an LSM implemented with eBPF. I have a question about persistence. Is it possible to keep the attached LSM running without the user space process that attached it?

Found a solution:

                        char path[PATH_MAX] = "/sys/fs/bpf/";

                        for (i = 0; i < skel->skeleton->prog_cnt; i++) {
                                snprintf(path + path_len,
                                         sizeof(path) - path_len, "%s",
                                         skel->skeleton->progs[i].name);
                                bpf_link__pin(*skel->skeleton->progs[i].link,
                                              path);
                        }

Roberto

HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Zhong Ronghua

Quoted 6 lines

Thanks

Roberto

HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Li Peng, Zhong Ronghua