From 39c0385bc88315ff1cb146b6576a5e47a33a364e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 16 2021 08:10:18 +0000 Subject: import NetworkManager-1.30.0-0.6.el8 --- diff --git a/.NetworkManager.metadata b/.NetworkManager.metadata index 06ef7cc..81b83ea 100644 --- a/.NetworkManager.metadata +++ b/.NetworkManager.metadata @@ -1 +1 @@ -a42a3bf6a689f9f24a1549e684321d24d07542e3 SOURCES/NetworkManager-1.29.7.tar.xz +fe3b6df65831420d80997073c5471b6426ebed62 SOURCES/NetworkManager-1.29.8.tar.xz diff --git a/.gitignore b/.gitignore index ed950a9..8d3b09f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/NetworkManager-1.29.7.tar.xz +SOURCES/NetworkManager-1.29.8.tar.xz diff --git a/SOURCES/1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch b/SOURCES/1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch new file mode 100644 index 0000000..ea58f3c --- /dev/null +++ b/SOURCES/1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch @@ -0,0 +1,219 @@ +From 2fb5ffa8eb51add722984c6d3d465a650ea34658 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Wed, 23 Dec 2020 14:21:21 +0100 +Subject: [PATCH 1/2] initrd: accept a zero-byte prefix for BOOTIF + +The BOOTIF MAC address can be prefixed with a hardware address +type. Typically it is 01 (for ethernet), but the legacy network module +accepts (and strips) any byte value. + +It seems wrong to take any address type without validation. In +addition to "01", also accept a zero type which, according to the +bugzilla below, is used in some configurations to mean "undefined". + +While at it, also accept ':' as separator for the first byte. + +https://bugzilla.redhat.com/show_bug.cgi?id=1904099 +https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/713 +(cherry picked from commit 6069ef4b8bb620da2329d0e60a0a8a260379d686) +--- + src/initrd/nmi-cmdline-reader.c | 23 ++++--- + src/initrd/tests/test-cmdline-reader.c | 89 +++++++++++++++----------- + 2 files changed, 66 insertions(+), 46 deletions(-) + +diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c +index 7c9982bbff7b..62891fa2cf20 100644 +--- a/src/initrd/nmi-cmdline-reader.c ++++ b/src/initrd/nmi-cmdline-reader.c +@@ -1154,14 +1154,21 @@ nmi_cmdline_reader_parse(const char *sysfs_dir, const char *const *argv, char ** + NMConnection * connection; + NMSettingWired *s_wired; + const char * bootif = bootif_val; +- +- if (!nm_utils_hwaddr_valid(bootif, ETH_ALEN) && g_str_has_prefix(bootif, "01-") +- && nm_utils_hwaddr_valid(&bootif[3], ETH_ALEN)) { +- /* +- * BOOTIF MAC address can be prefixed with a hardware type identifier. +- * "01" stays for "wired", no other are known. +- */ +- bootif += 3; ++ char prefix[4]; ++ ++ if (!nm_utils_hwaddr_valid(bootif, ETH_ALEN)) { ++ strncpy(prefix, bootif, 3); ++ prefix[3] = '\0'; ++ ++ if (NM_IN_STRSET(prefix, "01-", "01:", "00-", "00:") ++ && nm_utils_hwaddr_valid(&bootif[3], ETH_ALEN)) { ++ /* ++ * BOOTIF MAC address can be prefixed with a hardware type identifier. ++ * "01" stays for "wired", "00" is also accepted as it means "undefined". ++ * No others are known. ++ */ ++ bootif += 3; ++ } + } + + connection = reader_get_connection(reader, NULL, NM_SETTING_WIRED_SETTING_NAME, FALSE); +diff --git a/src/initrd/tests/test-cmdline-reader.c b/src/initrd/tests/test-cmdline-reader.c +index 07faf96a1f5c..a809dff93c91 100644 +--- a/src/initrd/tests/test-cmdline-reader.c ++++ b/src/initrd/tests/test-cmdline-reader.c +@@ -1952,58 +1952,71 @@ static void + test_bootif_hwtype(void) + { + gs_unref_hashtable GHashTable *connections = NULL; +- const char *const *ARGV = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03"); ++ const char *const *ARGV0 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03"); ++ const char *const *ARGV1 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=00-00-53-Ab-cD-02-03"); ++ const char *const *ARGV[] = {ARGV0, ARGV1}; + NMConnection * connection; + NMSettingWired * s_wired; + NMSettingIPConfig *s_ip4; + NMSettingIPConfig *s_ip6; + gs_free char * hostname = NULL; ++ guint i; + +- connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV, &hostname); +- g_assert(connections); +- g_assert_cmpint(g_hash_table_size(connections), ==, 2); +- g_assert_cmpstr(hostname, ==, NULL); ++ for (i = 0; i < G_N_ELEMENTS(ARGV); i++) { ++ connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV[i], &hostname); ++ g_assert(connections); ++ g_assert_cmpint(g_hash_table_size(connections), ==, 2); ++ g_assert_cmpstr(hostname, ==, NULL); + +- connection = g_hash_table_lookup(connections, "eth0"); +- g_assert(connection); +- nmtst_assert_connection_verifies_without_normalization(connection); +- g_assert_cmpstr(nm_connection_get_id(connection), ==, "eth0"); ++ connection = g_hash_table_lookup(connections, "eth0"); ++ g_assert(connection); ++ nmtst_assert_connection_verifies_without_normalization(connection); ++ g_assert_cmpstr(nm_connection_get_id(connection), ==, "eth0"); + +- s_wired = nm_connection_get_setting_wired(connection); +- g_assert(!nm_setting_wired_get_mac_address(s_wired)); +- g_assert(s_wired); ++ s_wired = nm_connection_get_setting_wired(connection); ++ g_assert(!nm_setting_wired_get_mac_address(s_wired)); ++ g_assert(s_wired); + +- s_ip4 = nm_connection_get_setting_ip4_config(connection); +- g_assert(s_ip4); +- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO); +- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); +- g_assert(!nm_setting_ip_config_get_may_fail(s_ip4)); ++ s_ip4 = nm_connection_get_setting_ip4_config(connection); ++ g_assert(s_ip4); ++ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ++ ==, ++ NM_SETTING_IP4_CONFIG_METHOD_AUTO); ++ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); ++ g_assert(!nm_setting_ip_config_get_may_fail(s_ip4)); + +- s_ip6 = nm_connection_get_setting_ip6_config(connection); +- g_assert(s_ip6); +- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO); +- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); ++ s_ip6 = nm_connection_get_setting_ip6_config(connection); ++ g_assert(s_ip6); ++ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), ++ ==, ++ NM_SETTING_IP6_CONFIG_METHOD_AUTO); ++ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); + +- connection = g_hash_table_lookup(connections, "bootif_connection"); +- g_assert(connection); +- nmtst_assert_connection_verifies_without_normalization(connection); +- g_assert_cmpstr(nm_connection_get_id(connection), ==, "BOOTIF Connection"); ++ connection = g_hash_table_lookup(connections, "bootif_connection"); ++ g_assert(connection); ++ nmtst_assert_connection_verifies_without_normalization(connection); ++ g_assert_cmpstr(nm_connection_get_id(connection), ==, "BOOTIF Connection"); + +- s_wired = nm_connection_get_setting_wired(connection); +- g_assert_cmpstr(nm_setting_wired_get_mac_address(s_wired), ==, "00:53:AB:CD:02:03"); +- g_assert(s_wired); ++ s_wired = nm_connection_get_setting_wired(connection); ++ g_assert_cmpstr(nm_setting_wired_get_mac_address(s_wired), ==, "00:53:AB:CD:02:03"); ++ g_assert(s_wired); + +- s_ip4 = nm_connection_get_setting_ip4_config(connection); +- g_assert(s_ip4); +- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO); +- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); +- g_assert(nm_setting_ip_config_get_may_fail(s_ip4)); ++ s_ip4 = nm_connection_get_setting_ip4_config(connection); ++ g_assert(s_ip4); ++ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip4), ++ ==, ++ NM_SETTING_IP4_CONFIG_METHOD_AUTO); ++ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip4)); ++ g_assert(nm_setting_ip_config_get_may_fail(s_ip4)); + +- s_ip6 = nm_connection_get_setting_ip6_config(connection); +- g_assert(s_ip6); +- g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), ==, NM_SETTING_IP6_CONFIG_METHOD_AUTO); +- g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); +- g_assert(nm_setting_ip_config_get_may_fail(s_ip6)); ++ s_ip6 = nm_connection_get_setting_ip6_config(connection); ++ g_assert(s_ip6); ++ g_assert_cmpstr(nm_setting_ip_config_get_method(s_ip6), ++ ==, ++ NM_SETTING_IP6_CONFIG_METHOD_AUTO); ++ g_assert(!nm_setting_ip_config_get_ignore_auto_dns(s_ip6)); ++ g_assert(nm_setting_ip_config_get_may_fail(s_ip6)); ++ } + } + + /* Check that nameservers are assigned to all existing +-- +2.29.2 + + +From 9ad933ab1496178adf8d7f987fc0612f36f87c00 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Thu, 14 Jan 2021 20:59:34 +0100 +Subject: [PATCH 2/2] initrd: fix leak in test + +Fixes: 6069ef4b8bb6 ('initrd: accept a zero-byte prefix for BOOTIF') +(cherry picked from commit 07ee187cb52f1ca6f975ae41bd56042bfd4b1ec1) +--- + src/initrd/tests/test-cmdline-reader.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/initrd/tests/test-cmdline-reader.c b/src/initrd/tests/test-cmdline-reader.c +index a809dff93c91..0c3014607c83 100644 +--- a/src/initrd/tests/test-cmdline-reader.c ++++ b/src/initrd/tests/test-cmdline-reader.c +@@ -1951,18 +1951,19 @@ test_bootif_no_ip(void) + static void + test_bootif_hwtype(void) + { +- gs_unref_hashtable GHashTable *connections = NULL; + const char *const *ARGV0 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03"); + const char *const *ARGV1 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=00-00-53-Ab-cD-02-03"); + const char *const *ARGV[] = {ARGV0, ARGV1}; +- NMConnection * connection; +- NMSettingWired * s_wired; +- NMSettingIPConfig *s_ip4; +- NMSettingIPConfig *s_ip6; +- gs_free char * hostname = NULL; + guint i; + + for (i = 0; i < G_N_ELEMENTS(ARGV); i++) { ++ gs_unref_hashtable GHashTable *connections = NULL; ++ NMConnection * connection; ++ NMSettingWired * s_wired; ++ NMSettingIPConfig * s_ip4; ++ NMSettingIPConfig * s_ip6; ++ gs_free char * hostname = NULL; ++ + connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV[i], &hostname); + g_assert(connections); + g_assert_cmpint(g_hash_table_size(connections), ==, 2); +-- +2.29.2 + diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index be554ca..e6bfe7f 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -6,8 +6,8 @@ %global epoch_version 1 %global rpm_version 1.30.0 -%global real_version 1.29.7 -%global release_version 0.5 +%global real_version 1.29.8 +%global release_version 0.6 %global snapshot %{nil} %global git_sha %{nil} @@ -38,6 +38,22 @@ ############################################################################### +%if "x__BCOND_DEFAULT_DEBUG__" == "x1" || "x__BCOND_DEFAULT_DEBUG__" == "x0" +%global bcond_default_debug __BCOND_DEFAULT_DEBUG__ +%else +%global bcond_default_debug 0 +%endif + +%if "x__BCOND_DEFAULT_TEST__" == "x1" || "x__BCOND_DEFAULT_TEST__" == "x0" +%global bcond_default_test __BCOND_DEFAULT_TEST__ +%else +%if 0%{?rhel} >= 9 +%global bcond_default_test 1 +%else +%global bcond_default_test 0 +%endif +%endif + %bcond_with meson %bcond_without adsl %bcond_without bluetooth @@ -52,8 +68,16 @@ # on RHEL we don't regenerate the documentation %bcond_with regen_docs +%if %{bcond_default_debug} +%bcond_without debug +%else %bcond_with debug +%endif +%if %{bcond_default_test} +%bcond_without test +%else %bcond_with test +%endif %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9 %bcond_without lto %else @@ -167,6 +191,7 @@ Patch1: 0001-cloud-setup-systemd-unit-rh1791758.patch # Bugfixes that are only relevant until next rebase of the package. # Patch1000: some.patch +Patch1000: 1000-initrd-accept-a-zero-byte-prefix-for-BOOTIF-rh1904099.patch # The pregenerated docs contain default values and paths that depend # on the configure options when creating the source tarball. @@ -794,8 +819,7 @@ intltoolize --automake --copy --force --with-resolvconf=no \ --with-netconfig=no \ --with-config-dns-rc-manager-default=%{dns_rc_manager_default} \ - --with-config-logging-backend-default=%{logging_backend_default} \ - --enable-json-validation + --with-config-logging-backend-default=%{logging_backend_default} make %{?_smp_mflags} @@ -1114,10 +1138,18 @@ fi %{systemd_dir}/nm-cloud-setup.timer %{nmlibdir}/dispatcher.d/90-nm-cloud-setup.sh %{nmlibdir}/dispatcher.d/no-wait.d/90-nm-cloud-setup.sh +%{_mandir}/man8/nm-cloud-setup.8* %endif %changelog +* Thu Jan 14 2021 Thomas Haller - 1:1.30.0-0.6 +- Update to 1.29.8 (development) +- initrd: accept zero-byte prefix for BOOTIF MAC address (rh #1904099) +- core: fix bond port wrongly detached by dispather call (rh #1888348) +- cloud-setup: add manual page (rh #1867997) +- core: fix handling timeout for IPv6 RDNSS,DNSSL option in RA (rh #1874743) + * Wed Dec 23 2020 Beniamino Galvani - 1:1.30.0-0.5 - Update to 1.29.7 (development) - Add WPA3-Enterprise support (rh #1883024)