From 3d8269aa53d248040ec947e5debbec96f44402ff Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 21 Apr 2022 16:28:59 +0200 Subject: [PATCH] route: fix crash parsing multihop route (rh #2081279) --- ...caused-by-parse_multipath-by-wrong-f.patch | 30 +++++++++++++++++++ libnl3.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0001-route-fix-crash-caused-by-parse_multipath-by-wrong-f.patch diff --git a/0001-route-fix-crash-caused-by-parse_multipath-by-wrong-f.patch b/0001-route-fix-crash-caused-by-parse_multipath-by-wrong-f.patch new file mode 100644 index 0000000..0aaab21 --- /dev/null +++ b/0001-route-fix-crash-caused-by-parse_multipath-by-wrong-f.patch @@ -0,0 +1,30 @@ +From 2bc7a785dbd4b882d32e20502d4f3518f8c7610b Mon Sep 17 00:00:00 2001 +From: Thomas Haller +Date: Tue, 3 May 2022 18:59:22 +0200 +Subject: [PATCH 1/1] route: fix crash caused by parse_multipath() by wrong + free() + +https://bugzilla.redhat.com/show_bug.cgi?id=2081279 + +Fixes: b50be8fa869b ('rtnl/route: use cleanup attribute in "lib/route/route_obj.c"') +(cherry picked from commit 9b0493646c20f3eecdf664e7e00c6c9162e04fba) +--- + lib/route/route_obj.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c +index 4fdd23c19842..9441b77a76e5 100644 +--- a/lib/route/route_obj.c ++++ b/lib/route/route_obj.c +@@ -1102,7 +1102,7 @@ static int parse_multipath(struct rtnl_route *route, struct nlattr *attr) + } + } + +- rtnl_route_add_nexthop(route, nh); ++ rtnl_route_add_nexthop(route, _nl_steal_pointer(&nh)); + tlen -= RTNH_ALIGN(rtnh->rtnh_len); + rtnh = RTNH_NEXT(rtnh); + } +-- +2.35.1 + diff --git a/libnl3.spec b/libnl3.spec index 391c814..9a23acf 100644 --- a/libnl3.spec +++ b/libnl3.spec @@ -1,6 +1,6 @@ Name: libnl3 Version: 3.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Convenience library for kernel netlink sockets License: LGPLv2 URL: http://www.infradead.org/~tgr/libnl/ @@ -19,6 +19,7 @@ Source: http://www.infradead.org/~tgr/libnl/files/libnl-%{fullversion}.tar.gz Source1: http://www.infradead.org/~tgr/libnl/files/libnl-doc-%{fullversion}.tar.gz #Patch1: some.patch +Patch1: 0001-route-fix-crash-caused-by-parse_multipath-by-wrong-f.patch BuildRequires: autoconf @@ -153,6 +154,9 @@ popd %endif %changelog +* Fri May 6 2022 Thomas Haller - 3.6.0-2 +- route: fix crash parsing multihop route (rh #2081279) + * Fri Apr 15 2022 Thomas Haller - 3.6.0-1 - Update to 3.6.0 release