You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
heavy facts: machine tier misses the caller's own cgroup cap; cache folder squat and TMPDIR nits #951
Follow-up from the #945 reviews. These are small points in the heavy kit's heavy facts. None of them blocks #945. Each one is listed so it is not lost.
The machine tier does not see the caller's own memory cap. With no systemd user manager (heavy capacity: callers without a systemd user manager always get NOT OK (CI runner users) #844), heavy facts answers from machine-wide numbers only. It does not read the cgroup that the caller itself runs in. A caller inside a container or a capped slice (for example a CI runner with MemoryMax=) can be told OK for a size that fits the machine but not its own cap. It also sends pieceCaps: true, although the caller's own work does not run in a heavy scope. The full tier has the same blind spot for user-<uid>.slice. Fix idea: read memory.max and memory.current of the caller's own cgroup (/proc/self/cgroup) and take the smaller room.
Someone else can take the /tmp/heavy-facts-<uid> name first. When there is no /run/user/<uid>, the cache goes in heavy-facts-<uid> under the temp folder. Another user can make that folder (or a file with that name) before this user does. heavy then refuses it and runs without a cache, so every call starts "elevated". That is safe, but it is a denial of the cache that anyone can cause. Fix idea: on refusal, try a name with a random part, or a folder under the user's home.
The cache folder is checked, then used by path. In a temp folder that is not sticky and that others can write (a $TMPDIR set that way), the cache folder is checked and then opened by its path. A swap between the two steps could point heavy at another folder. Fix idea: open the folder once with O_DIRECTORY | O_NOFOLLOW and do every later step with dir_fd.
A resolved home inside a non-sticky folder that others can write. HOME is resolved with realpath before it is checked (heavy: minors from the #770 reviews (~/.local mode, README repair line, linked ~/.local) #771). If the resolved home sits inside a folder that others can write and that is not sticky, a parent can still be swapped after the check. Fix idea: walk the path with O_NOFOLLOW folder handles, or refuse a home whose parents others can write.
Two more leftovers from the #945 round-2 reviews. Neither blocks #945; the README's Tiers paragraph now names both limits.
NSS users with no session are not read. In the machine tier, heavy facts reads other people's reserve.d for the users in /etc/passwd (UID in UID_MIN..UID_MAX) and for anyone with a user.slice session. A person whose account comes only from NSS (LDAP, sssd) and who has no session or linger right now is not read, so a reservation of theirs is not seen. This is the one fail-open gap left in the machine tier, and it is narrow. Fix idea: also read pwd.getpwall() (bounded, and only when NSS is configured), or keep it documented.
Every machine-tier call lists every passwd home. Each fresh read (every 5 s at most, through the cache) looks at each person's ~/.config/t3-capacity/reserve.d. On a host with autofs homes, that mounts every home each time. Fix idea: skip homes under an autofs mount point unless that user has a session, or read a machine-wide reservations folder instead (the heavy capacity: callers without a systemd user manager always get NOT OK (CI runner users) #844 follow-up).
Activity
scuttletoby commentedon Nov 22, 2026
Two more leftovers from the #945 round-2 reviews. Neither blocks #945; the README's Tiers paragraph now names both limits.
NSS users with no session are not read. In the machine tier,
heavy factsreads other people'sreserve.dfor the users in/etc/passwd(UID inUID_MIN..UID_MAX) and for anyone with auser.slicesession. A person whose account comes only from NSS (LDAP, sssd) and who has no session or linger right now is not read, so a reservation of theirs is not seen. This is the one fail-open gap left in the machine tier, and it is narrow. Fix idea: also readpwd.getpwall()(bounded, and only when NSS is configured), or keep it documented.Every machine-tier call lists every passwd home. Each fresh read (every 5 s at most, through the cache) looks at each person's
~/.config/t3-capacity/reserve.d. On a host with autofs homes, that mounts every home each time. Fix idea: skip homes under an autofs mount point unless that user has a session, or read a machine-wide reservations folder instead (the heavy capacity: callers without a systemd user manager always get NOT OK (CI runner users) #844 follow-up).🤖 Generated with Claude Code