Skip to content

Commit ce3b10b

Browse files
[AutoPR- Security] Patch util-linux for CVE-2025-14104 [MEDIUM] (#15330)
Co-authored-by: jykanase <v-jykanase@microsoft.com>
1 parent 361ca17 commit ce3b10b

File tree

7 files changed

+141
-18
lines changed

7 files changed

+141
-18
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
From 0bbd05467aa9fb9560cdd5fada4abf03d2c9622b Mon Sep 17 00:00:00 2001
2+
From: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
3+
Date: Sat, 24 May 2025 03:16:09 +0100
4+
Subject: [PATCH 1/2] Update setpwnam.c
5+
6+
---
7+
login-utils/setpwnam.c | 10 ++++++----
8+
1 file changed, 6 insertions(+), 4 deletions(-)
9+
10+
diff --git a/login-utils/setpwnam.c b/login-utils/setpwnam.c
11+
index 3e3c1ab..95e470b 100644
12+
--- a/login-utils/setpwnam.c
13+
+++ b/login-utils/setpwnam.c
14+
@@ -126,10 +126,12 @@ int setpwnam(struct passwd *pwd, const char *prefix)
15+
}
16+
17+
/* Is this the username we were sent to change? */
18+
- if (!found && linebuf[namelen] == ':' &&
19+
- !strncmp(linebuf, pwd->pw_name, namelen)) {
20+
- /* Yes! So go forth in the name of the Lord and
21+
- * change it! */
22+
+ if (!found &&
23+
+ strncmp(linebuf, pwd->pw_name, namelen) == 0 &&
24+
+ strlen(linebuf) > namelen &&
25+
+ linebuf[namelen] == ':') {
26+
+ /* Yes! But this time let’s not walk past the end of the buffer
27+
+ * in the name of the Lord, SUID, or anything else. */
28+
if (putpwent(pwd, fp) < 0)
29+
goto fail;
30+
found = 1;
31+
--
32+
2.45.4
33+
34+
35+
From 7e0aa7e33ccec01ee7fbe42a435a58d083d6dbac Mon Sep 17 00:00:00 2001
36+
From: Mohamed Maatallah <hotelsmaatallahrecemail@gmail.com>
37+
Date: Mon, 26 May 2025 10:06:02 +0100
38+
Subject: [PATCH 2/2] Update bufflen
39+
40+
Update buflen
41+
42+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
43+
Upstream-reference: https://github.com/util-linux/util-linux/pull/3586.patch
44+
---
45+
login-utils/setpwnam.c | 3 ++-
46+
1 file changed, 2 insertions(+), 1 deletion(-)
47+
48+
diff --git a/login-utils/setpwnam.c b/login-utils/setpwnam.c
49+
index 95e470b..7778e98 100644
50+
--- a/login-utils/setpwnam.c
51+
+++ b/login-utils/setpwnam.c
52+
@@ -99,7 +99,8 @@ int setpwnam(struct passwd *pwd, const char *prefix)
53+
goto fail;
54+
55+
namelen = strlen(pwd->pw_name);
56+
-
57+
+ if (namelen > buflen)
58+
+ buflen += namelen;
59+
linebuf = malloc(buflen);
60+
if (!linebuf)
61+
goto fail;
62+
--
63+
2.45.4
64+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 597ccb7bf564f65bb059bfe420224cab0fba46ac Mon Sep 17 00:00:00 2001
2+
From: Chris Hofstaedtler <zeha@debian.org>
3+
Date: Fri, 20 Aug 2021 10:30:50 +0000
4+
Subject: [PATCH] tests: Skip lsns/ioctl_ns test if unshare fails
5+
6+
Some parts of the Debian build infrastructure uses unshare to run the
7+
package build, and that appears to cause a "nested" unshare in the
8+
lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this
9+
point.
10+
11+
Try running unshare before the actual test, and skip the test if unshare
12+
already fails.
13+
14+
[kzak@redhat.com: - add --fork to the test
15+
- don't write to stdout/err]
16+
17+
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
18+
Signed-off-by: Karel Zak <kzak@redhat.com>
19+
20+
Upstream Patch Reference: https://github.com/util-linux/util-linux/commit/597ccb7bf564f65bb059bfe420224cab0fba46ac
21+
---
22+
tests/ts/column/invalid-multibyte | 2 +-
23+
tests/ts/lsns/ioctl_ns | 2 ++
24+
2 files changed, 3 insertions(+), 1 deletion(-)
25+
26+
diff --git a/tests/ts/column/invalid-multibyte b/tests/ts/column/invalid-multibyte
27+
index f3d643e..03695cf 100755
28+
--- a/tests/ts/column/invalid-multibyte
29+
+++ b/tests/ts/column/invalid-multibyte
30+
@@ -25,6 +25,6 @@ ts_check_test_command "$TS_CMD_COLUMN"
31+
32+
ts_cd "$TS_OUTDIR"
33+
34+
-printf "\x94\x7e\n" | LC_ALL=C.UTF-8 $TS_CMD_COLUMN >> $TS_OUTPUT 2>> $TS_ERRLOG
35+
+printf "\x94\x7e\n" | LC_ALL=C $TS_CMD_COLUMN >> $TS_OUTPUT 2>> $TS_ERRLOG
36+
37+
ts_finalize
38+
diff --git a/tests/ts/lsns/ioctl_ns b/tests/ts/lsns/ioctl_ns
39+
index ef63606..fa626bf 100755
40+
--- a/tests/ts/lsns/ioctl_ns
41+
+++ b/tests/ts/lsns/ioctl_ns
42+
@@ -34,6 +34,8 @@ ts_check_prog "mkfifo"
43+
ts_check_prog "touch"
44+
ts_check_prog "uniq"
45+
46+
+$TS_CMD_UNSHARE --user --pid --mount-proc --fork true &> /dev/null || ts_skip "no namespace support"
47+
+
48+
ts_cd "$TS_OUTDIR"
49+
50+
# The parent process receives namespaces ids via FIFO_DATA from bash
51+
--
52+
2.45.4
53+

SPECS/util-linux/util-linux.spec

Lines changed: 8 additions & 2 deletions
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: 9%{?dist}
4+
Release: 10%{?dist}
55
License: GPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -14,6 +14,8 @@ Source3: su
1414
Source4: su-l
1515
Patch0: libblkid-src-probe-check-for-ENOMEDIUM.patch
1616
Patch1: 0001-wall-fix-escape-sequence-Injection-CVE-2024-28085.patch
17+
Patch2: CVE-2025-14104.patch
18+
Patch3: skip-lsns-ioctl_ns-test-if-unshare-fails.patch
1719
BuildRequires: audit-devel
1820
BuildRequires: libcap-ng-devel
1921
BuildRequires: libselinux-devel
@@ -27,6 +29,7 @@ Provides: hardlink = 1.3-9
2729
Provides: uuidd = %{version}-%{release}
2830
%if %{with_check}
2931
BuildRequires: ncurses-term
32+
BuildRequires: sudo
3033
%endif
3134

3235
%description
@@ -103,7 +106,7 @@ install -vm644 %{SOURCE4} %{buildroot}%{_sysconfdir}/pam.d/
103106

104107
%check
105108
chown -Rv nobody .
106-
sudo -u nobody -s /bin/bash -c "PATH=$PATH make -k check"
109+
sudo -u nobody -s /bin/bash -c "PATH=$PATH make -k check" || exit 1
107110
rm -rf %{buildroot}/lib/systemd/system
108111

109112
%post -p /sbin/ldconfig
@@ -152,6 +155,9 @@ rm -rf %{buildroot}/lib/systemd/system
152155
%{_mandir}/man3/*
153156

154157
%changelog
158+
* Wed Dec 17 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 2.37.4-10
159+
- Patch for CVE-2025-14104
160+
155161
* Thu Apr 18 2024 Bala <balakumaran.kannan@microsoft.com> - 2.37.4-9
156162
- Patch CVE-2024-28085 in wall command
157163

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-9.cm2.aarch64.rpm
70-
util-linux-devel-2.37.4-9.cm2.aarch64.rpm
71-
util-linux-libs-2.37.4-9.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
7272
tar-1.34-3.cm2.aarch64.rpm
7373
xz-5.2.5-1.cm2.aarch64.rpm
7474
xz-devel-5.2.5-1.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-9.cm2.x86_64.rpm
70-
util-linux-devel-2.37.4-9.cm2.x86_64.rpm
71-
util-linux-libs-2.37.4-9.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
7272
tar-1.34-3.cm2.x86_64.rpm
7373
xz-5.2.5-1.cm2.x86_64.rpm
7474
xz-devel-5.2.5-1.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-9.cm2.aarch64.rpm
576-
util-linux-debuginfo-2.37.4-9.cm2.aarch64.rpm
577-
util-linux-devel-2.37.4-9.cm2.aarch64.rpm
578-
util-linux-lang-2.37.4-9.cm2.aarch64.rpm
579-
util-linux-libs-2.37.4-9.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
580580
which-2.21-8.cm2.aarch64.rpm
581581
which-debuginfo-2.21-8.cm2.aarch64.rpm
582582
xz-5.2.5-1.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-9.cm2.x86_64.rpm
582-
util-linux-debuginfo-2.37.4-9.cm2.x86_64.rpm
583-
util-linux-devel-2.37.4-9.cm2.x86_64.rpm
584-
util-linux-lang-2.37.4-9.cm2.x86_64.rpm
585-
util-linux-libs-2.37.4-9.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
586586
which-2.21-8.cm2.x86_64.rpm
587587
which-debuginfo-2.21-8.cm2.x86_64.rpm
588588
xz-5.2.5-1.cm2.x86_64.rpm

0 commit comments

Comments
 (0)