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

[commits] r7094 - in /fsf/trunk/libc: ChangeLog nptl/ChangeLog nptl/sysdeps/unix/sysv/linux/fork.c resolv/res_send.c



Author: eglibc
Date: Tue Oct  7 00:03:17 2008
New Revision: 7094

Log:
Import glibc-mainline for 2008-10-07

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
    fsf/trunk/libc/resolv/res_send.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Oct  7 00:03:17 2008
@@ -1,3 +1,9 @@
+2008-09-18  Andreas Schwab  <schwab@xxxxxxx>
+
+	[BZ #6942]
+	* resolv/res_send.c (send_vc): Fix use of unaligned address.
+        Properly handle partial reads.
+
 2008-10-01  Mark Shinwell  <shinwell@xxxxxxxxxxxxxxxx>
 
 	* elf/elf.h (STO_MIPS_PLT): New.

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Tue Oct  7 00:03:17 2008
@@ -1,3 +1,8 @@
+2008-09-11  Martin Schwidefsky  <schwidefsky@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Add memory barrier
+	to force runp->refcntr to be read from memory.
+
 2008-09-08  Richard Guenther  <rguenther@xxxxxxx>
 
 	* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_lock,

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c Tue Oct  7 00:03:17 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -64,6 +64,9 @@
   struct fork_handler *runp;
   while ((runp = __fork_handlers) != NULL)
     {
+      /* Make sure we read from the current RUNP pointer.  */
+      atomic_full_barrier ();
+
       unsigned int oldval = runp->refcntr;
 
       if (oldval == 0)

Modified: fsf/trunk/libc/resolv/res_send.c
==============================================================================
--- fsf/trunk/libc/resolv/res_send.c (original)
+++ fsf/trunk/libc/resolv/res_send.c Tue Oct  7 00:03:17 2008
@@ -734,11 +734,11 @@
 	 */
 	int recvresp1 = 0;
 	int recvresp2 = buf2 == NULL;
+	uint16_t rlen16;
  read_len:
-	cp = ans;
-	uint16_t rlen16;
+	cp = (u_char *)&rlen16;
 	len = sizeof(rlen16);
-	while ((n = TEMP_FAILURE_RETRY (read(statp->_vcsock, &rlen16,
+	while ((n = TEMP_FAILURE_RETRY (read(statp->_vcsock, cp,
 					     (int)len))) > 0) {
 		cp += n;
 		if ((len -= n) <= 0)
@@ -778,8 +778,16 @@
 			/* No buffer allocated for the first
 			   reply.  We can try to use the rest
 			   of the user-provided buffer.  */
+#ifdef _STRING_ARCH_unaligned
 			*anssizp2 = orig_anssizp - resplen;
 			*ansp2 = *ansp + resplen;
+#else
+			int aligned_resplen
+			  = ((resplen + __alignof__ (HEADER) - 1)
+			     & (__alignof__ (HEADER) - 1));
+			*anssizp2 = orig_anssizp - aligned_resplen;
+			*ansp2 = *ansp + aligned_resplen;
+#endif
 		} else {
 			/* The first reply did not fit into the
 			   user-provided buffer.  Maybe the second