public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Rolv Apneseth <rolv.apneseth@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ignition] f44: patch: backport fix for SELinux relabelling failures when specifying a symlink for home_dir
Date: Tue, 15 Sep 2026 20:39:21 GMT [thread overview]
Message-ID: <178950476132.1.1965162709322829398.rpms-ignition-734bd4bc4fc0@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/ignition
Branch : f44
Commit : 734bd4bc4fc03cc22283439926aa24fa24a98feb
Author : Rolv Apneseth <rolv.apneseth@gmail.com>
Date : 2026-09-14T17:26:32+01:00
Stats : +76/-2 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ignition/c/734bd4bc4fc03cc22283439926aa24fa24a98feb?branch=f44
Log:
patch: backport fix for SELinux relabelling failures when specifying a symlink for home_dir
---
diff --git a/0001-internal-exec-stages-files-resolve-intermediate-syml.patch b/0001-internal-exec-stages-files-resolve-intermediate-syml.patch
new file mode 100644
index 0000000..d08417e
--- /dev/null
+++ b/0001-internal-exec-stages-files-resolve-intermediate-syml.patch
@@ -0,0 +1,63 @@
+From 6dd62cb069f1d7d214a50bebc0677800328986be Mon Sep 17 00:00:00 2001
+From: Rolv Apneseth <rolv.apneseth@gmail.com>
+Date: Tue, 1 Sep 2026 14:53:44 +0100
+Subject: [PATCH] internal/exec/stages/files: resolve intermediate symlinks in
+ relabel paths
+
+Due to a recent libselinux (3.11) update in the next/testing streams of
+FCOS, Software Factory nodes started failing provisioning.
+
+They had a home_dir: /home/zuul-worker defined in their butane config
+and were failing with a relabelling issue. With the 3.11 update
+(including
+https://github.com/SELinuxProject/selinux/commit/67bc978bfaf9e4d00883fbaf1f83f5fb6a0018ce),
+lstat() was replaced with safe_open() using O_NOFOLLOW on intermediate
+path components. This ended up exposing a latent bug in Ignition since
+only the final component was being resolved via ResolveSymlink(), so
+/home/user (where /home -> var/home on ostree) is passed unresolved.
+setfiles no longer resolves for us, leading to the failures.
+
+Avoid this issue by using JoinPath() to resolve intermediate symlinks in
+directory paths before passing them to setfiles for SELinux relabelling.
+
+https://github.com/coreos/ignition/pull/2316
+---
+ docs/release-notes.md | 1 +
+ internal/exec/stages/files/passwd.go | 17 +++++++++++++----
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/internal/exec/stages/files/passwd.go b/internal/exec/stages/files/passwd.go
+index 737e9cced..85f661945 100644
+--- a/internal/exec/stages/files/passwd.go
++++ b/internal/exec/stages/files/passwd.go
+@@ -80,17 +80,26 @@ func (s *stage) createPasswd(config types.Config) error {
+ return err
+ }
+
++ // Resolve intermediate symlinks in the homedir path.
++ // This is relevant on OSTree-based platforms, where
++ // /home is a symlink to var/home.
++ resolvedPath, err := s.JoinPath(homedir)
++ if err != nil {
++ return err
++ }
++ unprefixed := resolvedPath[len(s.DestDir):]
++
+ // Check if the homedir is actually a symlink, and make sure we
+ // relabel the target instead in that case. This is relevant on
+ // OSTree-based platforms, where /root is a link to /var/roothome.
+- if resolved, err := s.ResolveSymlink(homedir); err != nil {
++ if target, err := s.ResolveSymlink(unprefixed); err != nil {
+ return err
+- } else if resolved != "" {
++ } else if target != "" {
+ // note we don't relabel the symlink itself; we assume it's
+ // already properly labeled
+- s.relabel(resolved)
++ s.relabel(target)
+ } else {
+- s.relabel(homedir)
++ s.relabel(unprefixed)
+ }
+ }
+ }
diff --git a/ignition.spec b/ignition.spec
index a7ef237..ac430ca 100644
--- a/ignition.spec
+++ b/ignition.spec
@@ -22,7 +22,7 @@ Version: 2.27.0
%global dracutlibdir %{_prefix}/lib/dracut
Name: ignition
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: First boot installer and configuration tool
# Upstream license specification: Apache-2.0
@@ -32,6 +32,11 @@ Source0: %{gosource}
Source1: https://github.com/fedora-iot/ignition-edge/archive/%{ignedgecommit}/ignition-edge-%{ignedgeshortcommit}.tar.gz
Source2: 91-ignition-authorized-keys-file.conf
+# Backport fix for SELinux relabelling failures when specifying a symlink for home_dir
+# https://github.com/coreos/ignition/pull/2316
+# https://github.com/coreos/fedora-coreos-tracker/issues/2216
+Patch0: 0001-internal-exec-stages-files-resolve-intermediate-syml.patch
+
BuildRequires: libblkid-devel
BuildRequires: systemd-rpm-macros
@@ -225,7 +230,7 @@ Summary: Enablement glue for bootupd's grub2 config
License: Apache-2.0
# `ignition-grub` is a rename `ignition-ignition-grub` so let's obsolete `ignition-ignition-grub`
-Obsoletes: ignition-ignition-grub
+Obsoletes: ignition-ignition-grub < 2.21.0-2
%description grub
This package contains the grub2 config which is compatable with bootupd.
@@ -460,6 +465,12 @@ install -p -m 0755 ./ignition %{buildroot}/%{dracutlibdir}/modules.d/30ignition
%endif
%changelog
+* Mon Sep 14 2026 Rolv Apneseth <rapneset@redhat.com> - 2.27.0-3
+- Backport fix for SELinux relabelling failures when specifying a symlink for home_dir
+ https://github.com/coreos/ignition/pull/2316
+ https://github.com/coreos/fedora-coreos-tracker/issues/2216
+- Add version to ignition-ignition-grub Obsoletes to fix rpmbuild warning
+
* Wed Sep 02 2026 Klara Necasova <knecasov@redhat.com> - 2.27.0-2
- Update ignition-edge commit to include https://github.com/fedora-iot/ignition-edge/pull/12
reply other threads:[~2026-09-15 20:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178950476132.1.1965162709322829398.rpms-ignition-734bd4bc4fc0@fedoraproject.org \
--to=rolv.apneseth@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox