diff --git a/dhcp-4.3.6-omapi-leak.patch b/dhcp-4.3.6-omapi-leak.patch new file mode 100644 index 0000000..0ffcfe3 --- /dev/null +++ b/dhcp-4.3.6-omapi-leak.patch @@ -0,0 +1,52 @@ +commit ccff9ed69d0b26d33ce9cac8e83dab535b64d627 +Author: Thomas Markwalder +Date: Tue Dec 5 15:12:34 2017 -0500 + + [46767] Plugged a socket descriptor leak in OMAPI + + If disconnect is triggered by the reader closing the socket, while there + is data left to write, the socket would be orphaned. + + omapip/buffer.c + omapi_connection_writea() - added logic to recall disconnect once + pending data has been written + + omapip/message.c + Removed static declaration from omapi_message_unregister so you can + actually compile when DEBUG_PROTOCOL is defined. + + Added a release note + +diff --git a/omapip/buffer.c b/omapip/buffer.c +index 6e0621b..a21f0a8 100644 +--- a/omapip/buffer.c ++++ b/omapip/buffer.c +@@ -565,6 +565,15 @@ isc_result_t omapi_connection_writer (omapi_object_t *h) + omapi_buffer_dereference (&buffer, MDL); + } + } ++ ++ /* If we had data left to write when we're told to disconnect, ++ * we need recall disconnect, now that we're done writing. ++ * See rt46767. */ ++ if (c->out_bytes == 0 && c->state == omapi_connection_disconnecting) { ++ omapi_disconnect (h, 1); ++ return ISC_R_SHUTTINGDOWN; ++ } ++ + return ISC_R_SUCCESS; + } + +diff --git a/omapip/message.c b/omapip/message.c +index ee15d82..37abbd2 100644 +--- a/omapip/message.c ++++ b/omapip/message.c +@@ -339,7 +339,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo) + } + + #ifdef DEBUG_PROTOCOL +-static const char *omapi_message_op_name(int op) { ++const char *omapi_message_op_name(int op) { + switch (op) { + case OMAPI_OP_OPEN: return "OMAPI_OP_OPEN"; + case OMAPI_OP_REFRESH: return "OMAPI_OP_REFRESH"; diff --git a/dhcp.spec b/dhcp.spec index 12c762f..dd7a617 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -20,7 +20,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.3.6 %global VERSION %%{version}%%{prever} -Release: 6%{?dist} +Release: 7%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and # that's why it is at 12 now. It should have never been used, but it was. @@ -76,6 +76,7 @@ Patch34: dhcp-sd_notify.patch Patch36: dhcp-option97-pxe-client-id.patch Patch37: dhcp-stateless-DUID-LLT.patch Patch38: dhcp-dhclient-preinit6s.patch +Patch40: dhcp-4.3.6-omapi-leak.patch BuildRequires: autoconf @@ -335,6 +336,10 @@ rm bind/bind.tar.gz # dhclient: make sure link-local address is ready in stateless mode (#1263466) %patch38 -p1 -b .preinit6s +# close omapi socker descriptions properly +# https://bugzilla.redhat.com/1523547 +%patch40 -p1 -b .omapi-leak + # DHCLIENT_DEFAULT_PREFIX_LEN 64 -> 128 # https://bugzilla.gnome.org/show_bug.cgi?id=656610 sed -i -e 's|DHCLIENT_DEFAULT_PREFIX_LEN 64|DHCLIENT_DEFAULT_PREFIX_LEN 128|g' includes/site.h @@ -661,6 +666,9 @@ done %endif %changelog +* Fri Dec 8 2017 Pavel Zhukov - 12:4.3.6-7 +- Fix omapi SD leak (#1523547) + * Wed Sep 20 2017 Pavel Zhukov - 12:4.3.6-6 - Do now override hostname variable in script