[pve-devel] [PATCH v2 iproute2 1/2] Update to 4.15, fix /bin/ss with no header flag

Alexandre Derumier aderumier at odiso.com
Mon Jun 18 19:58:54 CEST 2018


From: René Jochum <rene at jochums.at>

Fix ss with the no-header flag, upstream bug: #895719

Signed-off-by: René Jochum <rene at jochums.at>
---
 .gitignore                                         |   3 +
 Makefile                                           |   4 +-
 debian/changelog                                   |  13 +++
 debian/patches/0002-txtdocs.patch                  |  42 --------
 debian/patches/0005-revert-flush-default.patch     | 113 +++++++++++++++++++++
 ...c-lexer-let-quotes-actually-start-strings.patch |  34 -------
 ...olice-don-t-skip-parameters-after-actions.patch |  41 --------
 .../patches/0099-fix-ss-no-header-renderer.patch   |  35 +++++++
 debian/patches/series                              |   5 +-
 debian/rules                                       |   1 -
 10 files changed, 168 insertions(+), 123 deletions(-)
 delete mode 100644 debian/patches/0002-txtdocs.patch
 create mode 100644 debian/patches/0005-revert-flush-default.patch
 delete mode 100644 debian/patches/0005-tc-lexer-let-quotes-actually-start-strings.patch
 delete mode 100644 debian/patches/0006-police-don-t-skip-parameters-after-actions.patch
 create mode 100644 debian/patches/0099-fix-ss-no-header-renderer.patch

diff --git a/.gitignore b/.gitignore
index 34ea9d5..d8127a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
 iproute2-*
+*.deb
+*.buildinfo
+*.changes
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 9788367..e043d81 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION=4.13.0
-PKGREL=3
+VERSION=4.15.0
+PKGREL=4
 
 DIR=iproute2-${VERSION}
 SRC=iproute2-${VERSION}.orig.tar.xz
