[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 01/01: Update from upstream stable branch:



This is an automated email from the git hooks/post-receive script.

aurel32 pushed a commit to branch sid
in repository glibc.

commit 7234ed60f8ecb6aa922699e69aabbc3817652553
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Mon Mar 28 22:50:19 2016 +0200

    Update from upstream stable branch:
    
    * Update from upstream stable branch:
      - Fix assertion failure with unconnectable name server addresses.  Closes:
        #816669.
---
 debian/changelog                |   3 +
 debian/patches/git-updates.diff | 205 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 190 insertions(+), 18 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 5300c36..c51d480 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ glibc (2.22-5) UNRELEASED; urgency=medium
   * testsuite-xfail-debian.mk: Disable the problematic test-lfs test on hurd.
 
   [ Aurelien Jarno ]
+  * Update from upstream stable branch:
+    - Fix assertion failure with unconnectable name server addresses.  Closes:
+      #816669.
   * Drop libnss-dns-udeb and libnss-files-udeb and merge the files they
     include in libc6-udeb.
 
diff --git a/debian/patches/git-updates.diff b/debian/patches/git-updates.diff
index 6882c1c..abb6fd9 100644
--- a/debian/patches/git-updates.diff
+++ b/debian/patches/git-updates.diff
@@ -1,10 +1,25 @@
 GIT update of git://sourceware.org/git/glibc.git/release/2.22/master from glibc-2.22
 
 diff --git a/ChangeLog b/ChangeLog
-index cb9124e..ba4a3f2 100644
+index cb9124e..3e0d69b 100644
 --- a/ChangeLog
 +++ b/ChangeLog
-@@ -1,3 +1,385 @@
+@@ -1,3 +1,400 @@
++2016-03-25  Florian Weimer  <fweimer@redhat.com>
++
++	[BZ #19791]
++	* resolv/res_send.c (close_and_return_error): New function.
++	(send_dg): Initialize *resplen2 after reopen failure.  Call
++	close_and_return_error for error returns.  On error paths without
++	__res_iclose, initialze *resplen2 explicitly.  Update comment for
++	successful return.
++
++2016-03-21  Dylan Alex Simon  <dylan-sourceware@dylex.net>
++
++	[BZ #19822]
++	* math/Makefile ($(inst_libdir)/libm.so): Write output to $@.tmp and
++	move it to the final $@ location.
++
 +2016-03-15  Andreas Schwab  <schwab@suse.de>
 +
 +	[BZ #19257]
@@ -391,7 +406,7 @@ index cb9124e..ba4a3f2 100644
  
  	* version.h (RELEASE): Set to "stable".
 diff --git a/NEWS b/NEWS
-index 4c31de7..93c46af 100644
+index 4c31de7..a3dd3c7 100644
 --- a/NEWS
 +++ b/NEWS
 @@ -5,6 +5,31 @@ See the end for copying conditions.
@@ -418,7 +433,7 @@ index 4c31de7..93c46af 100644
 +
 +  17905, 18420, 18421, 18480, 18589, 18743, 18778, 18781, 18787, 18796,
 +  18870, 18887, 18921, 18928, 18969, 18985, 19003, 19018, 19058, 19174,
-+  19178, 19590, 19682.
++  19178, 19590, 19682, 19791, 19822.
 +
 +* The LD_POINTER_GUARD environment variable can no longer be used to
 +  disable the pointer guard feature.  It is always enabled.
@@ -1370,18 +1385,21 @@ index a39a94f..dc0fe30 100644
  
    obstack_free (&weightpool, NULL);
 diff --git a/math/Makefile b/math/Makefile
-index 6388bae..2c9d72d 100644
+index 6388bae..84b4ded 100644
 --- a/math/Makefile
 +++ b/math/Makefile
-@@ -98,7 +98,7 @@ $(inst_libdir)/libm.so: $(common-objpfx)format.lds \
+@@ -98,8 +98,9 @@ $(inst_libdir)/libm.so: $(common-objpfx)format.lds \
  	(echo '/* GNU ld script'; echo '*/';\
  	 cat $<; \
  	 echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \
 -	      'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
+-	) > $@
 +	      'AS_NEEDED ( $(libdir)/libmvec_nonshared.a $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
- 	) > $@
++	) > $@.new
++	mv -f $@.new $@
  endif
  
+ # Rules for the test suite.
 diff --git a/misc/Makefile b/misc/Makefile
 index aecb0da..12055ce 100644
 --- a/misc/Makefile
@@ -1938,7 +1956,7 @@ index 4a9b3b3..95470a9 100644
  	  }
  	if (saved_herrno != -1)
 diff --git a/resolv/res_send.c b/resolv/res_send.c
-index 5e53cc2..6511bb1 100644
+index 5e53cc2..0add3d2 100644
 --- a/resolv/res_send.c
 +++ b/resolv/res_send.c
 @@ -1,3 +1,20 @@
@@ -1971,10 +1989,22 @@ index 5e53cc2..6511bb1 100644
  			u_char *buf = malloc (MAXPACKET);
  			if (buf == NULL)
  				return (-1);
-@@ -638,6 +657,77 @@ get_nsaddr (res_state statp, int n)
+@@ -638,6 +657,89 @@ get_nsaddr (res_state statp, int n)
      return (struct sockaddr *) (void *) &statp->nsaddr_list[n];
  }
  
