6e52066a8e
- Optimized if and when DNS client context and ports are initted (bsc#1073935) [+ 0022-Optimized-if-and-when-DNS-client-context-and-.patch] - Plugs a socket descriptor leak in OMAPI(bsc#1076119, CVE-2017-3144) [ +0021-master-Plugs-a-socket-descriptor-leak-in-OMAPI.patch] OBS-URL: https://build.opensuse.org/request/show/567653 OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=181
62 lines
1.9 KiB
Diff
62 lines
1.9 KiB
Diff
From 1a6b62fe17a42b00fa234d06b6dfde3d03451894 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Markwalder <tmark@isc.org>
|
|
Date: Thu, 7 Dec 2017 11:23:36 -0500
|
|
Subject: [PATCH] [master] Plugs a socket descriptor leak in OMAPI
|
|
|
|
Merges in rt46767.
|
|
---
|
|
RELNOTES | 5 +++++
|
|
omapip/buffer.c | 9 +++++++++
|
|
omapip/message.c | 2 +-
|
|
3 files changed, 15 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/RELNOTES b/RELNOTES
|
|
index cf44b3e..d43e7b3 100644
|
|
--- a/RELNOTES
|
|
+++ b/RELNOTES
|
|
@@ -919,6 +919,11 @@ by Eric Young (eay@cryptsoft.com).
|
|
and our website for directions on bug submissions.
|
|
[ISC-Bugs #24789]
|
|
|
|
+- Plugged a socket descriptor leak in OMAPI, that can occur when there is
|
|
+ data pending to be written to an OMAPI connection, when the connection
|
|
+ is closed by the reader.
|
|
+ [ISc-Bugs #46767]
|
|
+
|
|
Changes since 4.2.0 (new features)
|
|
|
|
- If a client renews before 'dhcp-cache-threshold' percent of its lease
|
|
diff --git a/omapip/buffer.c b/omapip/buffer.c
|
|
index f7fdc32..809034d 100644
|
|
--- a/omapip/buffer.c
|
|
+++ b/omapip/buffer.c
|
|
@@ -566,6 +566,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 59ccdc2..21bcfc3 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";
|