diff -Nru iproute2-4.9.0/debian/changelog iproute2-4.9.0/debian/changelog --- iproute2-4.9.0/debian/changelog 2017-06-19 03:59:24.000000000 +0000 +++ iproute2-4.9.0/debian/changelog 2017-11-29 13:02:27.000000000 +0000 @@ -1,3 +1,17 @@ +iproute2 (4.9.0-1ubuntu2.1) artful; urgency=medium + + * Fix ip maddr show (LP: #1732032): + - d/p/1003-ip-maddr-fix-igmp-parsing.patch: fix igmp parsing when iface is + long + - d/p/1004-ip-maddr-avoid-uninitialized-data.patch: avoid accessing + uninitialized data + - d/p/1005-ip-maddr-fix-filtering-by-device.patch: fix filtering + by device + * d/p/1006-fix-undeclared-UINT16_MAX.patch: FTBFS: tc: include stdint.h + explicitly for UINT16_MAX (LP: #1735158) + + -- Andreas Hasenack Wed, 29 Nov 2017 11:02:27 -0200 + iproute2 (4.9.0-1ubuntu2) artful; urgency=medium * No-change rebuild against latest iptables diff -Nru iproute2-4.9.0/debian/patches/1003-ip-maddr-fix-igmp-parsing.patch iproute2-4.9.0/debian/patches/1003-ip-maddr-fix-igmp-parsing.patch --- iproute2-4.9.0/debian/patches/1003-ip-maddr-fix-igmp-parsing.patch 1970-01-01 00:00:00.000000000 +0000 +++ iproute2-4.9.0/debian/patches/1003-ip-maddr-fix-igmp-parsing.patch 2017-11-29 13:02:27.000000000 +0000 @@ -0,0 +1,31 @@ +Description: fix igmp parsing when iface is long + Entries with long vhost names in /proc/net/igmp have no whitespace + between name and colon, so sscanf() adds it to vhost and + 'ip maddr show iface' doesn't include inet result. +Author: Petr Vorel +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git/commit/?id=530903dd9003492edb0714e937ad4a5d1219e376 +Bug-Ubuntu: https://launchpad.net/bugs/1732032 +Last-Update: 2017-11-29 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/ip/ipmaddr.c ++++ b/ip/ipmaddr.c +@@ -136,13 +136,17 @@ + + while (fgets(buf, sizeof(buf), fp)) { + struct ma_info *ma; ++ size_t len; + + if (buf[0] != '\t') { + sscanf(buf, "%d%s", &m.index, m.name); ++ len = strlen(m.name); ++ if (m.name[len - 1] == ':') ++ len--; + continue; + } + +- if (filter.dev && strcmp(filter.dev, m.name)) ++ if (filter.dev && strncmp(filter.dev, m.name, len)) + continue; + + sscanf(buf, "%08x%d", (__u32 *)&m.addr.data, &m.users); diff -Nru iproute2-4.9.0/debian/patches/1004-ip-maddr-avoid-uninitialized-data.patch iproute2-4.9.0/debian/patches/1004-ip-maddr-avoid-uninitialized-data.patch --- iproute2-4.9.0/debian/patches/1004-ip-maddr-avoid-uninitialized-data.patch 1970-01-01 00:00:00.000000000 +0000 +++ iproute2-4.9.0/debian/patches/1004-ip-maddr-avoid-uninitialized-data.patch 2017-11-29 13:02:27.000000000 +0000 @@ -0,0 +1,20 @@ +Description: ipmaddr: Avoid accessing uninitialized data + Looks like this can only happen if /proc/net/igmp is malformed, but + better be sure. +Author: Phil Sutter +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git/commit/?id=b48a1161f5f9b6a0cda399a224bbbf72eba4a5c6 +Bug-Ubuntu: https://launchpad.net/bugs/1732032 +Last-Update: 2017-11-29 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/ip/ipmaddr.c ++++ b/ip/ipmaddr.c +@@ -136,7 +136,7 @@ + + while (fgets(buf, sizeof(buf), fp)) { + struct ma_info *ma; +- size_t len; ++ size_t len = 0; + + if (buf[0] != '\t') { + sscanf(buf, "%d%s", &m.index, m.name); diff -Nru iproute2-4.9.0/debian/patches/1005-ip-maddr-fix-filtering-by-device.patch iproute2-4.9.0/debian/patches/1005-ip-maddr-fix-filtering-by-device.patch --- iproute2-4.9.0/debian/patches/1005-ip-maddr-fix-filtering-by-device.patch 1970-01-01 00:00:00.000000000 +0000 +++ iproute2-4.9.0/debian/patches/1005-ip-maddr-fix-filtering-by-device.patch 2017-11-29 13:02:27.000000000 +0000 @@ -0,0 +1,42 @@ +Description: ip maddr: fix filtering by device + Commit 530903dd9003 ("ip: fix igmp parsing when iface is long") uses + variable len to keep trailing colon from interface name comparison. This + variable is local to loop body but we set it in one pass and use it in + following one(s) so that we are actually using (pseudo)random length for + comparison. This became apparent since commit b48a1161f5f9 ("ipmaddr: Avoid + accessing uninitialized data") always initializes len to zero so that the + name comparison is always true. As a result, "ip maddr show dev eth0" shows + IPv4 multicast addresses for all interfaces. + . + Instead of keeping the length, let's simply replace the trailing colon with + a null byte. The bonus is that we get correct interface name in ma.name. +Author: Michal Kubecek +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git/commit/?id=21503ed2af233ffe795926f6641ac84ec1b15bf9 +Bug-Ubuntu: https://launchpad.net/bugs/1732032 +Last-Update: 2017-11-29 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/ip/ipmaddr.c ++++ b/ip/ipmaddr.c +@@ -136,17 +136,18 @@ + + while (fgets(buf, sizeof(buf), fp)) { + struct ma_info *ma; +- size_t len = 0; + + if (buf[0] != '\t') { ++ size_t len; ++ + sscanf(buf, "%d%s", &m.index, m.name); + len = strlen(m.name); + if (m.name[len - 1] == ':') +- len--; ++ m.name[len - 1] = '\0'; + continue; + } + +- if (filter.dev && strncmp(filter.dev, m.name, len)) ++ if (filter.dev && strcmp(filter.dev, m.name)) + continue; + + sscanf(buf, "%08x%d", (__u32 *)&m.addr.data, &m.users); diff -Nru iproute2-4.9.0/debian/patches/1006-fix-undeclared-UINT16_MAX.patch iproute2-4.9.0/debian/patches/1006-fix-undeclared-UINT16_MAX.patch --- iproute2-4.9.0/debian/patches/1006-fix-undeclared-UINT16_MAX.patch 1970-01-01 00:00:00.000000000 +0000 +++ iproute2-4.9.0/debian/patches/1006-fix-undeclared-UINT16_MAX.patch 2017-11-29 13:02:27.000000000 +0000 @@ -0,0 +1,21 @@ +Description: tc: include stdint.h explicitly for UINT16_MAX + Fixes + | tc_core.c:190:29: error: 'UINT16_MAX' undeclared (first use in this function); did you mean '__INT16_MAX__'? + | if ((sz >> s->size_log) > UINT16_MAX) { + | ^~~~~~~~~~ +Author: Khem Raj +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git/commit/?id=ae717baf15fb4d30749ada3948d9445892bac239 +Bug-Ubuntu: https://launchpad.net/bugs/1735158 +Last-Update: 2017-11-29 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/tc/tc_core.c ++++ b/tc/tc_core.c +@@ -12,6 +12,7 @@ + + #include + #include ++#include + #include + #include + #include diff -Nru iproute2-4.9.0/debian/patches/series iproute2-4.9.0/debian/patches/series --- iproute2-4.9.0/debian/patches/series 2017-02-15 16:10:17.000000000 +0000 +++ iproute2-4.9.0/debian/patches/series 2017-11-29 13:02:27.000000000 +0000 @@ -3,3 +3,7 @@ 1000-ubuntu-poc-fan-driver.patch 1001-ubuntu-poc-fan-driver-v3.patch 1002-ubuntu-poc-fan-driver-vxlan.patch +1003-ip-maddr-fix-igmp-parsing.patch +1004-ip-maddr-avoid-uninitialized-data.patch +1005-ip-maddr-fix-filtering-by-device.patch +1006-fix-undeclared-UINT16_MAX.patch