++/* Close the resolver structure, assign zero to *RESPLEN2 if RESPLEN2
++   is not NULL, and return zero.  */
++static int
++__attribute__ ((warn_unused_result))
++close_and_return_error (res_state statp, int *resplen2)
++{
++  __res_iclose(statp, false);
++  if (resplen2 != NULL)
++    *resplen2 = 0;
++  return 0;
++}
++
 +/* The send_vc function is responsible for sending a DNS query over TCP
 +   to the nameserver numbered NS from the res_state STATP i.e.
 +   EXT(statp).nssocks[ns].  The function supports sending both IPv4 and
@@ -2049,7 +2079,7 @@ index 5e53cc2..6511bb1 100644
  static int
  send_vc(res_state statp,
  	const u_char *buf, int buflen, const u_char *buf2, int buflen2,
-@@ -647,11 +737,7 @@ send_vc(res_state statp,
+@@ -647,11 +749,7 @@ send_vc(res_state statp,
  {
  	const HEADER *hp = (HEADER *) buf;
  	const HEADER *hp2 = (HEADER *) buf2;
@@ -2062,7 +2092,7 @@ index 5e53cc2..6511bb1 100644
  	struct sockaddr *nsap = get_nsaddr (statp, ns);
  	int truncating, connreset, n;
  	/* On some architectures compiler might emit a warning indicating
-@@ -743,6 +829,8 @@ send_vc(res_state statp,
+@@ -743,6 +841,8 @@ send_vc(res_state statp,
  	 * Receive length & response
  	 */
  	int recvresp1 = 0;
@@ -2071,7 +2101,7 @@ index 5e53cc2..6511bb1 100644
  	int recvresp2 = buf2 == NULL;
  	uint16_t rlen16;
   read_len:
