cgroup: add foreign program to cgroup context
authorJulia Kartseva <hex@fb.com>
Tue, 2 Mar 2021 00:56:04 +0000 (16:56 -0800)
committerJulia Kartseva <hex@fb.com>
Sat, 10 Apr 2021 03:28:47 +0000 (20:28 -0700)
commitb894ef1b712433e07cd5f11b8f84dfaa0ce5a4ef
tree3d5b97e495031cab41c5b5213a74799b7fe71635
parent9984f4933b7d1310c6fd24c8d90878d66a5d19d9
cgroup: add foreign program to cgroup context

- Store foreign bpf programs in cgroup context. A program is considered
foreign if it was loaded to a kernel by an entity external to systemd,
so systemd is responsible only for attach and detach paths.
- Support the case of pinned bpf programs: pinning to bpffs so a program
is kept loaded to the kernel even when program fd is closed by a user
application is a common way to extend program's lifetime.
- Aadd linked list node struct with attach type and bpffs path
fields.
src/core/cgroup.c
src/core/cgroup.h