From 3681027dea446c8e64583b5cbfe84496d509914e Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Sun, 27 Jan 2019 18:34:51 +0100 Subject: [PATCH] Fix double free of InterfaceList (#1669298) --- radvd-double_free_ifacelist.patch | 23 +++++++++++++++++++++++ radvd.spec | 7 ++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 radvd-double_free_ifacelist.patch diff --git a/radvd-double_free_ifacelist.patch b/radvd-double_free_ifacelist.patch new file mode 100644 index 0000000..16c59b8 --- /dev/null +++ b/radvd-double_free_ifacelist.patch @@ -0,0 +1,23 @@ +From fb1529d0573d3d9744a0e9fea8dd0becfc91ad85 Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +Date: Thu, 24 Jan 2019 13:21:55 +0100 +Subject: [PATCH] Fix double-free scenario in case if duplicate interface was + specified (Fixes #100). + +Signed-off-by: Pavel Zhukov +--- + gram.y | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gram.y b/gram.y +index 5db3bde..20af2f3 100644 +--- a/gram.y ++++ b/gram.y +@@ -958,6 +958,7 @@ struct Interface * readin_config(char const *path) + if (yyparse() != 0) { + free_ifaces(iface); + iface = 0; ++ IfaceList = 0; + } else { + dlog(LOG_DEBUG, 1, "config file, %s, syntax ok", path); + } diff --git a/radvd.spec b/radvd.spec index 3c586e7..af3c366 100644 --- a/radvd.spec +++ b/radvd.spec @@ -1,7 +1,7 @@ Summary: A Router Advertisement daemon Name: radvd Version: 2.17 -Release: 16%{?dist} +Release: 17%{?dist} # The code includes the advertising clause, so it's GPL-incompatible License: BSD with advertising Group: System Environment/Daemons @@ -14,6 +14,7 @@ Patch0: radvd-werror.patch Patch1: radvd-endianess.patch Patch2: radvd-stderr_logging.patch Patch3: radvd-nodaemon_manpage,patch +Patch4: radvd-double_free_ifacelist.patch BuildRequires: gcc BuildRequires: bison @@ -42,6 +43,7 @@ services. %patch1 -p1 -b .endianess %patch2 -p1 -b .stderr %patch3 -p1 -b .nodaemon +%patch4 -p1 -b .ifacelist for F in CHANGES; do iconv -f iso-8859-1 -t utf-8 < "$F" > "${F}.new" @@ -104,6 +106,9 @@ exit 0 %{_sbindir}/radvdump %changelog +* Sun Jan 27 2019 Pavel Zhukov - 2.17-17 +- Fix double-free in InterfaceList + * Tue Nov 27 2018 Pavel Zhukov - 2.17-16 - Depends on network-online target (#1652459)