diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2022-09-30 19:25:18 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2022-10-06 21:33:55 +0900 |
commit | 87e462f71361a47b154865dc14032a27580dd4cb (patch) | |
tree | 760dcd2103f2216496d4d442e727306e8418337f /src/core/bpf-lsm.c | |
parent | 5a967e28873816806a8f1e7c6c7d1ac28369f8b9 (diff) | |
download | systemd-87e462f71361a47b154865dc14032a27580dd4cb.tar.gz |
libbpf: add compat helpers for libbpf down to 0.1.0
- new symbols are available from libbpf 0.6.0 so could be used with
libbpf.so.0, but we're sure the old symbols will be there and this
simplifies code
- detection at runtime should always work, regardless of whether systemd
has been compiled with older or newer libbpf and runs with older or newer
libbpf
Diffstat (limited to 'src/core/bpf-lsm.c')
-rw-r--r-- | src/core/bpf-lsm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/bpf-lsm.c b/src/core/bpf-lsm.c index 33c9322e7e..173221b9f1 100644 --- a/src/core/bpf-lsm.c +++ b/src/core/bpf-lsm.c @@ -72,7 +72,7 @@ static int prepare_restrict_fs_bpf(struct restrict_fs_bpf **ret_obj) { sym_bpf_map__name(obj->maps.cgroup_hash)); /* Dummy map to satisfy the verifier */ - inner_map_fd = sym_bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(uint32_t), sizeof(uint32_t), 128U, NULL); + inner_map_fd = compat_bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(uint32_t), sizeof(uint32_t), 128U, NULL); if (inner_map_fd < 0) return log_error_errno(errno, "bpf-lsm: Failed to create BPF map: %m"); @@ -202,7 +202,7 @@ int lsm_bpf_unit_restrict_filesystems(Unit *u, const Set *filesystems, bool allo return log_unit_error_errno(u, SYNTHETIC_ERRNO(EINVAL), "bpf-lsm: BPF LSM object is not installed, has setup failed?"); - int inner_map_fd = sym_bpf_map_create( + int inner_map_fd = compat_bpf_map_create( BPF_MAP_TYPE_HASH, NULL, sizeof(uint32_t), |