From 59239f887ba111580f7a53b4f134ce1dbc9ce78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Wed, 17 Jul 2013 15:32:07 +0200 Subject: [PATCH] Fix the XFRM patch --- iproute.spec | 7 +++++-- ...ch => iproute2-3.10.0-xfrm-state-overflow.patch | 14 +++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) rename iproute2-3.9.0-xfrm-state-overflow.patch => iproute2-3.10.0-xfrm-state-overflow.patch (69%) diff --git a/iproute.spec b/iproute.spec index d1580a9..bb11643 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Summary: Advanced IP routing and network device configuration tools Name: iproute Version: 3.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System URL: http://kernel.org/pub/linux/utils/net/%{name}2/ Source0: http://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.gz @@ -17,7 +17,7 @@ Patch5: iproute2-2.6.35-print-route.patch Patch6: iproute2-2.6.39-create-peer-veth-without-a-name.patch Patch7: iproute2-2.6.39-lnstat-dump-to-stdout.patch Patch8: iproute2-3.8.0-unused-result.patch -Patch9: iproute2-3.9.0-xfrm-state-overflow.patch +Patch9: iproute2-3.10.0-xfrm-state-overflow.patch License: GPLv2+ and Public Domain BuildRequires: bison BuildRequires: flex @@ -172,6 +172,9 @@ done %{_includedir}/libnetlink.h %changelog +* Wed Jul 17 2013 Petr Šabata - 3.10.0-2 +- Fix the XFRM patch + * Wed Jul 17 2013 Petr Šabata - 3.10.0-1 - 3.10.0 bump - Drop the SHAREDIR patch and revert to upstream ways (#966445) diff --git a/iproute2-3.9.0-xfrm-state-overflow.patch b/iproute2-3.10.0-xfrm-state-overflow.patch similarity index 69% rename from iproute2-3.9.0-xfrm-state-overflow.patch rename to iproute2-3.10.0-xfrm-state-overflow.patch index 3fe3c3c..dfe448a 100644 --- a/iproute2-3.9.0-xfrm-state-overflow.patch +++ b/iproute2-3.10.0-xfrm-state-overflow.patch @@ -1,6 +1,6 @@ -From 9d0e33ed670f222208a0fc09b367b8adc3a3a9c5 Mon Sep 17 00:00:00 2001 +From 7887635f629c5a73be5e2db0a1a8a221e8b16077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= -Date: Thu, 11 Jul 2013 17:09:07 +0200 +Date: Wed, 17 Jul 2013 15:29:54 +0200 Subject: [PATCH] Avoid overflow segfault with FORTIFY_SOURCE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,14 +8,14 @@ Content-Transfer-Encoding: 8bit Signed-off-by: Petr Šabata --- - ip/xfrm_state.c | 5 +++++ - 1 file changed, 5 insertions(+) + ip/xfrm_state.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c -index 61a8f02..b3780c5 100644 +index 389942c..160ab32 100644 --- a/ip/xfrm_state.c +++ b/ip/xfrm_state.c -@@ -155,12 +155,17 @@ static int xfrm_algo_parse(struct xfrm_algo *alg, enum xfrm_attr_type_t type, +@@ -157,12 +157,16 @@ static int xfrm_algo_parse(struct xfrm_algo *alg, enum xfrm_attr_type_t type, buf[j] = val; } } else { @@ -25,7 +25,7 @@ index 61a8f02..b3780c5 100644 if (len > max) invarg("ALGO-KEYMAT value makes buffer overflow\n", key); - strncpy(buf, key, len); +- strncpy(buf, key, len); + for (i = 0 ; i < len && key[i] != '\0'; i++) + buf[i] = key[i]; + for ( ; i < len; i++)