From: Ludwig Nussel Date: Mon, 8 Apr 2024 09:07:10 +0000 (+0200) Subject: nsresourced: don't redefine of bpf_rdonly_cast X-Git-Tag: v256-rc1~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7705e2191a7c3ee8426b0a5e0b9432f1781f759;p=thirdparty%2Fsystemd.git nsresourced: don't redefine of bpf_rdonly_cast bpf_rdonly_cast() was introduced in libbpf commit 688879f together with the definition of a bpf_core_cast macro. So use that one to avoid defining a prototype for bpf_rdonly_cast; --- diff --git a/src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c b/src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c index c9a936ba13c..126422bb69c 100644 --- a/src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c +++ b/src/nsresourced/bpf/userns_restrict/userns-restrict.bpf.c @@ -20,7 +20,12 @@ #include #include +#ifndef bpf_core_cast +/* bpf_rdonly_cast() was introduced in libbpf commit 688879f together with + * the definition of a bpf_core_cast macro. So use that one to avoid + * defining a prototype for bpf_rdonly_cast */ void *bpf_rdonly_cast(void *, __u32) __ksym; +#endif /* BPF module that implements an allowlist of mounts (identified by mount ID) for user namespaces (identified * by their inode number in nsfs) that restricts creation of inodes (which would inherit the callers UID/GID)