From bebbe6c7d0874c7903ee8c58149208e82a7b2aeb Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Fri, 15 Mar 2013 11:41:41 +0100 Subject: [PATCH] Allocate dhcp_buff-ers also if daemon->ra_contexts to prevent SIGSEGV (#920300) Signed-off-by: Tomas Hozza --- ..._buff-ers-also-if-deamon-ra_contexts.patch | 37 +++++++++++++++++++ dnsmasq.spec | 9 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 dnsmasq-2.65-Allocate-dhcp_buff-ers-also-if-deamon-ra_contexts.patch diff --git a/dnsmasq-2.65-Allocate-dhcp_buff-ers-also-if-deamon-ra_contexts.patch b/dnsmasq-2.65-Allocate-dhcp_buff-ers-also-if-deamon-ra_contexts.patch new file mode 100644 index 0000000..3f6005f --- /dev/null +++ b/dnsmasq-2.65-Allocate-dhcp_buff-ers-also-if-deamon-ra_contexts.patch @@ -0,0 +1,37 @@ +From c2845b1f4047c7441bae46c8651ab6a6df9d832c Mon Sep 17 00:00:00 2001 +From: Tomas Hozza +Date: Fri, 15 Mar 2013 10:55:55 +0100 +Subject: [PATCH] Allocate dhcp_buff-ers also if deamon->ra_contexts + +Allocate dhcp_buff and prevent SIGSEGV. + +Signed-off-by: Tomas Hozza +--- + dnsmasq-2.65/src/dnsmasq.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dnsmasq-2.65/src/dnsmasq.c b/dnsmasq-2.65/src/dnsmasq.c +index 02055e9..d61810b 100644 +--- a/dnsmasq-2.65/src/dnsmasq.c ++++ b/dnsmasq-2.65/src/dnsmasq.c +@@ -152,13 +152,16 @@ int main (int argc, char **argv) + now = dnsmasq_time(); + + #ifdef HAVE_DHCP +- if (daemon->dhcp || daemon->dhcp6) ++ if (daemon->dhcp || daemon->dhcp6 || daemon->ra_contexts) + { + /* Note that order matters here, we must call lease_init before + creating any file descriptors which shouldn't be leaked + to the lease-script init process. We need to call common_init + before lease_init to allocate buffers it uses.*/ + dhcp_common_init(); ++ } ++ if (daemon->dhcp || daemon->dhcp6) ++ { + lease_init(now); + + if (daemon->dhcp) +-- +1.8.1.4 + diff --git a/dnsmasq.spec b/dnsmasq.spec index 8573333..65a4141 100644 --- a/dnsmasq.spec +++ b/dnsmasq.spec @@ -11,7 +11,7 @@ Name: dnsmasq Version: 2.65 -Release: 4%{?extraversion}%{?dist} +Release: 5%{?extraversion}%{?dist} Summary: A lightweight DHCP/caching DNS server Group: System Environment/Daemons @@ -24,6 +24,9 @@ Source1: %{name}.service Patch0: %{name}-2.65-Correct-behaviour-for-TCP-queries-to-allowed-address.patch # http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=e25db1f273920d58c5d2e7569cd087e5bd73dd73 Patch1: %{name}-2.65-Handle-wrong-interface-for-locally-routed-packets.patch +# Code has been completely rewritten in new version +# http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q1/006967.html +Patch2: %{name}-2.65-Allocate-dhcp_buff-ers-also-if-deamon-ra_contexts.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -60,6 +63,7 @@ query/remove a DHCP server's leases. %patch0 -p1 -b .CVE-2013-0198 %patch1 -p1 -b .local_queries +%patch2 -p2 -b .SIGSEGV # use /var/lib/dnsmasq instead of /var/lib/misc for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do @@ -137,6 +141,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/dhcp_* %changelog +* Fri Mar 15 2013 Tomas Hozza - 2.65-5 +- Allocate dhcp_buff-ers also if daemon->ra_contexts to prevent SIGSEGV (#920300) + * Thu Jan 31 2013 Tomas Hozza - 2.65-4 - Handle locally-routed DNS Queries (#904940)