-@@ -779,40 +867,14 @@ send_vc(res_state statp,
+@@ -779,40 +879,14 @@ send_vc(res_state statp,
  	u_char **thisansp;
  	int *thisresplenp;
  	if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) {
@@ -2115,7 +2145,7 @@ index 5e53cc2..6511bb1 100644
  		thisanssizp = anssizp2;
  		thisansp = ansp2;
  		thisresplenp = resplen2;
-@@ -820,10 +882,14 @@ send_vc(res_state statp,
+@@ -820,10 +894,14 @@ send_vc(res_state statp,
  	anhp = (HEADER *) *thisansp;
  
  	*thisresplenp = rlen;
@@ -2134,7 +2164,7 @@ index 5e53cc2..6511bb1 100644
  			u_char *newp = malloc (MAXPACKET);
  			if (newp == NULL) {
  				*terrno = ENOMEM;
-@@ -835,6 +901,9 @@ send_vc(res_state statp,
+@@ -835,6 +913,9 @@ send_vc(res_state statp,
  			if (thisansp == ansp2)
  			  *ansp2_malloced = 1;
  			anhp = (HEADER *) newp;
@@ -2144,7 +2174,7 @@ index 5e53cc2..6511bb1 100644
  			len = rlen;
  		} else {
  			Dprint(statp->options & RES_DEBUG,
-@@ -997,6 +1066,66 @@ reopen (res_state statp, int *terrno, int ns)
+@@ -997,6 +1078,66 @@ reopen (res_state statp, int *terrno, int ns)
  	return 1;
  }
  
@@ -2211,7 +2241,7 @@ index 5e53cc2..6511bb1 100644
  static int
  send_dg(res_state statp,
  	const u_char *buf, int buflen, const u_char *buf2, int buflen2,
-@@ -1006,8 +1135,6 @@ send_dg(res_state statp,
+@@ -1006,8 +1147,6 @@ send_dg(res_state statp,
  {
  	const HEADER *hp = (HEADER *) buf;
  	const HEADER *hp2 = (HEADER *) buf2;
@@ -2220,7 +2250,20 @@ index 5e53cc2..6511bb1 100644
  	struct timespec now, timeout, finish;
  	struct pollfd pfd[1];
  	int ptimeout;
-@@ -1040,6 +1167,8 @@ send_dg(res_state statp,
+@@ -1032,7 +1171,11 @@ send_dg(res_state statp,
+  retry_reopen:
+ 	retval = reopen (statp, terrno, ns);
+ 	if (retval <= 0)
+-		return retval;
++	  {
++	    if (resplen2 != NULL)
++	      *resplen2 = 0;
++	    return retval;
++	  }
+  retry:
+ 	evNowTime(&now);
+ 	evConsTime(&timeout, seconds, 0);
+@@ -1040,11 +1183,11 @@ send_dg(res_state statp,
  	int need_recompute = 0;
  	int nwritten = 0;
  	int recvresp1 = 0;
@@ -2229,7 +2272,52 @@ index 5e53cc2..6511bb1 100644
  	int recvresp2 = buf2 == NULL;
  	pfd[0].fd = EXT(statp).nssocks[ns];
  	pfd[0].events = POLLOUT;
-@@ -1203,55 +1332,56 @@ send_dg(res_state statp,
+-	if (resplen2 != NULL)
+-	  *resplen2 = 0;
+  wait:
+ 	if (need_recompute) {
+ 	recompute_resend:
+@@ -1052,9 +1195,7 @@ send_dg(res_state statp,
+ 		if (evCmpTime(finish, now) <= 0) {
+ 		poll_err_out:
+ 			Perror(statp, stderr, "poll", errno);
+-		err_out:
+-			__res_iclose(statp, false);
+-			return (0);
++			return close_and_return_error (statp, resplen2);
+ 		}
+ 		evSubTime(&timeout, &finish, &now);
+ 		need_recompute = 0;
+@@ -1101,7 +1242,9 @@ send_dg(res_state statp,
+ 		  }
+ 
+ 		*gotsomewhere = 1;
+-		return (0);
++		if (resplen2 != NULL)
++		  *resplen2 = 0;
++		return 0;
+ 	}
+ 	if (n < 0) {
+ 		if (errno == EINTR)
+@@ -1169,7 +1312,7 @@ send_dg(res_state statp,
+ 
+ 		      fail_sendmmsg:
+ 			Perror(statp, stderr, "sendmmsg", errno);
+-			goto err_out;
++			return close_and_return_error (statp, resplen2);
+ 		      }
+ 		  }
+ 		else
+@@ -1187,7 +1330,7 @@ send_dg(res_state statp,
+ 		      if (errno == EINTR || errno == EAGAIN)
+ 			goto recompute_resend;
+ 		      Perror(statp, stderr, "send", errno);
+-		      goto err_out;
++		      return close_and_return_error (statp, resplen2);
+ 		    }
+ 		  just_one:
+ 		    if (nwritten != 0 || buf2 == NULL || single_request)
+@@ -1203,55 +1346,56 @@ send_dg(res_state statp,
  		int *thisresplenp;
  
  		if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) {
@@ -2313,6 +2401,87 @@ index 5e53cc2..6511bb1 100644
  		HEADER *anhp = (HEADER *) *thisansp;
  		socklen_t fromlen = sizeof(struct sockaddr_in6);
  		assert (sizeof(from) <= fromlen);
+@@ -1264,7 +1408,7 @@ send_dg(res_state statp,
+ 				goto wait;
+ 			}
+ 			Perror(statp, stderr, "recvfrom", errno);
+-			goto err_out;
++			return close_and_return_error (statp, resplen2);
+ 		}
+ 		*gotsomewhere = 1;
+ 		if (__glibc_unlikely (*thisresplenp < HFIXEDSZ))       {
+@@ -1275,7 +1419,7 @@ send_dg(res_state statp,
+ 			       (stdout, ";; undersized: %d\n",
+ 				*thisresplenp));
+ 			*terrno = EMSGSIZE;
+-			goto err_out;
++			return close_and_return_error (statp, resplen2);
+ 		}
+ 		if ((recvresp1 || hp->id != anhp->id)
+ 		    && (recvresp2 || hp2->id != anhp->id)) {
+@@ -1324,7 +1468,7 @@ send_dg(res_state statp,
+ 				? *thisanssizp : *thisresplenp);
+ 			/* record the error */
+ 			statp->_flags |= RES_F_EDNS0ERR;
+-			goto err_out;
++			return close_and_return_error (statp, resplen2);
+ 	}
+ #endif
+ 		if (!(statp->options & RES_INSECURE2)
+@@ -1376,10 +1520,10 @@ send_dg(res_state statp,
+ 			    goto wait;
+ 			  }
+ 
+-			__res_iclose(statp, false);
+ 			/* don't retry if called from dig */
+ 			if (!statp->pfcode)
+-				return (0);
++			  return close_and_return_error (statp, resplen2);
++			__res_iclose(statp, false);
+ 		}
+ 		if (anhp->rcode == NOERROR && anhp->ancount == 0
+ 		    && anhp->aa == 0 && anhp->ra == 0 && anhp->arcount == 0) {
+@@ -1401,6 +1545,8 @@ send_dg(res_state statp,
+ 			__res_iclose(statp, false);
+ 			// XXX if we have received one reply we could
+ 			// XXX use it and not repeat it over TCP...
++			if (resplen2 != NULL)
++			  *resplen2 = 0;
+ 			return (1);
+ 		}
+ 		/* Mark which reply we received.  */
+@@ -1416,21 +1562,22 @@ send_dg(res_state statp,
+ 					__res_iclose (statp, false);
+ 					retval = reopen (statp, terrno, ns);
+ 					if (retval <= 0)
+-						return retval;
++					  {
++					    if (resplen2 != NULL)
++					      *resplen2 = 0;
++					    return retval;
++					  }
+ 					pfd[0].fd = EXT(statp).nssocks[ns];
+ 				}
+ 			}
+ 			goto wait;
+ 		}
+-		/*
+-		 * All is well, or the error is fatal.  Signal that the
+-		 * next nameserver ought not be tried.
+-		 */
++		/* All is well.  We have received both responses (if
++		   two responses were requested).  */
+ 		return (resplen);
+-	} else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
+-		/* Something went wrong.  We can stop trying.  */
+-		goto err_out;
+-	}
++	} else if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL))
++	  /* Something went wrong.  We can stop trying.  */
++	  return close_and_return_error (statp, resplen2);
+ 	else {
+ 		/* poll should not have returned > 0 in this case.  */
+ 		abort ();
 diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
 index cac1562..79b2b3e 100755
 --- a/scripts/test-installation.pl

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git


Reply to: