|
| 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 | + |
0 commit comments