From 95b1378b91803d4f27d1e207f062cd37df757d2024943edb7bf1e7f556946043 Mon Sep 17 00:00:00 2001 From: OBS User mrdocs Date: Fri, 27 Jul 2018 02:50:14 +0000 Subject: [PATCH] Accepting request 625387 from home:pevik:branches:network:utilities - Backport upstream patch fixing tracepath6 (poo#38492) e0baf20 tracepath: Fix copying input IPv6 address 0001-tracepath-Fix-copying-input-IPv6-address.patch + Reindex patch numbers. OBS-URL: https://build.opensuse.org/request/show/625387 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=66 --- ...epath-Fix-copying-input-IPv6-address.patch | 41 +++++++++++++++++++ iputils.changes | 7 ++++ iputils.spec | 10 +++-- 3 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 0001-tracepath-Fix-copying-input-IPv6-address.patch diff --git a/0001-tracepath-Fix-copying-input-IPv6-address.patch b/0001-tracepath-Fix-copying-input-IPv6-address.patch new file mode 100644 index 0000000..6910e4a --- /dev/null +++ b/0001-tracepath-Fix-copying-input-IPv6-address.patch @@ -0,0 +1,41 @@ +From e0baf20067a75f093d690bd51a6db3f5afabca77 Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Tue, 17 Jul 2018 17:56:10 +0200 +Subject: [PATCH] tracepath: Fix copying input IPv6 address + +Commit e669c86 broke copying input IPv6 address. +tracepath recover from it, but it's slower. + +Previously was address too short: + + strace ./tracepath -6 fe80::8895:e2af:e96e:fd8f + sendto(3, "\1\0\0\0\0\0\0\0\307\36N[\0\0\0\0w_\f\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 127952, 0, {sa_family=AF_INET6, sin6_port=htons(44444), inet_pton(AF_INET6, "fe80::", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EMSGSIZE (Message too long) + +After fix is correct: + + sendto(3, "\1\0\0\0\0\0\0\0\300\36N[\0\0\0\0'B\3\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 127952, 0, {sa_family=AF_INET6, sin6_port=htons(44444), inet_pton(AF_INET6, "fe80::8895:e2af:e96e:fd8f", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EMSGSIZE (Message too long) + +Bug found by LTP test. + +Fixes: e669c86 tracepath: fix heap-buffer-overflow [asan] +Fixes: #137 +--- + tracepath.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tracepath.c b/tracepath.c +index 53bda16..539a7a1 100644 +--- a/tracepath.c ++++ b/tracepath.c +@@ -475,7 +475,7 @@ int main(int argc, char **argv) + fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); + if (fd < 0) + continue; +- memcpy(&target, ai->ai_addr, sizeof(*ai->ai_addr)); ++ memcpy(&target, ai->ai_addr, ai->ai_addrlen); + targetlen = ai->ai_addrlen; + break; + } +-- +2.18.0 + diff --git a/iputils.changes b/iputils.changes index eb1910c..9a5299b 100644 --- a/iputils.changes +++ b/iputils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jul 26 09:17:45 UTC 2018 - pvorel@suse.cz + +- Backport upstream patch fixing tracepath6 (poo#38492) + e0baf20 tracepath: Fix copying input IPv6 address + 0001-tracepath-Fix-copying-input-IPv6-address.patch + ------------------------------------------------------------------- Fri Jun 29 18:25:51 UTC 2018 - pvorel@suse.cz diff --git a/iputils.spec b/iputils.spec index af3b425..d59898e 100644 --- a/iputils.spec +++ b/iputils.spec @@ -25,8 +25,9 @@ Group: Productivity/Networking/Other Url: https://github.com/iputils/iputils Source0: https://github.com/iputils/iputils/archive/%{version}.tar.gz Source1: rarpd.service -Patch8: iputils-sec-ping-unblock.diff -Patch9: iputils-ping-interrupt.diff +Patch1: iputils-sec-ping-unblock.diff +Patch2: iputils-ping-interrupt.diff +Patch3: 0001-tracepath-Fix-copying-input-IPv6-address.patch BuildRequires: docbook-xsl-stylesheets BuildRequires: docbook_3 BuildRequires: iso_ent @@ -63,8 +64,9 @@ out their IP addresses. %prep %setup -q -%patch8 -p1 -%patch9 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build