diff --git a/SOURCES/bz1693706-fix-smtp-alerts-segfault.patch b/SOURCES/bz1693706-fix-smtp-alerts-segfault.patch new file mode 100644 index 0000000..35da553 --- /dev/null +++ b/SOURCES/bz1693706-fix-smtp-alerts-segfault.patch @@ -0,0 +1,26 @@ +From fdb1739356f723a4e9e4f8b52c37d193a3a5c6e3 Mon Sep 17 00:00:00 2001 +From: Quentin Armitage +Date: Tue, 27 Nov 2018 10:57:37 +0000 +Subject: [PATCH] Fix segfault when smtp alerts configured + +Signed-off-by: Quentin Armitage +--- + keepalived/core/global_data.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/keepalived/core/global_data.c b/keepalived/core/global_data.c +index 6e872dcf..cd381d9b 100644 +--- a/keepalived/core/global_data.c ++++ b/keepalived/core/global_data.c +@@ -253,7 +253,7 @@ init_global_data(data_t * data, data_t *old_global_data) + if (!data->smtp_connection_to) + set_default_smtp_connection_timeout(data); + +- if (strcmp(data->local_name, unknown_name)) { ++ if (data->local_name && strcmp(data->local_name, unknown_name)) { + if (!data->email_from) + set_default_email_from(data, data->local_name); + +-- +2.20.1 + diff --git a/SOURCES/bz1693706-fix-smtp_helo_name-double-free.patch b/SOURCES/bz1693706-fix-smtp_helo_name-double-free.patch new file mode 100644 index 0000000..43d1c0b --- /dev/null +++ b/SOURCES/bz1693706-fix-smtp_helo_name-double-free.patch @@ -0,0 +1,39 @@ +From e91583fb20b584621dd48031bef68279945f7aa6 Mon Sep 17 00:00:00 2001 +From: Quentin Armitage +Date: Tue, 20 Nov 2018 13:03:55 +0000 +Subject: [PATCH] Fix double free when global data smtp_helo_name copied from + local_name + +Issue #1071 identified a double free fault. It occurred when smtp_helo_name +was not set, in which case it was set to point to the same malloc'd memory +as local_name. At termination keepalived freed both local_name and +smtp_helo_name. + +If keepalived needs to use local_name for smtp_helo_name it now malloc's +aadditional memory to copy the string into. + +Signed-off-by: Quentin Armitage +--- + keepalived/core/global_data.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/keepalived/core/global_data.c b/keepalived/core/global_data.c +index cd381d9b..be9fecbd 100644 +--- a/keepalived/core/global_data.c ++++ b/keepalived/core/global_data.c +@@ -257,8 +257,10 @@ init_global_data(data_t * data, data_t *old_global_data) + if (!data->email_from) + set_default_email_from(data, data->local_name); + +- if (!data->smtp_helo_name) +- data->smtp_helo_name = data->local_name; ++ if (!data->smtp_helo_name) { ++ data->smtp_helo_name = MALLOC(strlen(data->local_name) + 1); ++ strcpy(data->smtp_helo_name, data->local_name); ++ } + } + } + +-- +2.20.1 + diff --git a/SPECS/keepalived.spec b/SPECS/keepalived.spec index 997e502..4205027 100644 --- a/SPECS/keepalived.spec +++ b/SPECS/keepalived.spec @@ -9,7 +9,7 @@ Name: keepalived Summary: High Availability monitor built upon LVS, VRRP and service pollers Version: 2.0.10 -Release: 4%{?dist}.1 +Release: 4%{?dist}.2 License: GPLv2+ URL: http://www.keepalived.org/ Group: System Environment/Daemons @@ -21,6 +21,8 @@ Patch1: bz1688892-fix-openssl-init-failure.patch Patch2: bz1688892-fix-openssl-init-genhash.patch Patch3: bz1688892-fix-openssl-init-config-check.patch Patch4: bz1688892-fix-openssl-init-configure.patch +Patch5: bz1693706-fix-smtp-alerts-segfault.patch +Patch6: bz1693706-fix-smtp_helo_name-double-free.patch Requires(post): systemd Requires(preun): systemd @@ -58,6 +60,8 @@ infrastructures. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build %configure \ @@ -107,6 +111,10 @@ mkdir -p %{buildroot}%{_libexecdir}/keepalived %{_mandir}/man8/keepalived.8* %changelog +* Wed May 01 2019 Ryan O'Hara - 2.0.10-4.2 +- Fix segfault when smtp alerts configured (#1693706) +- Fix double free when smtp_helo_name copied from local_name (#1693706) + * Thu Apr 04 2019 Ryan O'Hara - 2.0.10-4.1 - Rebuild for z-stream (#1690306)