Compare commits

..

2 Commits

Author SHA1 Message Date
CentOS Sources
4112cd15e8 import radvd-2.17-15.el8 2021-09-10 03:45:49 +00:00
CentOS Sources
3d487c1766 import radvd-2.17-14.el8 2021-09-10 03:45:46 +00:00
5 changed files with 121 additions and 7 deletions

View File

@ -0,0 +1,65 @@
From 57295ef0e85640adcc3b85f08b12f09d54aad2d2 Mon Sep 17 00:00:00 2001
From: Tomi Salminen <tsalminen@forcepoint.com>
Date: Tue, 16 Apr 2019 13:55:39 +0300
Subject: [PATCH] Crash on SIGHUP when config file removed.
Reading config zeroed the returnable configuration only when the
config file was opened successfully. If not, the previously read
in configuration was returned, which was already freed.
Moved configuration zeroing to start of readin_config and added
unit test to test zero return.
---
gram.y | 2 +-
test/util.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/gram.y b/gram.y
index 20af2f3..4115390 100644
--- a/gram.y
+++ b/gram.y
@@ -947,10 +947,10 @@ static void cleanup(void)
struct Interface * readin_config(char const *path)
{
+ IfaceList = 0;
FILE * in = fopen(path, "r");
if (in) {
filename = path;
- IfaceList = 0;
num_lines = 1;
iface = 0;
diff --git a/test/util.c b/test/util.c
index b74b301..7124475 100644
--- a/test/util.c
+++ b/test/util.c
@@ -259,6 +259,20 @@ START_TEST(test_rand_between)
}
END_TEST
+START_TEST(test_cfg_removal_with_sighup)
+{
+ struct Interface *tmpIface = NULL;
+
+ tmpIface = readin_config("test/test1.conf");
+ ck_assert(tmpIface);
+
+ free_ifaces(tmpIface);
+
+ tmpIface = readin_config("test/file_that_should_not_exists.conf");
+ ck_assert(!tmpIface);
+}
+END_TEST
+
Suite *util_suite(void)
{
TCase *tc_safe_buffer = tcase_create("safe_buffer");
@@ -288,6 +302,7 @@ Suite *util_suite(void)
TCase *tc_misc = tcase_create("misc");
tcase_add_test(tc_misc, test_rand_between);
+ tcase_add_test(tc_misc, test_cfg_removal_with_sighup);
Suite *s = suite_create("util");
suite_add_tcase(s, tc_safe_buffer);

View File

@ -0,0 +1,23 @@
From fb1529d0573d3d9744a0e9fea8dd0becfc91ad85 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
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 <pzhukov@redhat.com>
---
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);
}

View File

@ -1 +0,0 @@
d /var/run/radvd 0755 radvd radvd

View File

@ -0,0 +1,18 @@
From 30198b37dd9d8cb3b15c90663145d06e2531d87f Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Tue, 26 Feb 2019 14:37:16 +0100
Subject: [PATCH] packaging: Change location of tmpfiles to /run to avoid
warnings
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1678147
---
redhat/systemd/radvd-tmpfs.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/redhat/systemd/radvd-tmpfs.conf b/redhat/systemd/radvd-tmpfs.conf
index 590652c..26f203d 100644
--- a/redhat/radvd-tmpfs.conf
+++ b/redhat/radvd-tmpfs.conf
@@ -1 +1 @@
-d /var/run/radvd 0755 radvd radvd
+d /run/radvd 0755 radvd radvd

View File

@ -1,14 +1,13 @@
Summary: A Router Advertisement daemon
Name: radvd
Version: 2.17
Release: 12%{?dist}
Release: 15%{?dist}
# The code includes the advertising clause, so it's GPL-incompatible
License: BSD with advertising
Group: System Environment/Daemons
URL: http://www.litech.org/radvd/
Source0: %{url}dist/%{name}-%{version}.tar.xz
Source1: radvd-tmpfs.conf
Source2: radvd.service
Source1: radvd.service
BuildRequires: gcc
BuildRequires: bison
@ -21,6 +20,9 @@ BuildRequires: systemd
Requires(pre): shadow-utils
Patch0: radvd_add_ra_memleak.patch
Patch1: radvd_tmpfiles.patch
Patch2: radvd-double_free_dupiface.patch
Patch3: radvd-crash_if_config_removed.patch
%description
radvd is the router advertisement daemon for IPv6. It listens to router
@ -34,7 +36,7 @@ Install radvd if you are setting up IPv6 network and/or Mobile IPv6
services.
%prep
%autosetup
%autosetup -p1
for F in CHANGES; do
iconv -f iso-8859-1 -t utf-8 < "$F" > "${F}.new"
@ -61,8 +63,8 @@ install -m 644 redhat/radvd.conf.empty %{buildroot}%{_sysconfdir}/radvd.conf
install -m 644 redhat/radvd.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/radvd
install -d -m 755 %{buildroot}%{_tmpfilesdir}
install -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/radvd.conf
install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
install -p -m 644 redhat/radvd-tmpfs.conf %{buildroot}%{_tmpfilesdir}/radvd.conf
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
%check
# The tests don't work, see https://github.com/reubenhwk/radvd/issues/30
@ -97,6 +99,13 @@ exit 0
%{_sbindir}/radvdump
%changelog
* Wed Apr 15 2020 Pavel Zhukov <pzhukov@redhat.com> - 2.17-15
- Fix double-free scenario (#1669177)
* Fri Oct 25 2019 Pavel Zhukov <pzhukov@redhat.com> - 2.17-14
- Resolves: #1710787 - Change location of tmpfiles
- Use tmpfile config from tarball
* Tue Dec 4 2018 Pavel Zhukov <pzhukov@redhat.com> - 2.17-12
- Resolves: #1652459 - Wait for all devices to be initialized