public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/util-linux] f43: upgrade to stable v2.41.6
Date: Thu, 22 Oct 2026 10:27:36 GMT [thread overview]
Message-ID: <179266485697.1.3270913148245043934.rpms-util-linux-3c2d2992b05b@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/util-linux
Branch : f43
Commit : 3c2d2992b05b4a61264368e544f4065740c2c1c7
Author : Karel Zak <kzak@redhat.com>
Date : 2026-10-22T12:27:02+02:00
Stats : +569/-1 in 12 file(s)
URL : https://src.fedoraproject.org/rpms/util-linux/c/3c2d2992b05b4a61264368e544f4065740c2c1c7?branch=f43
Log:
upgrade to stable v2.41.6
- improved libmount security (CVE-2026-76642, CVE-2026-78410)
- fix unshare file descritor leak (CVE-2026-78408)
---
diff --git a/.gitignore b/.gitignore
index e14d473..0fda717 100644
--- a/.gitignore
+++ b/.gitignore
@@ -104,3 +104,4 @@
/util-linux-2.41.3.tar.xz
/util-linux-2.41.4.tar.xz
/util-linux-2.41.5.tar.xz
+/util-linux-2.41.6.tar.xz
diff --git a/0000-libmount-add-missing-fileutils.h-include-to-hook_idm.patch b/0000-libmount-add-missing-fileutils.h-include-to-hook_idm.patch
new file mode 100644
index 0000000..39e55b1
--- /dev/null
+++ b/0000-libmount-add-missing-fileutils.h-include-to-hook_idm.patch
@@ -0,0 +1,38 @@
+From 79c2881c27a0b40889cd5433d9f125689826d1d2 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Wed, 2 Sep 2026 13:32:27 +0200
+Subject: libmount: add missing fileutils.h include to hook_idmap.c
+
+The hook_idmap.c uses RESOLVE_NO_SYMLINKS (added by commit fb8e26535)
+but does not include fileutils.h, which provides the fallback #define
+for this constant.
+
+On Fedora (glibc 2.40+), this is masked because glibc's
+<bits/fcntl-linux.h> transitively includes <linux/openat2.h>, which
+defines RESOLVE_NO_SYMLINKS. On Ubuntu (and other distros with older
+glibc), <fcntl.h> does not pull in openat2.h, so the build fails:
+
+ hook_idmap.c:335:33: error: 'RESOLVE_NO_SYMLINKS' undeclared
+
+Fixes: fb8e26535 ("libmount: pin source path with openat2() for restricted users")
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit 7e2e010874b10b3aabdc3c4c844c9ffc46a4a374)
+---
+ libmount/src/hook_idmap.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libmount/src/hook_idmap.c b/libmount/src/hook_idmap.c
+index 97d8e0d1e..d4d7fbacc 100644
+--- a/libmount/src/hook_idmap.c
++++ b/libmount/src/hook_idmap.c
+@@ -23,6 +23,7 @@
+
+ #include "strutils.h"
+ #include "all-io.h"
++#include "fileutils.h"
+ #include "namespace.h"
+
+ #include "mountP.h"
+--
+2.56.0
+
diff --git a/0001-nsenter-close-cgroup.procs-fd-after-join-to-prevent-.patch b/0001-nsenter-close-cgroup.procs-fd-after-join-to-prevent-.patch
new file mode 100644
index 0000000..aa91e8a
--- /dev/null
+++ b/0001-nsenter-close-cgroup.procs-fd-after-join-to-prevent-.patch
@@ -0,0 +1,74 @@
+From 485dbb67f1b6bb18e08b1b77f4aa2373ff3a705b Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 3 Sep 2026 12:17:14 +0200
+Subject: nsenter: close cgroup.procs fd after join to prevent authority leak
+ [CVE-2026-78408]
+
+The --join-cgroup option opens the target's cgroup.procs while running
+as root and writes nsenter's own PID to migrate itself. The descriptor
+was left open across subsequent namespace transitions, credential drops
+(setgroups/setgid/setuid) and execve().
+
+The kernel performs cgroup migration permission checks using the
+credentials captured at open time (file->f_cred). An open cgroup.procs
+descriptor therefore carries the opener's migration authority regardless
+of later privilege changes. A program executed inside the target
+namespace inherits root's cgroup migration capability even when running
+as an unprivileged user with no capabilities.
+
+Fix this by:
+
+ - closing the temporary /proc/PID/cgroup fd after reading the path
+ - adding O_CLOEXEC to the cgroup.procs open as defense in depth
+ - closing cgroup_procs_fd immediately after the self-migration write
+ - initializing the temporary cgroup fd to -1 instead of 0 to avoid
+ accidentally closing stdin via open_target_fd()
+
+The descriptor has no legitimate use after the single migration write.
+
+Introduced-by: b40650b71a74 ("nsenter: add option -c to join the cgroup of target process")
+References: b0cf1cf0d255 ("nsenter: close cgroup.procs fd after join to prevent authority leak")
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit afe067c979b9ba2cbe856f7c6411210120ea62aa)
+---
+ sys-utils/nsenter.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c
+index 9d9d90a48..99f1da3a0 100644
+--- a/sys-utils/nsenter.c
++++ b/sys-utils/nsenter.c
+@@ -379,7 +379,7 @@ static int get_ns_ino(const char *path, ino_t *ino)
+ static void open_cgroup_procs(void)
+ {
+ char *buf = NULL, *path = NULL, *p;
+- int cgroup_fd = 0;
++ int cgroup_fd = -1;
+ char fdpath[PATH_MAX];
+
+ open_target_fd(&cgroup_fd, "cgroup", optarg);
+@@ -387,6 +387,8 @@ static void open_cgroup_procs(void)
+ if (read_all_alloc(cgroup_fd, &buf) < 1)
+ err(EXIT_FAILURE, _("failed to get cgroup path"));
+
++ close(cgroup_fd);
++
+ p = strtok(buf, "\n");
+ if (p)
+ path = strrchr(p, ':');
+@@ -816,8 +818,11 @@ int main(int argc, char *argv[])
+ }
+
+ // Join into the target cgroup
+- if (cgroup_procs_fd >= 0)
++ if (cgroup_procs_fd >= 0) {
+ join_into_cgroup();
++ close(cgroup_procs_fd);
++ cgroup_procs_fd = -1;
++ }
+
+ if (uid_gid_fd >= 0) {
+ struct stat st;
+--
+2.56.0
+
diff --git a/0002-lib-fileutils-fix-unused-parameter-warnings-without-.patch b/0002-lib-fileutils-fix-unused-parameter-warnings-without-.patch
new file mode 100644
index 0000000..d59ea1e
--- /dev/null
+++ b/0002-lib-fileutils-fix-unused-parameter-warnings-without-.patch
@@ -0,0 +1,63 @@
+From 339ff352b7b8b868367d2370ed077675326c3bca Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 3 Sep 2026 09:45:29 +0200
+Subject: lib/fileutils: fix unused parameter warnings without SYS_openat2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On systems without SYS_openat2 (older kernels), ul_openat_resolve()
+is a stub that returns -ENOSYS, making all parameters unused. With
+-Werror=unused-parameter this breaks the build.
+
+Move the #ifdef around the whole function so each branch has its own
+declaration — the SYS_openat2 branch uses all parameters normally,
+the fallback branch marks them __unused__.
+
+Fixes: fb8e26535 ("libmount: pin source path with openat2() for restricted users")
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit a471b62e732a491f1abe42450352fb0f9b5b43ea)
+---
+ lib/fileutils.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/lib/fileutils.c b/lib/fileutils.c
+index c60070855..1142febb0 100644
+--- a/lib/fileutils.c
++++ b/lib/fileutils.c
+@@ -351,10 +351,10 @@ char *ul_basename(char *path)
+ return p;
+ }
+
++#if defined(SYS_openat2)
+ int ul_openat_resolve(int dirfd, const char *path, int flags,
+ mode_t mode, unsigned long long resolve)
+ {
+-#if defined(SYS_openat2)
+ struct open_how how = {
+ .flags = (__u64) flags,
+ .mode = (__u64) mode,
+@@ -362,11 +362,19 @@ int ul_openat_resolve(int dirfd, const char *path, int flags,
+ };
+
+ return syscall(SYS_openat2, dirfd, path, &how, sizeof(how));
++}
+ #else
++int ul_openat_resolve(
++ int dirfd __attribute__((__unused__)),
++ const char *path __attribute__((__unused__)),
++ int flags __attribute__((__unused__)),
++ mode_t mode __attribute__((__unused__)),
++ unsigned long long resolve __attribute__((__unused__)))
++{
+ errno = ENOSYS;
+ return -1;
+-#endif
+ }
++#endif
+
+ int ul_open_no_symlinks(const char *path, int flags, mode_t mode)
+ {
+--
+2.56.0
+
diff --git a/0003-libmount-use-USE_LIBMOUNT_MOUNTFD_SUPPORT-for-idmap-.patch b/0003-libmount-use-USE_LIBMOUNT_MOUNTFD_SUPPORT-for-idmap-.patch
new file mode 100644
index 0000000..f6c0501
--- /dev/null
+++ b/0003-libmount-use-USE_LIBMOUNT_MOUNTFD_SUPPORT-for-idmap-.patch
@@ -0,0 +1,114 @@
+From 233cf7321e9d0fd2cea901d0a97e565c725640ad Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 3 Sep 2026 10:01:29 +0200
+Subject: libmount: use USE_LIBMOUNT_MOUNTFD_SUPPORT for idmap hook
+
+The idmap hookset was originally guarded by HAVE_MOUNTFD_API (kernel
+headers have the new mount syscalls) rather than
+USE_LIBMOUNT_MOUNTFD_SUPPORT (libmount is built with mountfd support).
+
+This was intentional (commit 9040c0900, 2022) -- the idea was to keep
+idmap working even with --disable-libmount-mountfd-support by calling
+the raw open_tree() syscall directly, while using an inner #ifdef
+USE_LIBMOUNT_MOUNTFD_SUPPORT to optionally reuse the sysapi fd_tree.
+
+This fine-grained approach broke when the CVE-2026-78410 fix replaced
+the raw open_tree() call with mnt_open_tree(), which is only available
+under USE_LIBMOUNT_MOUNTFD_SUPPORT. The build fails with
+--disable-libmount-mountfd-support because mnt_open_tree() is
+undeclared.
+
+Rather than maintaining two code paths for a feature that fundamentally
+depends on the new mount API, gate the entire idmap hookset on
+USE_LIBMOUNT_MOUNTFD_SUPPORT -- consistent with how hookset_mount is
+guarded. Remove the now-redundant inner #ifdef.
+
+Also add a note to mount.8 that X-mount.idmap requires the new
+fd-based mount API.
+
+Addresses: https://github.com/util-linux/util-linux/issues/4598
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit e06799ac325a881a297d2ffd6fe568cacdcd00ab)
+---
+ libmount/src/hook_idmap.c | 6 ++----
+ libmount/src/hooks.c | 2 +-
+ libmount/src/version.c | 2 +-
+ sys-utils/mount.8.adoc | 1 +
+ 4 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/libmount/src/hook_idmap.c b/libmount/src/hook_idmap.c
+index d4d7fbacc..94c025097 100644
+--- a/libmount/src/hook_idmap.c
++++ b/libmount/src/hook_idmap.c
+@@ -32,7 +32,7 @@
+ # include <linux/nsfs.h>
+ #endif
+
+-#if defined(HAVE_MOUNTFD_API) && defined(HAVE_LINUX_MOUNT_H)
++#ifdef USE_LIBMOUNT_MOUNTFD_SUPPORT
+
+ typedef enum idmap_type_t {
+ ID_TYPE_UID, /* uidmap entry */
+@@ -317,7 +317,6 @@ static int hook_mount_post(
+ * Once a mount has been attached to the filesystem it can't be
+ * idmapped anymore. So create a new detached mount.
+ */
+-#ifdef USE_LIBMOUNT_MOUNTFD_SUPPORT
+ {
+ struct libmnt_sysapi *api = mnt_context_get_sysapi(cxt);
+
+@@ -327,7 +326,6 @@ static int hook_mount_post(
+ DBG(HOOK, ul_debugobj(hs, " reuse tree FD"));
+ }
+ }
+-#endif
+ if (fd_tree < 0)
+ fd_tree = mnt_open_tree(AT_FDCWD, target,
+ OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC |
+@@ -544,4 +542,4 @@ const struct libmnt_hookset hookset_idmap =
+ .deinit = hookset_deinit
+ };
+
+-#endif /* HAVE_MOUNTFD_API && HAVE_LINUX_MOUNT_H */
++#endif /* USE_LIBMOUNT_MOUNTFD_SUPPORT */
+diff --git a/libmount/src/hooks.c b/libmount/src/hooks.c
+index 23eca4efd..5ae91edd7 100644
+--- a/libmount/src/hooks.c
++++ b/libmount/src/hooks.c
+@@ -45,7 +45,7 @@ static const struct libmnt_hookset *const hooksets[] =
+ &hookset_mount,
+ #endif
+ &hookset_mount_legacy,
+-#if defined(HAVE_MOUNTFD_API) && defined(HAVE_LINUX_MOUNT_H)
++#ifdef USE_LIBMOUNT_MOUNTFD_SUPPORT
+ &hookset_idmap,
+ #endif
+ &hookset_owner
+diff --git a/libmount/src/version.c b/libmount/src/version.c
+index 3b61618b5..5c70ebf8a 100644
+--- a/libmount/src/version.c
++++ b/libmount/src/version.c
+@@ -37,7 +37,7 @@ static const char *lib_features[] = {
+ #ifdef USE_LIBMOUNT_SUPPORT_NAMESPACES
+ "namespaces",
+ #endif
+-#if defined(HAVE_MOUNTFD_API) && defined(HAVE_LINUX_MOUNT_H)
++#ifdef USE_LIBMOUNT_MOUNTFD_SUPPORT
+ "idmapping",
+ #endif
+ #ifdef USE_LIBMOUNT_MOUNTFD_SUPPORT
+diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc
+index add2914ae..4bc1bb0f9 100644
+--- a/sys-utils/mount.8.adoc
++++ b/sys-utils/mount.8.adoc
+@@ -790,6 +790,7 @@ Set _mountpoint_'s mode after mounting.
+
+ *X-mount.idmap*=__id-type__:__id-mount__:__id-host__:__id-range__ [__id-type__:__id-mount__:__id-host__:__id-range__], *X-mount.idmap*=__file__::
+ Use this option to create an idmapped mount.
++This feature requires the new file-descriptor-based mount API (available since Linux 5.2).
+ An idmapped mount allows to change ownership of all files located under a mount according to the ID-mapping associated with a user namespace.
+ The ownership change is tied to the lifetime and localized to the relevant mount.
+ The relevant ID-mapping can be specified in two ways:
+--
+2.56.0
+
diff --git a/0004-tools-add-non-newmount.conf-config-gen-profile.patch b/0004-tools-add-non-newmount.conf-config-gen-profile.patch
new file mode 100644
index 0000000..973e621
--- /dev/null
+++ b/0004-tools-add-non-newmount.conf-config-gen-profile.patch
@@ -0,0 +1,28 @@
+From 6438dec3ef477bc0272336e89921b77ebd57cbea Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 3 Sep 2026 10:15:43 +0200
+Subject: tools: add non-newmount.conf config-gen profile
+
+Add a configuration profile to test builds with
+--disable-libmount-mountfd-support, useful for verifying that libmount
+compiles without the new fd-based mount API.
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit b8159405b99af7af2054f9f8222cf23901368a01)
+---
+ tools/config-gen.d/non-newmount.conf | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100644 tools/config-gen.d/non-newmount.conf
+
+diff --git a/tools/config-gen.d/non-newmount.conf b/tools/config-gen.d/non-newmount.conf
+new file mode 100644
+index 000000000..303b6cbad
+--- /dev/null
++++ b/tools/config-gen.d/non-newmount.conf
+@@ -0,0 +1,3 @@
++include:core.conf
++
++--disable-libmount-mountfd-support
+--
+2.56.0
+
diff --git a/0005-lib-fileutils-fix-RESOLVE_NO_SYMLINKS-fallback-value.patch b/0005-lib-fileutils-fix-RESOLVE_NO_SYMLINKS-fallback-value.patch
new file mode 100644
index 0000000..08c6f0c
--- /dev/null
+++ b/0005-lib-fileutils-fix-RESOLVE_NO_SYMLINKS-fallback-value.patch
@@ -0,0 +1,71 @@
+From ba905a1874959c70fd706aa7d49df61076864e0a Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 8 Sep 2026 10:26:38 +0200
+Subject: lib/fileutils: fix RESOLVE_NO_SYMLINKS fallback value
+
+The fallback #define used 0x02, but that is RESOLVE_NO_MAGICLINKS.
+The correct value, as used by the kernel and glibc, is 0x04.
+
+The fallback is not dead code: no libmount source includes
+<linux/openat2.h>, and glibc provides the RESOLVE_* macros only via
+<bits/openat2.h>, which is a recent addition. On older glibc libmount
+then asks openat2() to block magic-links instead of symlinks. The
+syscall succeeds and follows the symlink, so the protection in
+mnt_context_open_tree(), hook_mount.c and hook_idmap.c is silently
+ineffective.
+
+Move the <linux/openat2.h> include from lib/fileutils.c to
+include/fileutils.h so all users get the kernel values, and correct
+the fallback.
+
+Fixes: b9e07ce6f ("lib/fileutils: add ul_openat_resolve() openat2 wrapper")
+Addresses: https://github.com/util-linux/util-linux/issues/4606
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit 20361d66df4d3f32d5e137fe61a55cdf156c91f0)
+---
+ include/fileutils.h | 6 +++++-
+ lib/fileutils.c | 4 ----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/include/fileutils.h b/include/fileutils.h
+index 09395620a..0b36104be 100644
+--- a/include/fileutils.h
++++ b/include/fileutils.h
+@@ -11,6 +11,10 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+
++#ifdef HAVE_LINUX_OPENAT2_H
++# include <linux/openat2.h>
++#endif
++
+ #include "c.h"
+
+ extern int mkstemp_cloexec(char *template);
+@@ -66,7 +70,7 @@ extern int ul_openat_resolve(int dirfd, const char *path, int flags,
+ mode_t mode, unsigned long long resolve);
+
+ #ifndef RESOLVE_NO_SYMLINKS
+-# define RESOLVE_NO_SYMLINKS 0x02
++# define RESOLVE_NO_SYMLINKS 0x04
+ #endif
+ #ifndef RESOLVE_BENEATH
+ # define RESOLVE_BENEATH 0x08
+diff --git a/lib/fileutils.c b/lib/fileutils.c
+index 1142febb0..8ca2c0aae 100644
+--- a/lib/fileutils.c
++++ b/lib/fileutils.c
+@@ -16,10 +16,6 @@
+ #include <fcntl.h>
+ #include <errno.h>
+
+-#ifdef HAVE_LINUX_OPENAT2_H
+-# include <linux/openat2.h>
+-#endif
+-
+ #include "c.h"
+ #include "all-io.h"
+ #include "fileutils.h"
+--
+2.56.0
+
diff --git a/0006-wall-fix-off-by-one-in-is_gr_member-group-matching.patch b/0006-wall-fix-off-by-one-in-is_gr_member-group-matching.patch
new file mode 100644
index 0000000..9a5c82a
--- /dev/null
+++ b/0006-wall-fix-off-by-one-in-is_gr_member-group-matching.patch
@@ -0,0 +1,36 @@
+From 56e83de535ae1df9228d3b1cbf978b3e36b5d959 Mon Sep 17 00:00:00 2001
+From: gmkbenjamin <3827682+gmkbenjamin@users.noreply.github.com>
+Date: Sun, 27 Sep 2026 18:20:51 +1000
+Subject: wall: fix off-by-one in is_gr_member() group matching
+
+is_gr_member() tested buf->groups[ngroups], one past the valid range
+0..ngroups-1 filled by getgrouplist(). The extra slot (zero-initialized
+GID 0, or stale on reuse) let a non-member pass `wall --group`, and read
+one past the initialized array. Iterate over 0..ngroups-1 instead so only
+actual group members match.
+
+Fixes: https://github.com/util-linux/util-linux/issues/4654
+Signed-off-by: gmkbenjamin <3827682+gmkbenjamin@users.noreply.github.com>
+(cherry picked from commit ac280f2f34588d1a22a699b3e55fc147b27e6a2e)
+---
+ term-utils/wall.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/term-utils/wall.c b/term-utils/wall.c
+index c1c47d531..1891a5049 100644
+--- a/term-utils/wall.c
++++ b/term-utils/wall.c
+@@ -183,8 +183,8 @@ static int is_gr_member(const char *login, const struct group_workspace *buf)
+ _("getgrouplist found more groups than sysconf allows"));
+ }
+
+- for (; ngroups >= 0; --ngroups) {
+- if (buf->requested_group == (gid_t) buf->groups[ngroups])
++ for (int i = 0; i < ngroups; i++) {
++ if (buf->requested_group == (gid_t) buf->groups[i])
+ return 1;
+ }
+
+--
+2.56.0
+
diff --git a/0007-login-use-O_CREAT-on-lastlog.patch b/0007-login-use-O_CREAT-on-lastlog.patch
new file mode 100644
index 0000000..065eac5
--- /dev/null
+++ b/0007-login-use-O_CREAT-on-lastlog.patch
@@ -0,0 +1,27 @@
+From c819fd4196bd8ba3de628d840424a8b20cedc802 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 2 Dec 2025 16:15:44 +0100
+Subject: login: use O_CREAT on lastlog
+
+Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=151635
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ login-utils/login.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/login-utils/login.c b/login-utils/login.c
+index 321f9d6ce..edc69fd9a 100644
+--- a/login-utils/login.c
++++ b/login-utils/login.c
+@@ -682,7 +682,7 @@ static void log_lastlog(struct login_context *cxt)
+ sa.sa_handler = SIG_IGN;
+ sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
+
+- fd = open(_PATH_LASTLOG, O_RDWR, 0);
++ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
+ if (fd < 0)
+ goto done;
+ offset = cxt->pwd->pw_uid * sizeof(ll);
+--
+2.56.0
+
diff --git a/0008-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch b/0008-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch
new file mode 100644
index 0000000..45d02bc
--- /dev/null
+++ b/0008-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch
@@ -0,0 +1,27 @@
+From 5fdc591ff9f1db035f87b98b3646cda435357444 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 2 Dec 2025 16:17:55 +0100
+Subject: login: add /run/motd.d` to the hardcoded MOTD_FILE
+
+Addresses: https://github.com/coreos/console-login-helper-messages/issues/60
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ include/pathnames.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/pathnames.h b/include/pathnames.h
+index 34ba11ca3..c91a077e1 100644
+--- a/include/pathnames.h
++++ b/include/pathnames.h
+@@ -41,7 +41,7 @@
+ #ifndef _PATH_MAILDIR
+ # define _PATH_MAILDIR "/var/spool/mail"
+ #endif
+-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
++#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
+ #ifndef _PATH_NOLOGIN
+ # define _PATH_NOLOGIN "/etc/nologin"
+ #endif
+--
+2.56.0
+
diff --git a/0009-libmount-disable-EROFS-backing-file-support.patch b/0009-libmount-disable-EROFS-backing-file-support.patch
new file mode 100644
index 0000000..016c49c
--- /dev/null
+++ b/0009-libmount-disable-EROFS-backing-file-support.patch
@@ -0,0 +1,89 @@
+From 25e2e7581a6134bdd63207353bb9dd80e0ad555a Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 24 Jun 2025 10:56:58 +0200
+Subject: libmount: disable EROFS backing file support
+
+Let's temporarily use the old reliable loop devices rather than directly
+mounting EROFS images. It seems some tools need to adapt to the change.
+See https://github.com/dracut-ng/dracut-ng/issues/1384
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ libmount/src/context_mount.c | 35 -----------------------------------
+ libmount/src/hook_loopdev.c | 7 -------
+ 2 files changed, 42 deletions(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index 80c45beeb..64b0ab16d 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -985,24 +985,6 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt)
+ return rc;
+ }
+
+-static int is_erofs_regfile(struct libmnt_context *cxt)
+-{
+- const char *type = mnt_fs_get_fstype(cxt->fs);
+- const char *src = mnt_fs_get_srcpath(cxt->fs);
+- unsigned long flags = 0;
+- struct stat st;
+-
+- if (!type || strcmp(type, "erofs") != 0)
+- return 0;
+- if (mnt_context_get_user_mflags(cxt, &flags))
+- return 0;
+- if (flags & (MNT_MS_LOOP | MNT_MS_OFFSET | MNT_MS_SIZELIMIT))
+- return 0; /* it's already loopdev */
+- if (!src || stat(src, &st) != 0 || !S_ISREG(st.st_mode))
+- return 0;
+- return 1;
+-}
+-
+ /**
+ * mnt_context_mount:
+ * @cxt: mount context
+@@ -1107,23 +1089,6 @@ again:
+ }
+ }
+
+- /*
+- * Try mount EROFS image again with loop device.
+- * See hook_loopdev.c:is_loopdev_required() for more details.
+- */
+- if (rc && mnt_context_get_syscall_errno(cxt) == ENOTBLK
+- && is_erofs_regfile(cxt)) {
+- struct libmnt_optlist *ol = mnt_context_get_optlist(cxt);
+-
+- mnt_context_reset_status(cxt);
+- DBG(CXT, ul_debugobj(cxt, "enabling loop= for EROFS"));
+- mnt_optlist_append_flags(ol, MNT_MS_LOOP, cxt->map_userspace);
+-
+- rc = mnt_context_call_hooks(cxt, MNT_STAGE_PREP_SOURCE);
+- if (!rc)
+- goto again;
+- }
+-
+ if (rc == 0 && !is_mount_stage_failed(cxt))
+ rc = mnt_context_call_hooks(cxt, MNT_STAGE_POST);
+
+diff --git a/libmount/src/hook_loopdev.c b/libmount/src/hook_loopdev.c
+index af9a52227..835c93a20 100644
+--- a/libmount/src/hook_loopdev.c
++++ b/libmount/src/hook_loopdev.c
+@@ -478,13 +478,6 @@ static int is_loopdev_required(struct libmnt_context *cxt, struct libmnt_optlist
+ }
+ }
+
+- /* The EROFS kernel driver can be compiled with EROFS_FS_BACKED_BY_FILE,
+- * allowing for the mounting of a regular file as a filesystem without
+- * a loop device.
+- */
+- if (type && strcmp(type, "erofs") == 0)
+- return 0;
+-
+ /* Note that there is no restriction (on kernel side) that would
+ * prevent a regular file as a mount(2) source argument. A filesystem
+ * that is able to mount regular files could be implemented. For this
+--
+2.56.0
+
diff --git a/sources b/sources
index bfafc86..961d645 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (util-linux-2.41.5.tar.xz) = 25e7e79e0f0a4711a15c16db05357755536cf4dc9c0ee28447d95f9bfc135f23075d434e107269a65148a8c16b37755e913aacbaec03a3bdce171a9e0a46bfe8
+SHA512 (util-linux-2.41.6.tar.xz) = db63574a6e854c1b56876a125631ca94fcca77067f5b59c293f1b06b7765eb5e284d3cb6d31d319d6f7e9f7070881321fa6b8cc11f3453281454e9943e477560
reply other threads:[~2026-10-22 10:27 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=179266485697.1.3270913148245043934.rpms-util-linux-3c2d2992b05b@fedoraproject.org \
--to=kzak@redhat.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