diff --git a/avahi-glib2.spec b/avahi-glib2.spec index d4b1426..f5e078a 100644 --- a/avahi-glib2.spec +++ b/avahi-glib2.spec @@ -74,6 +74,8 @@ Patch4: avahi-init-dnsconfd-fix-status.patch Patch5: avahi-fix-howl.pc.patch #PATCH-FIX-OPENSUSE avahi-unicastdomains.patch bnc433359 lnussel@suse.de -- disable pre-set unicast domains by default Patch10: avahi-unicastdomains.patch +# PATCH-FIX-UPSTREAM avahi-null-packet-infinite-loop.patch bnc#671797 vuntz@opensuse.org -- Fix infinite loop for corrupted/null packets, http://www.avahi.org/ticket/325 +Patch11: avahi-null-packet-infinite-loop.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: dbus-1-python fdupes gcc-c++ gdbm-devel intltool libdaemon-devel libexpat-devel pkg-config translation-update-upstream # Even if we are not building python bindings, we need python to build service types database: @@ -647,6 +649,7 @@ translation-update-upstream %patch4 -p1 %patch5 -p1 %patch10 -p1 +%patch11 -p1 %if !%build_core # Replace all .la references from local .la files to installed versions # with exception of libavahi-glib.la. diff --git a/avahi-mono.spec b/avahi-mono.spec index c443bfb..1abbba6 100644 --- a/avahi-mono.spec +++ b/avahi-mono.spec @@ -74,6 +74,8 @@ Patch4: avahi-init-dnsconfd-fix-status.patch Patch5: avahi-fix-howl.pc.patch #PATCH-FIX-OPENSUSE avahi-unicastdomains.patch bnc433359 lnussel@suse.de -- disable pre-set unicast domains by default Patch10: avahi-unicastdomains.patch +# PATCH-FIX-UPSTREAM avahi-null-packet-infinite-loop.patch bnc#671797 vuntz@opensuse.org -- Fix infinite loop for corrupted/null packets, http://www.avahi.org/ticket/325 +Patch11: avahi-null-packet-infinite-loop.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: dbus-1-python fdupes gcc-c++ gdbm-devel intltool libdaemon-devel libexpat-devel pkg-config translation-update-upstream # Even if we are not building python bindings, we need python to build service types database: @@ -646,6 +648,7 @@ translation-update-upstream %patch4 -p1 %patch5 -p1 %patch10 -p1 +%patch11 -p1 %if !%build_core # Replace all .la references from local .la files to installed versions # with exception of libavahi-glib.la. diff --git a/avahi-null-packet-infinite-loop.patch b/avahi-null-packet-infinite-loop.patch new file mode 100644 index 0000000..c1c02bf --- /dev/null +++ b/avahi-null-packet-infinite-loop.patch @@ -0,0 +1,60 @@ +commit 10e10a37d13c6c9b8d58a509460ceeaeb59023f0 +Author: Vincent Untz +Date: Thu Feb 17 15:36:37 2011 +0100 + + socket: Still read corrupt packets from the sockets + + Else, we end up with an infinite loop with 100% CPU. + + http://www.avahi.org/ticket/325 + +diff --git a/avahi-core/socket.c b/avahi-core/socket.c +index be62105..e4438eb 100644 +--- a/avahi-core/socket.c ++++ b/avahi-core/socket.c +@@ -653,10 +653,6 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv4( + goto fail; + } + +- /* For corrupt packets FIONREAD returns zero size (See rhbz #607297) */ +- if (!ms) +- goto fail; +- + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); + + io.iov_base = AVAHI_DNS_PACKET_DATA(p); +@@ -683,6 +679,11 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv4( + goto fail; + } + ++ /* For corrupt packets FIONREAD returns zero size (See rhbz #607297). So ++ * fail after having read them. */ ++ if (!ms) ++ goto fail; ++ + if (sa.sin_addr.s_addr == INADDR_ANY) { + /* Linux 2.4 behaves very strangely sometimes! */ + goto fail; +@@ -810,10 +811,6 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv6( + goto fail; + } + +- /* For corrupt packets FIONREAD returns zero size (See rhbz #607297) */ +- if (!ms) +- goto fail; +- + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); + + io.iov_base = AVAHI_DNS_PACKET_DATA(p); +@@ -841,6 +838,11 @@ AvahiDnsPacket *avahi_recv_dns_packet_ipv6( + goto fail; + } + ++ /* For corrupt packets FIONREAD returns zero size (See rhbz #607297). So ++ * fail after having read them. */ ++ if (!ms) ++ goto fail; ++ + assert(!(msg.msg_flags & MSG_CTRUNC)); + assert(!(msg.msg_flags & MSG_TRUNC)); + diff --git a/avahi-qt4.spec b/avahi-qt4.spec index 2887e95..972cc18 100644 --- a/avahi-qt4.spec +++ b/avahi-qt4.spec @@ -74,6 +74,8 @@ Patch4: avahi-init-dnsconfd-fix-status.patch Patch5: avahi-fix-howl.pc.patch #PATCH-FIX-OPENSUSE avahi-unicastdomains.patch bnc433359 lnussel@suse.de -- disable pre-set unicast domains by default Patch10: avahi-unicastdomains.patch +# PATCH-FIX-UPSTREAM avahi-null-packet-infinite-loop.patch bnc#671797 vuntz@opensuse.org -- Fix infinite loop for corrupted/null packets, http://www.avahi.org/ticket/325 +Patch11: avahi-null-packet-infinite-loop.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: dbus-1-python fdupes gcc-c++ gdbm-devel intltool libdaemon-devel libexpat-devel pkg-config translation-update-upstream # Even if we are not building python bindings, we need python to build service types database: @@ -649,6 +651,7 @@ translation-update-upstream %patch4 -p1 %patch5 -p1 %patch10 -p1 +%patch11 -p1 %if !%build_core # Replace all .la references from local .la files to installed versions # with exception of libavahi-glib.la. diff --git a/avahi.changes b/avahi.changes index 517be99..1561df5 100644 --- a/avahi.changes +++ b/avahi.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 17 15:38:40 CET 2011 - vuntz@opensuse.org + +- Add avahi-null-packet-infinite-loop.patch: fix an infinite loop + eating CPU when receiving corrupted/null packets. Fix bnc#671797. + ------------------------------------------------------------------- Sun Feb 13 13:48:53 CET 2011 - vuntz@opensuse.org diff --git a/avahi.spec b/avahi.spec index af30bd0..f37911a 100644 --- a/avahi.spec +++ b/avahi.spec @@ -76,6 +76,8 @@ Patch4: avahi-init-dnsconfd-fix-status.patch Patch5: avahi-fix-howl.pc.patch #PATCH-FIX-OPENSUSE avahi-unicastdomains.patch bnc433359 lnussel@suse.de -- disable pre-set unicast domains by default Patch10: avahi-unicastdomains.patch +# PATCH-FIX-UPSTREAM avahi-null-packet-infinite-loop.patch bnc#671797 vuntz@opensuse.org -- Fix infinite loop for corrupted/null packets, http://www.avahi.org/ticket/325 +Patch11: avahi-null-packet-infinite-loop.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: dbus-1-python fdupes gcc-c++ gdbm-devel intltool libdaemon-devel libexpat-devel pkg-config translation-update-upstream # Even if we are not building python bindings, we need python to build service types database: @@ -649,6 +651,7 @@ translation-update-upstream %patch4 -p1 %patch5 -p1 %patch10 -p1 +%patch11 -p1 %if !%build_core # Replace all .la references from local .la files to installed versions # with exception of libavahi-glib.la.