Question about LSM with eBPF
Quoted 8 lines
From: Roberto Sassu
Sent: Friday, February 11, 2022 12:58 PM
HiI'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