Control: tags -1 + upstream fixed-upstream patch
Control: forwarded -1
https://cgit.freedesktop.org/NetworkManager/NetworkManager/patch/?id=27e8fffdb833748dfeb6648b8768c4ef48822841
On Wed, Jan 24, 2018 at 06:54:34PM +0100, Andreas Henriksson wrote:
> Package: network-manager
> Version: 1.10.2-3
> Severity: important
> File: /usr/sbin/NetworkManager
>
> Dear Maintainer,
>
> NetworkManager consistently segfaults when adding a tc filter rule for
> me. Backtrace and the example tc rules I'm trying to test out below.
[...]
I can confirm that the above upstream commit fixes the problem
(and applies cleanly to the debian version). Would be great if
you could include it in your next upload.
Regards,
Andreas Henriksson
diff -Nru network-manager-1.10.2/debian/changelog
network-manager-1.10.2/debian/changelog
--- network-manager-1.10.2/debian/changelog 2018-01-21 19:50:39.0
+0100
+++ network-manager-1.10.2/debian/changelog 2018-01-24 22:44:52.0
+0100
@@ -1,3 +1,10 @@
+network-manager (1.10.2-3+fixtfilter0) UNRELEASED; urgency=medium
+
+ * Add patch fixing tc filter crash from
+
https://cgit.freedesktop.org/NetworkManager/NetworkManager/patch/?id=27e8fffdb833748dfeb6648b8768c4ef48822841
+
+ -- Andreas Henriksson Wed, 24 Jan 2018 22:44:52 +0100
+
network-manager (1.10.2-3) unstable; urgency=medium
* secret-agent: construct the dbus proxy for async agent with the correct
diff -Nru
network-manager-1.10.2/debian/patches/platform-fix-crash-hashing-NMPlatformTfiter-and-NMPlatformQdisc.patch
network-manager-1.10.2/debian/patches/platform-fix-crash-hashing-NMPlatformTfiter-and-NMPlatformQdisc.patch
---
network-manager-1.10.2/debian/patches/platform-fix-crash-hashing-NMPlatformTfiter-and-NMPlatformQdisc.patch
1970-01-01 01:00:00.0 +0100
+++
network-manager-1.10.2/debian/patches/platform-fix-crash-hashing-NMPlatformTfiter-and-NMPlatformQdisc.patch
2018-01-24 22:44:52.0 +0100
@@ -0,0 +1,65 @@
+From 27e8fffdb833748dfeb6648b8768c4ef48822841 Mon Sep 17 00:00:00 2001
+From: Thomas Haller
+Date: Tue, 12 Dec 2017 10:37:59 +0100
+Subject: platform: fix crash hashing NMPlatformTfilter and NMPlatformQdisc
+
+@kind might be NULL. There are 3 forms of the hash-update functions for
+string: str(), str0(), and strarr().
+
+- str0() is when the string might be NULL.
+- str() does not allow the string to be NULL
+- strarr() is like str(), except it adds a G_STATIC_ASSERT()
+ that the argument is a C array.
+
+The reason why a difference between str() and str0() exists, is
+because str0() hashes NULL different from a "" or any other string.
+This has an overhead, because it effectively must hash another bit
+of information that tells whether a string was passed or not.
+
+The reason is, that hashing a tupple of two strings should always
+yield a different hash value, even for "aa",""; "a","a"; "","aa",
+where naive concatentation would yield identical hash values in all
+three cases.
+
+Fixes: e75fc8279becce29e688551930d85e59e1280c89
+---
+ src/platform/nm-platform.c | 8
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
+index c794970..369effb 100644
+--- a/src/platform/nm-platform.c
b/src/platform/nm-platform.c
+@@ -5320,7 +5320,7 @@ nm_platform_qdisc_to_string (const NMPlatformQdisc
*qdisc, char *buf, gsize len)
+ void
+ nm_platform_qdisc_hash_update (const NMPlatformQdisc *obj, NMHashState *h)
+ {
+- nm_hash_update_str (h, obj->kind);
++ nm_hash_update_str0 (h, obj->kind);
+ nm_hash_update_vals (h,
+obj->ifindex,
+obj->addr_family,
+@@ -5387,17 +5387,17 @@ nm_platform_tfilter_to_string (const NMPlatformTfilter
*tfilter, char *buf, gsiz
+ void
+ nm_platform_tfilter_hash_update (const NMPlatformTfilter *obj, NMHashState *h)
+ {
+- nm_hash_update_str (h, obj->kind);
++ nm_hash_update_str0 (h, obj->kind);
+ nm_hash_update_vals (h,
+obj->ifindex,
+obj->addr_family,
+obj->handle,
+obj->parent,
+obj->info);
+- nm_hash_update_str (h, obj->action.kind);
+ if (obj->action.kind) {
++ nm_hash_update_str (h, obj->action.kind);
+ if (nm_streq (obj->action.kind, NM_PLATFORM_ACTION_KIND_SIMPLE))
+- nm_hash_update_str (h, obj->action.simple.sdata);
++ nm_hash_update_strarr (h, obj->action.simple.sdata);
+ }
+ }
+
+--
+cgit v1.1
+
diff -Nru network-manager-1.10.2/debian/patches/series
network-manager-1.10.2/debian/patches/series
--- network-manager-1.10.2/debian/patches/series2018-01-21
19:50:39.0 +0100
+++ network-manager-1.10.2/debian/patches/series2018-01-24
22:44:52.0 +0100
@@ -6,3 +6,4 @@
libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch