systemd 257.13-7: fix render/systemd-journal group regressions and repair the STIG build variant - #1671
Open
dcasota wants to merge 1 commit into
Open
systemd 257.13-7: fix render/systemd-journal group regressions and repair the STIG build variant#1671dcasota wants to merge 1 commit into
dcasota wants to merge 1 commit into
Conversation
… variant Five defects, each invisible in some constellations and fatal in others. 257.13-6 (group regressions, affect EVERY constellation) 0004: also drop the SUBSYSTEM=="accel" rule from 50-udev-default.rules.in. The same patch removes the "render" group from sysusers.d/basic.conf.in but left the accel rule referencing it, so systemd-udevd logs "50-udev-default.rules:56 Unknown group 'render', ignoring." on every boot of every install. systemd 253 had no accel rule; the regression arrived with the 253->257 rebase. The dev branch (255.10) already deletes this line. 0004: stop emptying sysusers.d/systemd-journal.conf.in. dracut 109 builds the initrd's /etc/group by running systemd-sysusers against the shipped snippets; with the entry removed the snippet is a no-op, so the initrd has no systemd-journal group while 11systemd-tmpfiles still installs tmpfiles.d/systemd.conf, which references it on five lines. Every boot logs five "Failed to resolve group 'systemd-journal'" from inside the initrd. Harmless under dracut 059, which copied the group in explicitly; a real gap since the 109 bump on 5.0. Pin -Dsystemd-journal-gid=23 to match filesystem's static group file. The meson default is 0, which meson.build maps to "-" (dynamic allocation), so restoring the sysusers entry without this would let systemd-sysusers pick an arbitrary GID in the initrd and mis-own /run/log/journal across switch-root. 257.13-7 (STIG build variant, affects only STIG_HARDEN=1) Ship harden-tmpfs-mount-options.patch. It was referenced by the STIG conditional but existed only under SPECS/90/systemd; it was dropped from this directory in 17c9365 "systemd: upgrade to v257.13". Replace the plain define of STIG_HARDEN with a define-if-unset so the flag can be set from pkg_build_options.json or rpmbuild -D. A plain define in the spec body beats -D, which made every STIG conditional unreachable and thus never parsed, built or tested. Switch to unnumbered "Patch:" so rpm assigns indices. The conditional STIG patch and 0005-default-conf-modifications.patch had both been given index 4; once STIG_HARDEN is reachable that is a hard "error: patch 4 defined multiple times" with no prep section emitted. Non-STIG builds are unchanged: the expanded %prep is byte-identical before and after at subrelease 91 and 92. Change-Id: I430c22804c50d5a9cae83043139f4de787ef2864 Signed-off-by: Daniel Casota <dcasota@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five defects in
SPECS/systemd, split across two release bumps because they affect different constellations.Constellation map
accel/renderudev rule50-udev-default.rules:56 Unknown group 'render', ignoring.each bootsystemd-journalsysusers snippetFailed to resolve group 'systemd-journal'from inside the initrd, each bootsystemd-sysusersallocates an arbitrary GID in the initrdharden-tmpfs-mount-options.patchSTIG_HARDEN=1onlyPatch4:STIG_HARDEN=1onlyerror: patch 4 defined multiple times, no%prepemittedThe last two are why nobody noticed:
STIG_HARDENis pinned to0by a spec-body define that beats-D, so that whole variant has never been parsed, built or tested.257.13-6 — two group regressions
render.0004-Remove-unused-default-groups-rules-and-tmpfiles.patchdeletes therendergroup fromsysusers.d/basic.conf.inand removes thedrm/kfdrules, but leftSUBSYSTEM=="accel", GROUP="render"as a context line. systemd 253 had no accel rule — the regression arrived with the 253→257 rebase. Upstreamdev(255.10) already deletes it. Extended the deletion hunk.systemd-journal. Not missing from the system — it exists at GID 23 fromfilesystem's group file. It is missing from the initrd, and only since dracut 109. dracut 109 builds the initrd's/etc/groupby runningsystemd-sysusersagainst the shipped snippets (11systemd-journald→inst_sysusers systemd-journal.conf;78systemd-sysusers→systemd-sysusers --root=$initdir). Patch 0004 empties that snippet, so it is a no-op — while11systemd-tmpfilesstill installstmpfiles.d/systemd.conf, which references the group on lines 22, 23, 27, 28, 29. Exactly the five errors seen per boot. dracut 059 copied the group in explicitly, so this was harmless until the 109 bump.Fixed at the root by restoring the sysusers entry, plus pinning
-Dsystemd-journal-gid=23, which is required:meson.build:963isconf.set(name, val > 0 ? val : '-')andmeson_options.txt:320defaults it to0, so without the pin the GID would be dynamic and/run/log/journalwould be mis-owned across switch-root.257.13-7 — repair the STIG build variant
harden-tmpfs-mount-options.patchwas referenced by the conditional but lived only inSPECS/90/systemd/; it was dropped from this directory in17c93651f "systemd: upgrade to v257.13". Shipped here, and verified to apply cleanly to 257.13.%define STIG_HARDEN 0→%{!?STIG_HARDEN: %global STIG_HARDEN 0}, so the flag is settable frompkg_build_options.json/-D. Verified: a spec-body define beats--define, which is why the variant was unreachable.Patch list converted to unnumbered
Patch:. Two independent edits had both chosen index 4. Auto-numbering removes the collision class, not just this instance.Why the tmpfs patch belongs here and not in ansible
/lib/systemd/system/tmp.mountis owned by this package and is not marked as a config file. An install-time edit would show as permanentrpm -Vdrift and be reverted by the next systemd upgrade. That is whyphoton-os-installerdeliberately skips the equivalent ansible controlPHTN-50-000245(stigenable.py:17, since the feature landed in Dec 2023). This is the owning side of that split — a comment in the spec now says so, to stop someone "fixing" the skip.Worth knowing: because the owning side was dead, neither side delivered the control. On a freshly installed 5.0 VM,
/tmpis mountedrw,nosuid,nodev— nonoexec.Testing
Non-STIG builds are unchanged. Expanded
%prepdiffed before vs after at subrelease 91 and 92: byte-identical in both. The only preamble change is thePatch0:→Patch:spelling.Parse matrix, all
OK:50-security-hardening.conf50-security-hardening.conf50-security-hardening.stig.confPatch application against the real 257.13 tarball, in rpm's auto-numbered order — all six apply, no fuzz:
Post-application state:
Options=mode=1777,strictatime,nosuid,noexec,nodev,...(control delivered), zero survivingGROUP="render",systemd-journalsysusers entry present.support/spec-checker/check_spec.pyexits 0.Both group regressions are identical upstream on
vmware/photon@5.0.