diff --git a/debian/changelog b/debian/changelog
index 93d41ca..3ad30e7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+iproute2 (4.15.0-4) UNRELEASED; urgency=medium
+
+  * Fix ss with the no-header flag, upstream bug: #895719
+
+ -- Proxmox Support Team <support at proxmox.com>  Sun, 15 Apr 2018 09:29:03 +0200
+
+iproute2 (4.15.0-3) unstable; urgency=medium
+
+  * Backport 0005-revert-flush-default.patch to fix ip route flush all
+    (Closes: #891511)
+
+ -- Luca Boccassi <bluca at debian.org>  Mon, 12 Mar 2018 22:46:24 +0000
+
 iproute2 (4.13.0-3) unstable; urgency=medium
 
   * merge patch to not skip parameters after actions in 'police' filter lines
diff --git a/debian/patches/0002-txtdocs.patch b/debian/patches/0002-txtdocs.patch
deleted file mode 100644
index 590a232..0000000
diff --git a/debian/patches/0005-revert-flush-default.patch b/debian/patches/0005-revert-flush-default.patch
new file mode 100644
index 0000000..3a5b481
--- /dev/null
+++ b/debian/patches/0005-revert-flush-default.patch
@@ -0,0 +1,113 @@
+Description: Revert "iproute: "list/flush/save default" selected all of the routes"
+	# ip route flush all
+ No longer worked as expected which breaks user scripts and
+ expectations. It no longer flushed all IPv4 routes.
+Bug: https://bugs.debian.og/891511
+Forwarded: not-needed
+Origin: upstream
+Applied-Upstream: https://patchwork.ozlabs.org/patch/884882/
+Author: Stephen Hemminger <stephen at networkplumber.org>
+Last-Update: 2018-03-12
+--- a/ip/iproute.c
++++ b/ip/iproute.c
+@@ -191,42 +191,20 @@
+ 		return 0;
+ 	if ((filter.tos^r->rtm_tos)&filter.tosmask)
+ 		return 0;
+-	if (filter.rdst.family) {
+-		if (r->rtm_family != filter.rdst.family ||
+-		    filter.rdst.bitlen > r->rtm_dst_len)
+-			return 0;
+-	} else if (filter.rdst.flags & PREFIXLEN_SPECIFIED) {
+-		if (filter.rdst.bitlen > r->rtm_dst_len)
+-			return 0;
+-	}
+-	if (filter.mdst.family) {
+-		if (r->rtm_family != filter.mdst.family ||
+-		    (filter.mdst.bitlen >= 0 &&
+-		     filter.mdst.bitlen < r->rtm_dst_len))
+-			return 0;
+-	} else if (filter.mdst.flags & PREFIXLEN_SPECIFIED) {
+-		if (filter.mdst.bitlen >= 0 &&
+-		    filter.mdst.bitlen < r->rtm_dst_len)
+-			return 0;
+-	}
+-	if (filter.rsrc.family) {
+-		if (r->rtm_family != filter.rsrc.family ||
+-		    filter.rsrc.bitlen > r->rtm_src_len)
+-			return 0;
+-	} else if (filter.rsrc.flags & PREFIXLEN_SPECIFIED) {
+-		if (filter.rsrc.bitlen > r->rtm_src_len)
+-			return 0;
+-	}
+-	if (filter.msrc.family) {
+-		if (r->rtm_family != filter.msrc.family ||
+-		    (filter.msrc.bitlen >= 0 &&
+-		     filter.msrc.bitlen < r->rtm_src_len))
+-			return 0;
+-	} else if (filter.msrc.flags & PREFIXLEN_SPECIFIED) {
+-		if (filter.msrc.bitlen >= 0 &&
+-		    filter.msrc.bitlen < r->rtm_src_len)
+-			return 0;
+-	}
++	if (filter.rdst.family &&
++	    (r->rtm_family != filter.rdst.family || filter.rdst.bitlen > r->rtm_dst_len))
++		return 0;
++	if (filter.mdst.family &&
++	    (r->rtm_family != filter.mdst.family ||
++	     (filter.mdst.bitlen >= 0 && filter.mdst.bitlen < r->rtm_dst_len)))
++		return 0;
++	if (filter.rsrc.family &&
++	    (r->rtm_family != filter.rsrc.family || filter.rsrc.bitlen > r->rtm_src_len))
++		return 0;
++	if (filter.msrc.family &&
++	    (r->rtm_family != filter.msrc.family ||
++	     (filter.msrc.bitlen >= 0 && filter.msrc.bitlen < r->rtm_src_len)))
++		return 0;
+ 	if (filter.rvia.family) {
+ 		int family = r->rtm_family;
+ 
+@@ -243,9 +221,7 @@
+ 
+ 	if (tb[RTA_DST])
+ 		memcpy(&dst.data, RTA_DATA(tb[RTA_DST]), (r->rtm_dst_len+7)/8);
+-	if (filter.rsrc.family || filter.msrc.family ||
+-	    filter.rsrc.flags & PREFIXLEN_SPECIFIED ||
+-	    filter.msrc.flags & PREFIXLEN_SPECIFIED) {
++	if (filter.rsrc.family || filter.msrc.family) {
+ 		if (tb[RTA_SRC])
+ 			memcpy(&src.data, RTA_DATA(tb[RTA_SRC]), (r->rtm_src_len+7)/8);
+ 	}
+@@ -265,18 +241,15 @@
+ 			memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len/8);
+ 	}
+ 
+-	if ((filter.rdst.family || filter.rdst.flags & PREFIXLEN_SPECIFIED) &&
+-	    inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
++	if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
+ 		return 0;
+-	if ((filter.mdst.family || filter.mdst.flags & PREFIXLEN_SPECIFIED) &&
++	if (filter.mdst.family && filter.mdst.bitlen >= 0 &&
+ 	    inet_addr_match(&dst, &filter.mdst, r->rtm_dst_len))
+ 		return 0;
+ 
+-	if ((filter.rsrc.family || filter.rsrc.flags & PREFIXLEN_SPECIFIED) &&
+-	    inet_addr_match(&src, &filter.rsrc, filter.rsrc.bitlen))
++	if (filter.rsrc.family && inet_addr_match(&src, &filter.rsrc, filter.rsrc.bitlen))
+ 		return 0;
+-	if ((filter.msrc.family || filter.msrc.flags & PREFIXLEN_SPECIFIED) &&
+-	    filter.msrc.bitlen >= 0 &&
++	if (filter.msrc.family && filter.msrc.bitlen >= 0 &&
+ 	    inet_addr_match(&src, &filter.msrc, r->rtm_src_len))
+ 		return 0;
+ 
+--- a/lib/utils.c
++++ b/lib/utils.c
+@@ -658,7 +658,6 @@
+ 		dst->family = family;
+ 		dst->bytelen = 0;
+ 		dst->bitlen = 0;
+-		dst->flags |= PREFIXLEN_SPECIFIED;
+ 		return 0;
+ 	}
+ 
diff --git a/debian/patches/0005-tc-lexer-let-quotes-actually-start-strings.patch b/debian/patches/0005-tc-lexer-let-quotes-actually-start-strings.patch
deleted file mode 100644
index cd2d6e1..0000000
diff --git a/debian/patches/0006-police-don-t-skip-parameters-after-actions.patch b/debian/patches/0006-police-don-t-skip-parameters-after-actions.patch
deleted file mode 100644
index 0a0f2c3..0000000
diff --git a/debian/patches/0099-fix-ss-no-header-renderer.patch b/debian/patches/0099-fix-ss-no-header-renderer.patch
new file mode 100644
index 0000000..ced30bf
--- /dev/null
+++ b/debian/patches/0099-fix-ss-no-header-renderer.patch
@@ -0,0 +1,35 @@
+When ss is invoked with the no-header flag, if the query doesn't return
+any result, render() is called with 'buffer' uninitialized. This
+currently leads to a segfault. Ensure that buffer is initialized before
+rendering.
+
+The bug can be triggered with: ss -H sport = 100000
+
+Signed-off-by: Jean-Philippe Brucker <jphilippe.brucker at xxxxxxxxx>
+---
+ misc/ss.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/misc/ss.c b/misc/ss.c
+index e047f9c0..e087bef7 100644
+--- a/misc/ss.c
++++ b/misc/ss.c
+@@ -1197,10 +1197,15 @@ newline:
+ /* Render buffered output with spacing and delimiters, then free up buffers */
+ static void render(int screen_width)
+ {
+-	struct buf_token *token = (struct buf_token *)buffer.head->data;
++	struct buf_token *token;
+ 	int printed, line_started = 0;
+ 	struct column *f;
+ 
++	if (!buffer.head)
++		return;
++
++	token = (struct buf_token *)buffer.head->data;
++
+ 	/* Ensure end alignment of last token, it wasn't necessarily flushed */
+ 	buffer.tail->end += buffer.cur->len % 2;
+ 
+-- 
+2.16.2
\ No newline at end of file
diff --git a/debian/patches/series b/debian/patches/series
index 86046a5..2272e0e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,4 @@
 0001-Add-moo-feature.patch
-0002-txtdocs.patch
 0004-sync-iptables-header.patch
-0005-tc-lexer-let-quotes-actually-start-strings.patch
-0006-police-don-t-skip-parameters-after-actions.patch
+0005-revert-flush-default.patch
+0099-fix-ss-no-header-renderer.patch
diff --git a/debian/rules b/debian/rules
index 2f1a1ff..0a6d6e2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,5 +27,4 @@ override_dh_auto_configure:
 	$(CROSS) dh_auto_configure
 
 override_dh_auto_build:
-	$(MAKE) -C doc all txt
 	$(MAKE) KERNEL_INCLUDE=./include $(CROSS)
-- 
2.11.0




More information about the pve-devel mailing list