From 3509a50ed6498cf05ff0cf14b805e00746150747 Mon Sep 17 00:00:00 2001 From: liaichun Date: Fri, 29 Jul 2022 15:12:16 +0800 Subject: [PATCH] backport patches to fix crash, sriov problems and nmcli warning Signed-off-by: liaichun --- NetworkManager.spec | 16 +++++- ...ore-reload-config-for-active-devices.patch | 39 +++++++++++++ ...route_validate_all-for-invalid-route.patch | 55 +++++++++++++++++++ ...-of-nm_vpn_plugin_info_new_from_file.patch | 52 ++++++++++++++++++ ...-setting-wrong-ethtool-ternary-value.patch | 36 ++++++++++++ 5 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 backport-core-reload-config-for-active-devices.patch create mode 100644 backport-libnm-fix-crash-in-_nm_ip_route_validate_all-for-invalid-route.patch create mode 100644 backport-libnm-fix-crash-on-failure-of-nm_vpn_plugin_info_new_from_file.patch create mode 100644 backport-libnm-fix-warning-when-setting-wrong-ethtool-ternary-value.patch diff --git a/NetworkManager.spec b/NetworkManager.spec index 24f54b5..b0e9e1b 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -50,7 +50,7 @@ Name: NetworkManager Version: 1.32.12 Epoch: 1 -Release: 9 +Release: 10 Summary: Network Link Manager and User Applications License: GPLv2+ URL: https://www.gnome.org/projects/NetworkManager/ @@ -62,6 +62,11 @@ Patch2: bugfix-use-PartOf-replace-Requires-in-service.patch Patch3: bugfix-ipv6-external-route-miss.patch Patch4: bugfix-recover-to-30s-timeout-in-NetworkManager-wait-online.patch +Patch6000: backport-libnm-fix-crash-in-_nm_ip_route_validate_all-for-invalid-route.patch +Patch6001: backport-libnm-fix-crash-on-failure-of-nm_vpn_plugin_info_new_from_file.patch +Patch6002: backport-core-reload-config-for-active-devices.patch +Patch6003: backport-libnm-fix-warning-when-setting-wrong-ethtool-ternary-value.patch + BuildRequires: gcc libtool pkgconfig automake autoconf intltool gettext-devel ppp-devel gnutls-devel BuildRequires: dbus-devel dbus-glib-devel glib2-devel gobject-introspection-devel jansson-devel BuildRequires: dhclient readline-devel audit-libs-devel gtk-doc libudev-devel libuuid-devel /usr/bin/valac polkit-devel @@ -474,6 +479,15 @@ fi %{_datadir}/gtk-doc/html/NetworkManager/* %changelog +* Fri Jul 29 2022 Aichun Li - 1.32.12-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:libnm:fix warning when setting wrong ethtool ternary value +core: reload config for active devices +libnm: fix crash on failure of nm_vpn_plugin_info_new_from_file() +libnm: fix crash in _nm_ip_route_validate_all for invalid-route + * Wed Jul 13 2022 gaoxingwang - 1.32.12-9 - Type:bugfix - ID:NA diff --git a/backport-core-reload-config-for-active-devices.patch b/backport-core-reload-config-for-active-devices.patch new file mode 100644 index 0000000..69a8a71 --- /dev/null +++ b/backport-core-reload-config-for-active-devices.patch @@ -0,0 +1,39 @@ +From e2b75a388672eee514e4efa02b506b0a9ffaa9f0 Mon Sep 17 00:00:00 2001 +From: Fernando Fernandez Mancera +Date: Sun, 17 Oct 2021 12:12:58 +0200 +Subject: [PATCH] core: reload config for active devices + +When NetworkManager is reloaded the config from active devices is not +being reloaded properly. + +Related: https://bugzilla.redhat.com/1852445 + +Fixes: 121c58f0c48d ('core: set number of SR-IOV VFs asynchronously') + +Conflict:NA +Reference:https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/e2b75a388672eee514e4efa02b506b0a9ffaa9f0 +Signed-off-by: Fernando Fernandez Mancera +(cherry picked from commit ff9b64c923abf072aa789862be94bcb0de08e2f4) +--- + src/core/devices/nm-device.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c +index 50386d0018..7bfdf80137 100644 +--- a/src/core/devices/nm-device.c ++++ b/src/core/devices/nm-device.c +@@ -5976,9 +5976,10 @@ config_changed(NMConfig * config, + { + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); + +- if (priv->state <= NM_DEVICE_STATE_DISCONNECTED || priv->state > NM_DEVICE_STATE_ACTIVATED) { ++ if (priv->state <= NM_DEVICE_STATE_DISCONNECTED || priv->state >= NM_DEVICE_STATE_ACTIVATED) { + priv->ignore_carrier = nm_config_data_get_ignore_carrier(config_data, self); +- if (NM_FLAGS_HAS(changes, NM_CONFIG_CHANGE_VALUES)) ++ if (NM_FLAGS_HAS(changes, NM_CONFIG_CHANGE_VALUES) ++ && !nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV)) + device_init_static_sriov_num_vfs(self); + } + } +-- +2.23.0 diff --git a/backport-libnm-fix-crash-in-_nm_ip_route_validate_all-for-invalid-route.patch b/backport-libnm-fix-crash-in-_nm_ip_route_validate_all-for-invalid-route.patch new file mode 100644 index 0000000..ceb0d86 --- /dev/null +++ b/backport-libnm-fix-crash-in-_nm_ip_route_validate_all-for-invalid-route.patch @@ -0,0 +1,55 @@ +From 00723dd5e85ce5eb27e189acad3fe76b09ff2890 Mon Sep 17 00:00:00 2001 +From: Vojtech Bubela +Date: Wed, 29 Sep 2021 12:38:40 +0200 +Subject: [PATCH] libnm: fix crash in _nm_ip_route_validate_all for invalid + route + +backtrace from coredump, NetworkManager-1.30.6-1.fc34 + + #0 verify + (setting=0x55d081fe8690, connection=, error=0x7ffe0fa06870) + at libnm-core/nm-setting-ip-config.c:5249 + #1 0x000055d081ab98d4 in verify + (setting=0x55d081fe8690, connection=0x55d0820a2b80, error=0x7ffe0fa06870) + at libnm-core/nm-setting-ip4-config.c:119 + #2 0x000055d081aa3d54 in _nm_connection_verify + (connection=0x55d0820a2b80, error=0x7ffe0fa068c0) + at libnm-core/nm-connection.c:1441 + #3 0x000055d081aa78ec in nm_connection_normalize + (connection=0x55d0820a2b80, parameters=0x0, modified=0x0, error=0x7ffe0fa06de8) + at libnm-core/nm-connection.c:1688 + #4 0x000055d081aa81f4 in _nm_connection_replace_settings + (connection=0x55d0820a2b80, new_settings=, parse_flags=_NM_SETTING_PARSE_FLAGS_LAST, error=0x7ffe0fa06de8) at libnm-core/nm-connection.c:432 + #5 0x000055d081aa83a6 in _nm_simple_connection_new_from_dbus + (dict=0x55d082089950, error=0x7ffe0fa06de8, parse_flags=_NM_SETTING_PARSE_FLAGS_LAST) at libnm-core/nm-simple-connection.c:77 + #6 0x000055d081bbf942 in settings_connection_update + (self=0x55d081fdd9f0, is_update2=1, context=0x7fc06c021dd0, new_settings=0x55d082089950, flags=NM_SETTINGS_UPDATE2_FLAG_TO_DISK) + at src/core/settings/nm-settings-connection.c:1637 + #7 0x000055d081bbfb09 in impl_settings_connection_update2 + (obj=0x55d081fdd9f0, interface_info=, method_info=, connection=, sender=, invocation=0x7fc06c021dd0, parameters=0x55d0820f5e60) at src/core/settings/nm-settings-connection.c:1796 + #8 0x00007fc08a9db482 in call_in_idle_cb.lto_priv () at /lib64/libgio-2.0.so.0 + +Conflict:NA +Reference:https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/00723dd5e85ce5eb27e189acad3fe76b09ff2890 + +Fixes: bb6c2d73713f ('libnm: ensure stable behavior in _nm_ip_route_attribute_validate_all()') +(cherry picked from commit 0ed099374d92d1c4f7472df5fe503f3cd3e67905) +--- + src/libnm-core-impl/nm-setting-ip-config.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c +index f37e9d351e..311babefa1 100644 +--- a/src/libnm-core-impl/nm-setting-ip-config.c ++++ b/src/libnm-core-impl/nm-setting-ip-config.c +@@ -1440,7 +1440,7 @@ _nm_ip_route_attribute_validate_all(const NMIPRoute *route, GError **error) + const char *key = attrs[i].name; + GVariant * val2 = attrs[i].value_ptr; + +- if (!nm_ip_route_attribute_validate(key, val2, route->family, NULL, NULL)) ++ if (!nm_ip_route_attribute_validate(key, val2, route->family, NULL, error)) + return FALSE; + } + +-- +2.23.0 diff --git a/backport-libnm-fix-crash-on-failure-of-nm_vpn_plugin_info_new_from_file.patch b/backport-libnm-fix-crash-on-failure-of-nm_vpn_plugin_info_new_from_file.patch new file mode 100644 index 0000000..ecbe268 --- /dev/null +++ b/backport-libnm-fix-crash-on-failure-of-nm_vpn_plugin_info_new_from_file.patch @@ -0,0 +1,52 @@ +From 9d7c09261475b29e30f62d7ea644ec5a782e6cec Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Mon, 11 Oct 2021 22:16:00 +0200 +Subject: [PATCH] libnm: fix crash on failure of + nm_vpn_plugin_info_new_from_file() + +nm_vpn_plugin_info_new_from_file() may fail as NMVpnPlugin is an +GInitable. As such, the destructor must handle the case where the +instance was only partly initialized. + + #0 g_logv (log_domain=0x7f7144703071 "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=, args=) at ../glib/gmessages.c:1413 + #1 0x00007f71446b3903 in g_log (log_domain=, log_level=, format=) at ../glib/gmessages.c:1451 + #2 0x000056455b8e58d0 in finalize (object=0x7f7128008180 [NMVpnPluginInfo]) at src/libnm-core-impl/nm-vpn-plugin-info.c:1280 + #3 0x00007f71447b8b18 in g_object_unref (_object=) at ../gobject/gobject.c:3524 + #4 g_object_unref (_object=0x7f7128008180) at ../gobject/gobject.c:3416 + #5 0x00007f714486bc09 in g_initable_new_valist + (object_type=, first_property_name=0x56455b925c20 "filename", var_args=var_args@entry=0x7ffe702b1140, cancellable=cancellable@entry=0x0, error=error@entry=0x7ffe702b1248) at ../gio/ginitable.c:250 + #6 0x00007f714486bcad in g_initable_new + (object_type=, cancellable=cancellable@entry=0x0, error=error@entry=0x7ffe702b1248, first_property_name=first_property_name@entry=0x56455b925c20 "filename") + at ../gio/ginitable.c:162 + #7 0x000056455b8e69f6 in nm_vpn_plugin_info_new_from_file + (filename=filename@entry=0x56455c951ec0 "/opt/test/lib/NetworkManager/VPN/nm-openvpn-service.name", error=error@entry=0x7ffe702b1248) at src/libnm-core-impl/nm-vpn-plugin-info.c:1221 + #8 0x000056455b88ce9a in vpn_dir_changed + (monitor=monitor@entry=0x7f7128007860 [GInotifyFileMonitor], file=file@entry=0x7f712c005600, other_file=other_file@entry=0x0, event_type=, user_data=) + at src/core/vpn/nm-vpn-manager.c:182 + #9 0x00007f71448697a3 in _g_cclosure_marshal_VOID__OBJECT_OBJECT_ENUMv + (closure=0x56455c7e4250, return_value=, instance=, args=, marshal_data=, n_params=, param_types=0x56455c7355a0) at ../gio/gmarshal-internal.c:1380 + +Conflict:NA +Reference:https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/9d7c09261475b29e30f62d7ea644ec5a782e6cec + +Fixes: d6226bd98713 ('libnm: add NMVpnPluginInfo class') +(cherry picked from commit 841c45a4f5c0ee34674fe24ef8f9198ca506a64e) +--- + src/libnm-core-impl/nm-vpn-plugin-info.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libnm-core-impl/nm-vpn-plugin-info.c b/src/libnm-core-impl/nm-vpn-plugin-info.c +index dc77dfd025..665863d108 100644 +--- a/src/libnm-core-impl/nm-vpn-plugin-info.c ++++ b/src/libnm-core-impl/nm-vpn-plugin-info.c +@@ -1277,7 +1277,7 @@ finalize(GObject *object) + g_free(priv->auth_dialog); + g_strfreev(priv->aliases); + g_free(priv->filename); +- g_hash_table_unref(priv->keys); ++ nm_g_hash_table_unref(priv->keys); + + nm_clear_pointer(&priv->keyfile, g_key_file_unref); + +-- +2.23.0 diff --git a/backport-libnm-fix-warning-when-setting-wrong-ethtool-ternary-value.patch b/backport-libnm-fix-warning-when-setting-wrong-ethtool-ternary-value.patch new file mode 100644 index 0000000..9e7e797 --- /dev/null +++ b/backport-libnm-fix-warning-when-setting-wrong-ethtool-ternary-value.patch @@ -0,0 +1,36 @@ +From 45f8c78c61e5b42f5b39c354f83109bae3cdcf43 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Mon, 20 Dec 2021 07:46:59 +0100 +Subject: [PATCH] libnm: fix warning when setting wrong ethtool ternary value + + $ nmcli connection modify dummy1 ethtool.feature-rx a + (process:3077356): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. + This indicates a bug in someone's code. You must ensure an error is NULL before it's set. + The overwriting error message was: 'a' is not valid; use 'on', 'off', or 'ignore' + Error: failed to modify ethtool.feature-rx: 'a' is not valid; use [true, yes, on], [false, no, off] or [unknown]. + +Conflict:NA +Reference:https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/45f8c78c61e5b42f5b39c354f83109bae3cdcf43 + +Fixes: e5b46aa38ab1 ('cli: use nmc_string_to_ternary() to parse ternary in _set_fcn_ethtool()') +(cherry picked from commit 25e705c361c5edbf152c5a2570c0038faa4195cf) +(cherry picked from commit 2aa19708c217f4ae46f939d80c565ca156af7ee3) +--- + src/libnmc-setting/nm-meta-setting-desc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c +index 1cc5f9c15f..1ee9e3077c 100644 +--- a/src/libnmc-setting/nm-meta-setting-desc.c ++++ b/src/libnmc-setting/nm-meta-setting-desc.c +@@ -4318,7 +4318,7 @@ static gboolean _set_fcn_ethtool(ARGS_SET_FCN) + if (!nmc_string_to_ternary_full(value, + NMC_STRING_TO_TERNARY_FLAGS_IGNORE_FOR_DEFAULT, + &t, +- error)) { ++ NULL)) { + g_set_error(error, + NM_UTILS_ERROR, + NM_UTILS_ERROR_INVALID_ARGUMENT, +-- +2.23.0 -- Gitee