about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2016-04-22 10:35:41 -0500
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-04-22 14:53:25 -0500
commit04130e53ba685dd7138e3e928708e17923f795b5 (patch)
treef7853df593043d3313511b771bc3b726ee2e909a
parentc5ae7f9a3b543426cb186fb7b493f9d8458467a9 (diff)
downloadglibc-04130e53ba685dd7138e3e928708e17923f795b5.tar.gz
glibc-04130e53ba685dd7138e3e928708e17923f795b5.tar.xz
glibc-04130e53ba685dd7138e3e928708e17923f795b5.zip
Fix invalid file descriptor reuse while sending DNS query (BZ #15946)
(cherry picked from commit 45af2f6fe19b8a776373cac5a2691460179aa1a3)
-rw-r--r--ChangeLog6
-rw-r--r--NEWS4
-rw-r--r--resolv/res_send.c1
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index de1bb7ce24..0be4a594d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-22  Andreas Schwab  <schwab@suse.de>
+
+	[BZ #15946]
+	* resolv/res_send.c (send_dg): Reload file descriptor after
+	calling reopen.
+
 2016-04-22  Carlos O'Donell  <carlos@redhat.com>
 
 	[BZ #18665]
diff --git a/NEWS b/NEWS
index 16a8c152c1..94bcc4e54b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,8 @@ Version 2.18.1
 
 * The following bugs are resolved with this release:
 
-  15073, 15128, 15909, 15996, 16009, 16150, 16169, 16387, 16510, 16885,
-  16916, 16943, 16958, 17269, 18032, 18665, 18928, 19018.
+  15073, 15128, 15909, 15946, 15996, 16009, 16150, 16169, 16387, 16510,
+  16885, 16916, 16943, 16958, 17269, 18032, 18665, 18928, 19018.
 
 * The LD_POINTER_GUARD environment variable can no longer be used to
   disable the pointer guard feature.  It is always enabled.
diff --git a/resolv/res_send.c b/resolv/res_send.c
index bc98e59cdb..e8b1809eab 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1542,6 +1542,7 @@ send_dg(res_state statp,
 					retval = reopen (statp, terrno, ns);
 					if (retval <= 0)
 						return retval;
+					pfd[0].fd = EXT(statp).nssocks[ns];
 				}
 			}
 			goto wait;