Skip to content

Commit 4b049a2

Browse files
[AutoPR- Security] Patch util-linux for CVE-2026-3184, CVE-2026-27456 [MEDIUM] (#16513)
1 parent b7d79bf commit 4b049a2

7 files changed

Lines changed: 157 additions & 17 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
From 84b259d19569a6b073adec146a46e849085e65e0 Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Wed, 8 Apr 2026 14:14:23 +0000
4+
Subject: [PATCH] loopdev: add LOOPDEV_FL_NOFOLLOW to prevent symlink attacks
5+
(backport)
6+
7+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
8+
Upstream-reference: AI Backport of https://github.com/util-linux/util-linux/commit/f55f9906b4f6eeb2b4a4120317df9de935253c10.patch
9+
---
10+
include/loopdev.h | 3 ++-
11+
lib/loopdev.c | 12 ++++++++++--
12+
libmount/src/context_loopdev.c | 3 ++-
13+
3 files changed, 14 insertions(+), 4 deletions(-)
14+
15+
diff --git a/include/loopdev.h b/include/loopdev.h
16+
index 6d400d1..9e4ef23 100644
17+
--- a/include/loopdev.h
18+
+++ b/include/loopdev.h
19+
@@ -135,7 +135,8 @@ enum {
20+
LOOPDEV_FL_NOIOCTL = (1 << 6),
21+
LOOPDEV_FL_DEVSUBDIR = (1 << 7),
22+
LOOPDEV_FL_CONTROL = (1 << 8), /* system with /dev/loop-control */
23+
- LOOPDEV_FL_SIZELIMIT = (1 << 9)
24+
+ LOOPDEV_FL_SIZELIMIT = (1 << 9),
25+
+ LOOPDEV_FL_NOFOLLOW = (1 << 10) /* O_NOFOLLOW, don't follow symlinks */
26+
};
27+
28+
/*
29+
diff --git a/lib/loopdev.c b/lib/loopdev.c
30+
index d9ea1d4..d6ce572 100644
31+
--- a/lib/loopdev.c
32+
+++ b/lib/loopdev.c
33+
@@ -1170,7 +1170,10 @@ int loopcxt_set_backing_file(struct loopdev_cxt *lc, const char *filename)
34+
if (!lc)
35+
return -EINVAL;
36+
37+
- lc->filename = canonicalize_path(filename);
38+
+ if (lc->flags & LOOPDEV_FL_NOFOLLOW)
39+
+ lc->filename = strdup(filename);
40+
+ else
41+
+ lc->filename = canonicalize_path(filename);
42+
if (!lc->filename)
43+
return -errno;
44+
45+
@@ -1305,7 +1308,12 @@ int loopcxt_setup_device(struct loopdev_cxt *lc)
46+
if (lc->config.info.lo_flags & LO_FLAGS_READ_ONLY)
47+
mode = O_RDONLY;
48+
49+
- if ((file_fd = open(lc->filename, mode | O_CLOEXEC)) < 0) {
50+
+ int flags = O_CLOEXEC;
51+
+ if (lc->config.info.lo_flags & LO_FLAGS_DIRECT_IO)
52+
+ flags |= O_DIRECT;
53+
+ if (lc->flags & LOOPDEV_FL_NOFOLLOW)
54+
+ flags |= O_NOFOLLOW;
55+
+ if ((file_fd = open(lc->filename, mode | flags)) < 0) {
56+
if (mode != O_RDONLY && (errno == EROFS || errno == EACCES))
57+
file_fd = open(lc->filename, mode = O_RDONLY);
58+
59+
diff --git a/libmount/src/context_loopdev.c b/libmount/src/context_loopdev.c
60+
index 6462bfb..2fedd01 100644
61+
--- a/libmount/src/context_loopdev.c
62+
+++ b/libmount/src/context_loopdev.c
63+
@@ -289,7 +289,8 @@ int mnt_context_setup_loopdev(struct libmnt_context *cxt)
64+
}
65+
66+
DBG(LOOP, ul_debugobj(cxt, "not found; create a new loop device"));
67+
- rc = loopcxt_init(&lc, 0);
68+
+ rc = loopcxt_init(&lc,
69+
+ mnt_context_is_restricted(cxt) ? LOOPDEV_FL_NOFOLLOW : 0);
70+
if (rc)
71+
goto done_no_deinit;
72+
if (loopval) {
73+
--
74+
2.45.4
75+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From aa7b7544c233a413e26608a89678ed814a691968 Mon Sep 17 00:00:00 2001
2+
From: Karel Zak <kzak@redhat.com>
3+
Date: Thu, 19 Feb 2026 12:20:28 +0100
4+
Subject: [PATCH] login: use original FQDN for PAM_RHOST
5+
6+
When login -h <remotehost> is invoked, init_remote_info() strips the
7+
local domain suffix from the hostname (FQDN to short name) before
8+
storing it in cxt->hostname. This truncated value is then used for
9+
PAM_RHOST, which can bypass pam_access host deny rules that match on
10+
the FQDN.
11+
12+
Preserve the original -h hostname in a new cmd_hostname field and use
13+
it for PAM_RHOST, while keeping the truncated hostname for utmp/wtmp
14+
and logging unchanged.
15+
16+
Note, the real-world impact is low -- login -h is only used by legacy
17+
telnet/rlogin daemons, and exploitation requires FQDN-specific
18+
pam_access rules on a system still using these obsolete services.
19+
20+
Reported-by: Asim Viladi Oglu Manizada <manizada@pm.me>
21+
Signed-off-by: Karel Zak <kzak@redhat.com>
22+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
23+
Upstream-reference: https://github.com/util-linux/util-linux/commit/8b29aeb081e297e48c4c1ac53d88ae07e1331984.patch
24+
---
25+
login-utils/login.c | 5 ++++-
26+
1 file changed, 4 insertions(+), 1 deletion(-)
27+
28+
diff --git a/login-utils/login.c b/login-utils/login.c
29+
index c6cd340..527b04a 100644
30+
--- a/login-utils/login.c
31+
+++ b/login-utils/login.c
32+
@@ -127,6 +127,7 @@ struct login_context {
33+
char *thishost; /* this machine */
34+
char *thisdomain; /* this machine's domain */
35+
char *hostname; /* remote machine */
36+
+ char *cmd_hostname; /* remote machine as specified on command line */
37+
char hostaddress[16]; /* remote address */
38+
39+
pid_t pid;
40+
@@ -886,7 +887,7 @@ static pam_handle_t *init_loginpam(struct login_context *cxt)
41+
42+
/* hostname & tty are either set to NULL or their correct values,
43+
* depending on how much we know. */
44+
- rc = pam_set_item(pamh, PAM_RHOST, cxt->hostname);
45+
+ rc = pam_set_item(pamh, PAM_RHOST, cxt->cmd_hostname);
46+
if (is_pam_failure(rc))
47+
loginpam_err(pamh, rc);
48+
49+
@@ -1223,6 +1224,8 @@ static void init_remote_info(struct login_context *cxt, char *remotehost)
50+
51+
get_thishost(cxt, &domain);
52+
53+
+ cxt->cmd_hostname = xstrdup(remotehost);
54+
+
55+
if (domain && (p = strchr(remotehost, '.')) &&
56+
strcasecmp(p + 1, domain) == 0)
57+
*p = '\0';
58+
--
59+
2.45.4
60+

SPECS/util-linux/util-linux.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Utilities for file systems, consoles, partitions, and messages
22
Name: util-linux
33
Version: 2.37.4
4-
Release: 10%{?dist}
4+
Release: 11%{?dist}
55
License: GPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -16,6 +16,8 @@ Patch0: libblkid-src-probe-check-for-ENOMEDIUM.patch
1616
Patch1: 0001-wall-fix-escape-sequence-Injection-CVE-2024-28085.patch
1717
Patch2: CVE-2025-14104.patch
1818
Patch3: skip-lsns-ioctl_ns-test-if-unshare-fails.patch
19+
Patch4: CVE-2026-27456.patch
20+
Patch5: CVE-2026-3184.patch
1921
BuildRequires: audit-devel
2022
BuildRequires: libcap-ng-devel
2123
BuildRequires: libselinux-devel
@@ -155,6 +157,9 @@ rm -rf %{buildroot}/lib/systemd/system
155157
%{_mandir}/man3/*
156158

157159
%changelog
160+
* Wed Apr 08 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.37.4-11
161+
- Patch for CVE-2026-3184, CVE-2026-27456
162+
158163
* Wed Dec 17 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.37.4-10
159164
- Patch for CVE-2025-14104
160165

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ make-4.3-3.cm2.aarch64.rpm
6666
patch-2.7.6-8.cm2.aarch64.rpm
6767
libcap-ng-0.8.2-2.cm2.aarch64.rpm
6868
libcap-ng-devel-0.8.2-2.cm2.aarch64.rpm
69-
util-linux-2.37.4-10.cm2.aarch64.rpm
70-
util-linux-devel-2.37.4-10.cm2.aarch64.rpm
71-
util-linux-libs-2.37.4-10.cm2.aarch64.rpm
69+
util-linux-2.37.4-11.cm2.aarch64.rpm
70+
util-linux-devel-2.37.4-11.cm2.aarch64.rpm
71+
util-linux-libs-2.37.4-11.cm2.aarch64.rpm
7272
tar-1.34-3.cm2.aarch64.rpm
7373
xz-5.2.5-2.cm2.aarch64.rpm
7474
xz-devel-5.2.5-2.cm2.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ make-4.3-3.cm2.x86_64.rpm
6666
patch-2.7.6-8.cm2.x86_64.rpm
6767
libcap-ng-0.8.2-2.cm2.x86_64.rpm
6868
libcap-ng-devel-0.8.2-2.cm2.x86_64.rpm
69-
util-linux-2.37.4-10.cm2.x86_64.rpm
70-
util-linux-devel-2.37.4-10.cm2.x86_64.rpm
71-
util-linux-libs-2.37.4-10.cm2.x86_64.rpm
69+
util-linux-2.37.4-11.cm2.x86_64.rpm
70+
util-linux-devel-2.37.4-11.cm2.x86_64.rpm
71+
util-linux-libs-2.37.4-11.cm2.x86_64.rpm
7272
tar-1.34-3.cm2.x86_64.rpm
7373
xz-5.2.5-2.cm2.x86_64.rpm
7474
xz-devel-5.2.5-2.cm2.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,11 @@ texinfo-6.8-1.cm2.aarch64.rpm
572572
texinfo-debuginfo-6.8-1.cm2.aarch64.rpm
573573
unzip-6.0-22.cm2.aarch64.rpm
574574
unzip-debuginfo-6.0-22.cm2.aarch64.rpm
575-
util-linux-2.37.4-10.cm2.aarch64.rpm
576-
util-linux-debuginfo-2.37.4-10.cm2.aarch64.rpm
577-
util-linux-devel-2.37.4-10.cm2.aarch64.rpm
578-
util-linux-lang-2.37.4-10.cm2.aarch64.rpm
579-
util-linux-libs-2.37.4-10.cm2.aarch64.rpm
575+
util-linux-2.37.4-11.cm2.aarch64.rpm
576+
util-linux-debuginfo-2.37.4-11.cm2.aarch64.rpm
577+
util-linux-devel-2.37.4-11.cm2.aarch64.rpm
578+
util-linux-lang-2.37.4-11.cm2.aarch64.rpm
579+
util-linux-libs-2.37.4-11.cm2.aarch64.rpm
580580
which-2.21-8.cm2.aarch64.rpm
581581
which-debuginfo-2.21-8.cm2.aarch64.rpm
582582
xz-5.2.5-2.cm2.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,11 @@ texinfo-6.8-1.cm2.x86_64.rpm
578578
texinfo-debuginfo-6.8-1.cm2.x86_64.rpm
579579
unzip-6.0-22.cm2.x86_64.rpm
580580
unzip-debuginfo-6.0-22.cm2.x86_64.rpm
581-
util-linux-2.37.4-10.cm2.x86_64.rpm
582-
util-linux-debuginfo-2.37.4-10.cm2.x86_64.rpm
583-
util-linux-devel-2.37.4-10.cm2.x86_64.rpm
584-
util-linux-lang-2.37.4-10.cm2.x86_64.rpm
585-
util-linux-libs-2.37.4-10.cm2.x86_64.rpm
581+
util-linux-2.37.4-11.cm2.x86_64.rpm
582+
util-linux-debuginfo-2.37.4-11.cm2.x86_64.rpm
583+
util-linux-devel-2.37.4-11.cm2.x86_64.rpm
584+
util-linux-lang-2.37.4-11.cm2.x86_64.rpm
585+
util-linux-libs-2.37.4-11.cm2.x86_64.rpm
586586
which-2.21-8.cm2.x86_64.rpm
587587
which-debuginfo-2.21-8.cm2.x86_64.rpm
588588
xz-5.2.5-2.cm2.x86_64.rpm

0 commit comments

Comments
 (0)