From: Matteo Croce Date: Thu, 5 Jun 2025 08:00:05 +0000 (+0200) Subject: nspawn: create mountpoint for bpffs X-Git-Tag: v258-rc1~134^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a80c06cf02012da1ef869231f158300f5807c6ea;p=thirdparty%2Fsystemd.git nspawn: create mountpoint for bpffs When we mount a tmpfs as /sys, create a mountpoint for bpf, as we already do for cgroup --- diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index 2c538562721..be1c01caf9f 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -509,12 +509,14 @@ int mount_sysfs(const char *dest, MountSettingsMask mount_settings) { if (rmdir(full) < 0) return log_error_errno(errno, "Failed to remove %s: %m", full); - /* Create mountpoint for cgroups. Otherwise we are not allowed since we remount /sys/ read-only. */ - _cleanup_free_ char *x = path_join(top, "/fs/cgroup"); - if (!x) - return log_oom(); + /* Create mountpoints. Otherwise we are not allowed since we remount /sys/ read-only. */ + FOREACH_STRING(p, "/fs/cgroup", "/fs/bpf") { + _cleanup_free_ char *x = path_join(top, p); + if (!x) + return log_oom(); - (void) mkdir_p(x, 0755); + (void) mkdir_p(x, 0755); + } return mount_nofollow_verbose(LOG_ERR, NULL, top, NULL, MS_BIND|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT|extra_flags, NULL);