Skip to content

Commit 45a736f

Browse files
[HIGH] Patch cloud-init for CVE-2024-6174 & [MEDIUM] CVE-2024-11584 (microsoft#14132)
Co-authored-by: jslobodzian <[email protected]>
1 parent 6a177c1 commit 45a736f

File tree

3 files changed

+152
-1
lines changed

3 files changed

+152
-1
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
From 4761429040c00f69f4d29503697093a36b81b199 Mon Sep 17 00:00:00 2001
2+
From: archana25-ms <[email protected]>
3+
Date: Sat, 28 Jun 2025 08:34:37 +0000
4+
Subject: [PATCH] Address CVE-2024-11584
5+
Upstream Patch Reference: https://github.com/canonical/cloud-init/pull/6265/commits/6e10240a7f0a2d6110b398640b3fd46cfa9a7cf3
6+
7+
---
8+
systemd/cloud-init-hotplugd.service | 2 +-
9+
systemd/cloud-init-hotplugd.socket | 5 +++--
10+
tools/hook-hotplug | 2 +-
11+
3 files changed, 5 insertions(+), 4 deletions(-)
12+
13+
diff --git a/systemd/cloud-init-hotplugd.service b/systemd/cloud-init-hotplugd.service
14+
index 598c647..a6f41d1 100644
15+
--- a/systemd/cloud-init-hotplugd.service
16+
+++ b/systemd/cloud-init-hotplugd.service
17+
@@ -1,5 +1,5 @@
18+
# Paired with cloud-init-hotplugd.socket to read from the FIFO
19+
-# /run/cloud-init/hook-hotplug-cmd which is created during a udev network
20+
+# hook-hotplug-cmd which is created during a udev network
21+
# add or remove event as processed by 10-cloud-init-hook-hotplug.rules.
22+
23+
# On start, read args from the FIFO, process and provide structured arguments
24+
diff --git a/systemd/cloud-init-hotplugd.socket b/systemd/cloud-init-hotplugd.socket
25+
index aa09301..80386ca 100644
26+
--- a/systemd/cloud-init-hotplugd.socket
27+
+++ b/systemd/cloud-init-hotplugd.socket
28+
@@ -1,5 +1,5 @@
29+
# cloud-init-hotplugd.socket listens on the FIFO file
30+
-# /run/cloud-init/hook-hotplug-cmd which is created during a udev network
31+
+# hook-hotplug-cmd which is created during a udev network
32+
# add or remove event as processed by 10-cloud-init-hook-hotplug.rules.
33+
34+
# Known bug with an enforcing SELinux policy: LP: #1936229
35+
@@ -7,7 +7,8 @@
36+
Description=cloud-init hotplug hook socket
37+
38+
[Socket]
39+
-ListenFIFO=/run/cloud-init/hook-hotplug-cmd
40+
+ListenFIFO=/run/cloud-init/share/hook-hotplug-cmd
41+
+SocketMode=0600
42+
43+
[Install]
44+
WantedBy=cloud-init.target
45+
diff --git a/tools/hook-hotplug b/tools/hook-hotplug
46+
index 35bd3da..2a2ed48 100755
47+
--- a/tools/hook-hotplug
48+
+++ b/tools/hook-hotplug
49+
@@ -10,7 +10,7 @@ is_finished() {
50+
51+
if is_finished; then
52+
# open cloud-init's hotplug-hook fifo rw
53+
- exec 3<>/run/cloud-init/hook-hotplug-cmd
54+
+ exec 3<>/run/cloud-init/share/hook-hotplug-cmd
55+
env_params=(
56+
--subsystem="${SUBSYSTEM}"
57+
handle
58+
--
59+
2.45.3
60+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
From 96e4f3dc6d907cc8e45ed2d98c3cc99438208138 Mon Sep 17 00:00:00 2001
2+
From: archana25-ms <[email protected]>
3+
Date: Sat, 28 Jun 2025 07:59:48 +0000
4+
Subject: [PATCH] Address CVE-2024-6174
5+
Upstream Patch Reference: https://github.com/canonical/cloud-init/commit/8c3ae1bb9f1d80fbf217b41a222ee434e7f58900
6+
7+
---
8+
tests/unittests/test_ds_identify.py | 13 ++++++-------
9+
tools/ds-identify | 8 ++++----
10+
2 files changed, 10 insertions(+), 11 deletions(-)
11+
12+
diff --git a/tests/unittests/test_ds_identify.py b/tests/unittests/test_ds_identify.py
13+
index 80813fc..099803a 100644
14+
--- a/tests/unittests/test_ds_identify.py
15+
+++ b/tests/unittests/test_ds_identify.py
16+
@@ -58,9 +58,9 @@ BLKID_UEFI_UBUNTU = [
17+
18+
19+
POLICY_FOUND_ONLY = "search,found=all,maybe=none,notfound=disabled"
20+
-POLICY_FOUND_OR_MAYBE = "search,found=all,maybe=all,notfound=disabled"
21+
-DI_DEFAULT_POLICY = "search,found=all,maybe=all,notfound=disabled"
22+
-DI_DEFAULT_POLICY_NO_DMI = "search,found=all,maybe=all,notfound=enabled"
23+
+POLICY_FOUND_OR_MAYBE = "search,found=all,maybe=none,notfound=disabled"
24+
+DI_DEFAULT_POLICY = "search,found=all,maybe=none,notfound=disabled"
25+
+DI_DEFAULT_POLICY_NO_DMI = "search,found=all,maybe=none,notfound=enabled"
26+
DI_EC2_STRICT_ID_DEFAULT = "true"
27+
OVF_MATCH_STRING = "http://schemas.dmtf.org/ovf/environment/1"
28+
29+
@@ -570,7 +570,7 @@ class TestDsIdentify(DsIdentifyBase):
30+
self._test_ds_found("OpenStack-AssetTag-Compute")
31+
32+
def test_openstack_on_non_intel_is_maybe(self):
33+
- """On non-Intel, openstack without dmi info is maybe.
34+
+ """On non-Intel, openstack without dmi info is none.
35+
36+
nova does not identify itself on platforms other than intel.
37+
https://bugs.launchpad.net/cloud-init/+bugs?field.tag=dsid-nova"""
38+
@@ -590,10 +590,9 @@ class TestDsIdentify(DsIdentifyBase):
39+
40+
# updating the uname to ppc64 though should get a maybe.
41+
data.update({"mocks": [MOCK_VIRT_IS_KVM, MOCK_UNAME_IS_PPC64]})
42+
- (_, _, err, _, _) = self._check_via_dict(
43+
- data, RC_FOUND, dslist=["OpenStack", "None"]
44+
- )
45+
+ (_, _, err, _, _) = self._check_via_dict(data, RC_NOT_FOUND)
46+
self.assertIn("check for 'OpenStack' returned maybe", err)
47+
+ self.assertIn("No ds found", err)
48+
49+
def test_default_ovf_is_found(self):
50+
"""OVF is identified found when ovf/ovf-env.xml seed file exists."""
51+
diff --git a/tools/ds-identify b/tools/ds-identify
52+
index e5120ac..39b139b 100755
53+
--- a/tools/ds-identify
54+
+++ b/tools/ds-identify
55+
@@ -14,7 +14,7 @@
56+
# The format is:
57+
# <mode>,found=value,maybe=value,notfound=value
58+
# default setting is:
59+
-# search,found=all,maybe=all,notfound=disabled
60+
+# search,found=all,maybe=none,notfound=disabled
61+
#
62+
# kernel command line option: ci.di.policy=<policy>
63+
# example line in /etc/cloud/ds-identify.cfg:
64+
@@ -40,7 +40,7 @@
65+
# first: use the first found do no further checking
66+
# all: enable all DS_FOUND
67+
#
68+
-# maybe: (default=all)
69+
+# maybe: (default=none)
70+
# if nothing returned 'found', then how to handle maybe.
71+
# no network sources are allowed to return 'maybe'.
72+
# all: enable all DS_MAYBE
73+
@@ -94,8 +94,8 @@ DI_MAIN=${DI_MAIN:-main}
74+
75+
DI_BLKID_EXPORT_OUT=""
76+
DI_GEOM_LABEL_STATUS_OUT=""
77+
-DI_DEFAULT_POLICY="search,found=all,maybe=all,notfound=${DI_DISABLED}"
78+
-DI_DEFAULT_POLICY_NO_DMI="search,found=all,maybe=all,notfound=${DI_ENABLED}"
79+
+DI_DEFAULT_POLICY="search,found=all,maybe=none,notfound=${DI_DISABLED}"
80+
+DI_DEFAULT_POLICY_NO_DMI="search,found=all,maybe=none,notfound=${DI_ENABLED}"
81+
DI_DMI_BOARD_NAME=""
82+
DI_DMI_CHASSIS_ASSET_TAG=""
83+
DI_DMI_PRODUCT_NAME=""
84+
--
85+
2.45.3
86+

SPECS/cloud-init/cloud-init.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Summary: Cloud instance init scripts
55
Name: cloud-init
66
Epoch: 1
77
Version: %{package_version}
8-
Release: 6%{?dist}
8+
Release: 7%{?dist}
99
License: GPLv3
1010
Vendor: Microsoft Corporation
1111
Distribution: Mariner
@@ -22,6 +22,8 @@ Patch3: 0001-feat-azure-Add-ProvisionGuestProxyAgent-OVF-setting.patch
2222
Patch4: 0002-feat-azure-parse-ProvisionGuestProxyAgent-as-bool-51.patch
2323
Patch5: 0003-feat-azure-add-support-for-azure-proxy-agent.patch
2424
Patch6: 0001-add-PPS-support-for-azure-proxy-agent.patch
25+
Patch7: CVE-2024-6174.patch
26+
Patch8: CVE-2024-11584.patch
2527
%define cl_services cloud-config.service cloud-config.target cloud-final.service cloud-init.service cloud-init.target cloud-init-local.service
2628
BuildRequires: automake
2729
BuildRequires: dbus
@@ -163,6 +165,9 @@ make check %{?_smp_mflags}
163165
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/10-azure-kvp.cfg
164166

165167
%changelog
168+
* Sat Jun 28 2025 Archana Shettigar <[email protected]> - 1:23.3-7
169+
- Patch CVE-2024-6174 & CVE-2024-11584
170+
166171
* Tue Dec 10 2024 Minghe Ren <[email protected]> - 1:23.3-6
167172
- Add module-setup.sh to prevent an intermittent issue where ephemeral disk not being formatted on Azure
168173

0 commit comments

Comments
 (0)