GNU C Library master sources branch, release/2.11/master, updated. glibc-2.11.2-46-gfa55fd7

pasky@sourceware.org pasky@sourceware.org
Tue Nov 9 02:02:00 GMT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.11/master has been updated
       via  fa55fd7e5b1da8bd2dddffab82931e2495e82435 (commit)
       via  7f5aef2309fe5eb482cfa37193a185905403f3a8 (commit)
       via  1d81ee7397e0660f1ef14ded1702a47bd292d044 (commit)
       via  8b1cd765b2bef7a4e71f76ac87dd1454fe2ed409 (commit)
       via  c88ea0dfe1baccac52a7a7fb80ee5b813a226b8d (commit)
       via  3f0ccf6ea53054aad8cf4b9fd43e1b02d9506732 (commit)
       via  1f260d0fdc83ea4f9213ca57d0dbfed1bcd2e52f (commit)
       via  153501dc10cd4e5c9aa5084c1526fff7448b8854 (commit)
       via  8a69e300d5529d84bff72b17eeaaf9140e44052d (commit)
       via  f3a97f4c2c783e6e93fc6094e1a8d181b3f53b09 (commit)
       via  4eedc59901f93773aa5e05791e8c1eef15adc53b (commit)
       via  72f754daa024e1cceecf5073203e109b411dd530 (commit)
       via  bca48e9a92242428acd6ffa9da6b4739eae4188b (commit)
       via  dca25feaf72a073df5ca7cca4de5e5d0fccacc36 (commit)
       via  e6ff4b8b261116ccf2867bc91891ad8f3f33ea24 (commit)
       via  254fea5e8ff6b6823858dc5404e5e68a621d5a60 (commit)
       via  5f353d1e05659d8515511f28b875b9fd10c1a661 (commit)
       via  311ad04d94a2e34dc4c418fe19f146e94a41946f (commit)
       via  0ea58d8be31aafedeb9efcba4e901d67f2392f53 (commit)
       via  9d70662339289b8b49d1c83a486a49af128f1c0a (commit)
       via  07b72c0b42b82f0432afcfb60a2cbb2c0f011420 (commit)
       via  720be42915b3f5ae735f9f044b64285a2e34d33a (commit)
       via  de8b6f612a76c7432cb42f153c8b87391b57ced0 (commit)
       via  5881b3d98138cdcfdc1d816dc1a2b8ec5d84659d (commit)
       via  62724d5f1e48077992e1655c2dc4b5c47c08090e (commit)
       via  553fe7087a45cc8cb84a994ce85708d085788947 (commit)
       via  9b44d3dad91de42deef5178fb42e57ac02211dae (commit)
       via  a17f00a81580154f1c0cd6cc9799c9584c0965e2 (commit)
       via  9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768 (commit)
       via  827face44bf189f562225339d015a3b4b5cad023 (commit)
       via  ca47880178b8611e37786770c252827d5faba260 (commit)
      from  0cd8f10947cd557d35175cab5f38c4e38fab646a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fa55fd7e5b1da8bd2dddffab82931e2495e82435

commit fa55fd7e5b1da8bd2dddffab82931e2495e82435
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sun Oct 24 22:37:00 2010 -0400

    Fix perturbing in malloc on free.
    
    (cherry picked from commit fdc0f374bcd2d0513569aa8d600f960e43e8af1d)

diff --git a/ChangeLog b/ChangeLog
index b9b347a..a95b182 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-24  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #12140]
+	* malloc/malloc.c (_int_free): Fill correct number of bytes when
+	perturbing.
+
 2010-09-09  Andreas Schwab  <schwab@redhat.com>
 
 	* Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index b1d43c6..29c7992 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4850,7 +4850,7 @@ _int_free(mstate av, mchunkptr p)
       }
 
     if (__builtin_expect (perturb_byte, 0))
-      free_perturb (chunk2mem(p), size - SIZE_SZ);
+      free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
 
     set_fastchunks(av);
     fb = &fastbin (av, fastbin_index(size));
@@ -4938,7 +4938,7 @@ _int_free(mstate av, mchunkptr p)
       }
 
     if (__builtin_expect (perturb_byte, 0))
-      free_perturb (chunk2mem(p), size - SIZE_SZ);
+      free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);
 
     /* consolidate backward */
     if (!prev_inuse(p)) {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7f5aef2309fe5eb482cfa37193a185905403f3a8

commit 7f5aef2309fe5eb482cfa37193a185905403f3a8
Author: Andreas Schwab <schwab@redhat.com>
Date:   Sun Oct 24 21:42:39 2010 -0400

    Work around shortest-stem feature in make 3.82+
    (cherry picked from commit bc96fbda275c305ddc1b0b6d94fc68d81369221a)

diff --git a/ChangeLog b/ChangeLog
index 8d01dae..b9b347a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-09  Andreas Schwab  <schwab@redhat.com>
+
+	* Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%.
+	(sysd-rules-targets): Remove duplicates.
+	* elf/rtld-Rules ($(objpfx)rtld-%.os): Add pattern rules with
+	rtld-%.$o dependency.
+
 2010-10-22  Andreas Schwab  <schwab@redhat.com>
 
 	* include/dlfcn.h (__RTLD_SECURE): Define.
diff --git a/Makeconfig b/Makeconfig
index 9f134cc..47638b1 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -686,7 +686,7 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
 	   $(CPPFLAGS-$(suffix $@)) \
 	   $(foreach lib,$(libof-$(basename $(@F))) \
-		         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
+			 $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
 	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 override CFLAGS	= -std=gnu99 $(gnu89-inline-CFLAGS) \
 		  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
@@ -957,7 +957,7 @@ endif
 # emitted into sysd-rules.  A sysdeps Makeconfig fragment can
 # add its own special object file prefix to this list with e.g. foo-%:%
 # to have foo-*.? compiled from *.? using $(foo-CPPFLAGS).
-sysd-rules-patterns := %:% rtld-%:% m_%:s_%
+sysd-rules-patterns := %:% rtld-%:rtld-% rtld-%:% m_%:s_%
 
 # Let sysdeps/ subdirs contain a Makeconfig fragment for us to include here.
 sysdep-makeconfigs := $(wildcard $(+sysdep_dirs:=/Makeconfig))
@@ -966,8 +966,8 @@ include $(sysdep-makeconfigs)
 endif
 
 # Compute just the target patterns.  Makeconfig has set sysd-rules-patterns.
-sysd-rules-targets := $(foreach p,$(sysd-rules-patterns),\
-		      		$(firstword $(subst :, ,$p)))
+sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
+					 $(firstword $(subst :, ,$p))))
 
 endif # Makeconfig not yet included
 
diff --git a/elf/rtld-Rules b/elf/rtld-Rules
index 9f31a56..10c9452 100644
--- a/elf/rtld-Rules
+++ b/elf/rtld-Rules
@@ -1,6 +1,6 @@
 # Subroutine makefile for compiling libc modules linked into dynamic linker.
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2005,2006,2008,2010 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -56,7 +56,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\
 # Use the verbose option of ar and tar when not running silently.
 ifeq	"$(findstring s,$(MAKEFLAGS))" ""	# if not -s
 verbose := v
-else	   					# -s
+else						# -s
 verbose	:=
 endif						# not -s
 
@@ -93,6 +93,12 @@ else
 # These are the basic compilation rules corresponding to the Makerules ones.
 # The sysd-rules generated makefile already defines pattern rules for rtld-%
 # targets built from sysdeps source files.
+$(objpfx)rtld-%.os: rtld-%.S $(before-compile)
+	$(compile-command.S) $(rtld-CPPFLAGS)
+$(objpfx)rtld-%.os: rtld-%.s $(before-compile)
+	$(compile-command.s) $(rtld-CPPFLAGS)
+$(objpfx)rtld-%.os: rtld-%.c $(before-compile)
+	$(compile-command.c) $(rtld-CPPFLAGS)
 $(objpfx)rtld-%.os: %.S $(before-compile)
 	$(compile-command.S) $(rtld-CPPFLAGS)
 $(objpfx)rtld-%.os: %.s $(before-compile)
@@ -101,6 +107,9 @@ $(objpfx)rtld-%.os: %.c $(before-compile)
 	$(compile-command.c) $(rtld-CPPFLAGS)
 
 # The rules for generated source files.
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.S $(before-compile); $(compile-command.S)
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.s $(before-compile); $(compile-command.s)
+$(objpfx)rtld-%.os: $(objpfx)rtld-%.c $(before-compile); $(compile-command.c)
 $(objpfx)rtld-%.os: $(objpfx)%.S $(before-compile); $(compile-command.S)
 $(objpfx)rtld-%.os: $(objpfx)%.s $(before-compile); $(compile-command.s)
 $(objpfx)rtld-%.os: $(objpfx)%.c $(before-compile); $(compile-command.c)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1d81ee7397e0660f1ef14ded1702a47bd292d044

commit 1d81ee7397e0660f1ef14ded1702a47bd292d044
Author: Andreas Schwab <schwab@redhat.com>
Date:   Sun Oct 24 21:43:15 2010 -0400

    Require suid bit on audit objects in privileged programs
    (cherry picked from commit 8e9f92e9d5d7737afdacf79b76d98c4c42980508)

diff --git a/ChangeLog b/ChangeLog
index 7fa4a06..8d01dae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-22  Andreas Schwab  <schwab@redhat.com>
+
+	* include/dlfcn.h (__RTLD_SECURE): Define.
+	* elf/dl-load.c (_dl_map_object): Remove preloaded parameter.  Use
+	mode & __RTLD_SECURE instead.
+	(open_path): Rename preloaded parameter to secure.
+	* sysdeps/generic/ldsodefs.h (_dl_map_object): Adjust declaration.
+	* elf/dl-open.c (dl_open_worker): Adjust call to _dl_map_object.
+	* elf/dl-deps.c (openaux): Likewise.
+	* elf/rtld.c (struct map_args): Remove is_preloaded.
+	(map_doit): Don't use it.
+	(dl_main): Likewise.
+	(do_preload): Use __RTLD_SECURE instead of is_preloaded.
+	(dlmopen_doit): Add __RTLD_SECURE to mode bits.
+
 2010-10-18  Andreas Schwab  <schwab@redhat.com>
 
 	* elf/dl-open.c (dl_open_worker): Don't expand DST here, let

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8b1cd765b2bef7a4e71f76ac87dd1454fe2ed409

commit 8b1cd765b2bef7a4e71f76ac87dd1454fe2ed409
Author: Andreas Schwab <schwab@redhat.com>
Date:   Sun Oct 24 20:40:14 2010 -0400

    Don't expand DST twice in dl_open
    (cherry picked from commit 22cd1c9bcf57c5829d65b6da825f7a459d40c9eb)

diff --git a/ChangeLog b/ChangeLog
index fd64695..7fa4a06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-18  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-open.c (dl_open_worker): Don't expand DST here, let
+	_dl_map_object do it.
+
 2010-10-15  Andreas Schwab  <schwab@redhat.com>
 
 	* scripts/data/localplt-s390-linux-gnu.data: New file.
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 2d3932f..0b328cf 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -220,35 +220,6 @@ dl_open_worker (void *a)
 
   assert (_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT);
 
-  /* Maybe we have to expand a DST.  */
-  if (__builtin_expect (dst != NULL, 0))
-    {
-      size_t len = strlen (file);
-
-      /* Determine how much space we need.  We have to allocate the
-	 memory locally.  */
-      size_t required = DL_DST_REQUIRED (call_map, file, len,
-					 _dl_dst_count (dst, 0));
-
-      /* Get space for the new file name.  */
-      char *new_file = (char *) alloca (required + 1);
-
-      /* Generate the new file name.  */
-      _dl_dst_substitute (call_map, file, new_file, 0);
-
-      /* If the substitution failed don't try to load.  */
-      if (*new_file == '\0')
-	_dl_signal_error (0, "dlopen", NULL,
-			  N_("empty dynamic string token substitution"));
-
-      /* Now we have a new file name.  */
-      file = new_file;
-
-      /* It does not matter whether call_map is set even if we
-	 computed it only because of the DST.  Since the path contains
-	 a slash the value is not used.  See dl-load.c.  */
-    }
-
   /* Load the named object.  */
   struct link_map *new;
   args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c88ea0dfe1baccac52a7a7fb80ee5b813a226b8d

commit c88ea0dfe1baccac52a7a7fb80ee5b813a226b8d
Author: Andreas Schwab <schwab@redhat.com>
Date:   Fri Oct 15 07:29:38 2010 -0400

    Expect PLT call to _Unwind_Find_FDE on s390*-linux
    (cherry picked from commit 14d43591face21dbd4d51b5c46fa3c17740ddc78)

diff --git a/ChangeLog b/ChangeLog
index 68d62d2..fd64695 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-15  Andreas Schwab  <schwab@redhat.com>
+
+	* scripts/data/localplt-s390-linux-gnu.data: New file.
+	* scripts/data/localplt-s390x-linux-gnu.data: New file.
+
 2010-10-12  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #12078]
diff --git a/scripts/data/localplt-s390-linux-gnu.data b/scripts/data/localplt-s390-linux-gnu.data
new file mode 100644
index 0000000..8fb56b6
--- /dev/null
+++ b/scripts/data/localplt-s390-linux-gnu.data
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
diff --git a/scripts/data/localplt-s390x-linux-gnu.data b/scripts/data/localplt-s390x-linux-gnu.data
new file mode 100644
index 0000000..8fb56b6
--- /dev/null
+++ b/scripts/data/localplt-s390x-linux-gnu.data
@@ -0,0 +1,7 @@
+libc.so: _Unwind_Find_FDE
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3f0ccf6ea53054aad8cf4b9fd43e1b02d9506732

commit 3f0ccf6ea53054aad8cf4b9fd43e1b02d9506732
Author: H.J. Lu <hongjiu.lu@intel.com>
Date:   Wed Oct 13 22:12:03 2010 -0400

    Fix alignment of AVX safe area on x86-64.
    
    (cherry picked from commit f90681487d90a6eea8f1c60021bc8dd83313c59b)

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 73c65e6..44af06a 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #12113]
+	* sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
+	* sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
+	of "struct pthread".
+
 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1f260d0fdc83ea4f9213ca57d0dbfed1bcd2e52f

commit 1f260d0fdc83ea4f9213ca57d0dbfed1bcd2e52f
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Oct 12 09:00:33 2010 -0400

    One more regex memory leak fixed.
    (cherry picked from commit b833d51fbbf78b38c6ff68074c22d3fe3ddd0ce3)

diff --git a/ChangeLog b/ChangeLog
index ee288b0..68d62d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-12  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #12078]
+	* posix/regcomp.c (parse_branch): One more memory leak plugged.
+	* posix/bug-regex31.input: Add test case.
+
 2010-10-11  Ulrich Drepper  <drepper@gmail.com>
 
 	* posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
diff --git a/posix/bug-regex31.input b/posix/bug-regex31.input
index eea961c..3d1f531 100644
--- a/posix/bug-regex31.input
+++ b/posix/bug-regex31.input
@@ -1,3 +1,4 @@
+[[][
 ([0]
 ([0]a
 ([0]([0])
diff --git a/posix/regcomp.c b/posix/regcomp.c
index c6de044..c48020d 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2154,6 +2154,8 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
       exp = parse_expression (regexp, preg, token, syntax, nest, err);
       if (BE (*err != REG_NOERROR && exp == NULL, 0))
 	{
+	  if (tree != NULL)
+	    postorder (tree, free_tree, NULL);
 	  return NULL;
 	}
       if (tree != NULL && exp != NULL)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=153501dc10cd4e5c9aa5084c1526fff7448b8854

commit 153501dc10cd4e5c9aa5084c1526fff7448b8854
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Mon Oct 11 12:34:53 2010 -0400

    More regex memory leak fixes and testcases
    
    (cherry picked from commit ef06edbee6463061a7f3dcbd2f56a625b41a4810)
    (cherry picked from commit e9b9cbf5e9bdcda6f0b50456658bac748202dd70)

diff --git a/ChangeLog b/ChangeLog
index a35f75a..ee288b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-10-11  Ulrich Drepper  <drepper@gmail.com>
 
+	* posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
+	* posix/bug-regex31.input: New file.
+
+	[BZ #12078]
+	* posix/regcomp.c (parse_branch): Free memory when allocation failed.
+	(parse_sub_exp): Fix last change, use postorder.
+
+	* posix/bug-regex31.c: New file.
+	* posix/Makefile: Add rules to build and run bug-regex31.
+
 	* posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
 
 	[BZ #12078]
diff --git a/posix/Makefile b/posix/Makefile
index 2a467a8..ad2f2ed 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -82,7 +82,7 @@ tests		:= tstgetopt testfnm runtests runptests	     \
 		   bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
 		   bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
 		   bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
-		   bug-regex29 bug-regex30 \
+		   bug-regex29 bug-regex30 bug-regex31 \
 		   tst-nice tst-nanosleep tst-regex2 \
 		   transbug tst-rxspencer tst-pcre tst-boost \
 		   bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
@@ -109,6 +109,7 @@ generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
 	     annexc annexc.out wordexp-tst.out bug-regex2-mem \
 	     bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
 	     bug-regex21-mem bug-regex21.mtrace \
+	     bug-regex31-mem bug-regex31.mtrace \
 	     tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
 	     tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
 	     bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
@@ -222,7 +223,7 @@ endif
 tests: $(objpfx)annexc.out
 ifeq (no,$(cross-compiling))
 tests: $(objpfx)bug-regex2-mem $(objpfx)bug-regex14-mem \
-  $(objpfx)bug-regex21-mem $(objpfx)tst-rxspencer-mem \
+  $(objpfx)bug-regex21-mem $(objpfx)bug-regex31-mem $(objpfx)tst-rxspencer-mem\
   $(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem $(objpfx)tst-getconf.out \
   $(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
 xtests: $(objpfx)bug-ga2-mem
@@ -251,6 +252,11 @@ bug-regex21-ENV = MALLOC_TRACE=$(objpfx)bug-regex21.mtrace
 $(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
 	$(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
 
+bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace
+
+$(objpfx)bug-regex31-mem: $(objpfx)bug-regex31.out
+	$(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@
+
 tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
 
 $(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
diff --git a/posix/bug-regex31.c b/posix/bug-regex31.c
new file mode 100644
index 0000000..974e860
--- /dev/null
+++ b/posix/bug-regex31.c
@@ -0,0 +1,36 @@
+#include <mcheck.h>
+#include <regex.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+int
+main (void)
+{
+  mtrace ();
+
+  int res = 0;
+  char *buf = NULL;
+  size_t len = 0;
+  while (! feof (stdin))
+    {
+      ssize_t n = getline (&buf, &len, stdin);
+      if (n <= 0)
+	break;
+      if (buf[n - 1] == '\n')
+	buf[n - 1] = '\0';
+
+      regex_t regex;
+      int rc = regcomp (&regex, buf, REG_EXTENDED);
+      if (rc != 0)
+	printf ("%s: Error %d (expected)\n", buf, rc);
+      else
+	{
+	  printf ("%s: succeeded !\n", buf);
+	  res = 1;
+	}
+    }
+
+  free (buf);
+
+  return 0;
+}
diff --git a/posix/bug-regex31.input b/posix/bug-regex31.input
new file mode 100644
index 0000000..eea961c
--- /dev/null
+++ b/posix/bug-regex31.input
@@ -0,0 +1,3 @@
+([0]
+([0]a
+([0]([0])
diff --git a/posix/regcomp.c b/posix/regcomp.c
index e70de87..c6de044 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2158,12 +2158,15 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
 	}
       if (tree != NULL && exp != NULL)
 	{
-	  tree = create_tree (dfa, tree, exp, CONCAT);
-	  if (tree == NULL)
+	  bin_tree_t *newtree = create_tree (dfa, tree, exp, CONCAT);
+	  if (newtree == NULL)
 	    {
+	      postorder (exp, free_tree, NULL);
+	      postorder (tree, free_tree, NULL);
 	      *err = REG_ESPACE;
 	      return NULL;
 	    }
+	  tree = newtree;
 	}
       else if (tree == NULL)
 	tree = exp;
@@ -2414,7 +2417,7 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
       if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
 	{
 	  if (tree != NULL)
-	    free_tree (NULL, tree);
+	    postorder (tree, free_tree, NULL);
 	  *err = REG_EPAREN;
 	}
       if (BE (*err != REG_NOERROR, 0))

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8a69e300d5529d84bff72b17eeaaf9140e44052d

commit 8a69e300d5529d84bff72b17eeaaf9140e44052d
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Mon Oct 11 11:46:22 2010 -0400

    Fix memory leak for some invalid regular expressions.
    
    (cherry picked from commit a129c80d54ec951567caa8c1b042275422d5f367)

diff --git a/ChangeLog b/ChangeLog
index 73cd528..a35f75a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-10-11  Ulrich Drepper  <drepper@gmail.com>
 
+	* posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
+
+	[BZ #12078]
+	* posix/regcomp.c (parse_sub_exp): Free tree data when it is not used.
+
 	[BZ #12093]
 	* sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
 	be NULL.
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 542b848..e70de87 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2412,7 +2412,11 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
     {
       tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
       if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
-	*err = REG_EPAREN;
+	{
+	  if (tree != NULL)
+	    free_tree (NULL, tree);
+	  *err = REG_EPAREN;
+	}
       if (BE (*err != REG_NOERROR, 0))
 	return NULL;
     }
@@ -3022,6 +3026,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
   if (BE (sbcset == NULL, 0))
 #endif /* RE_ENABLE_I18N */
     {
+      re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+      re_free (mbcset);
+#endif
       *err = REG_ESPACE;
       return NULL;
     }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f3a97f4c2c783e6e93fc6094e1a8d181b3f53b09

commit f3a97f4c2c783e6e93fc6094e1a8d181b3f53b09
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Mon Oct 11 09:38:00 2010 -0400

    Linux getifaddrs might return entries with ->ifa_addr being NULL.
    
    (cherry picked from commit 1751705d1c4e8b7aba391391d1d8d88fe8c9d8b8)

diff --git a/ChangeLog b/ChangeLog
index 46f0c2b..73cd528 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-11  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12093]
+	* sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
+	be NULL.
+
 2010-09-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index e694342..b789a32 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -1,5 +1,5 @@
 /* Determine protocol families for which interfaces exist.  Linux version.
-   Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -304,10 +304,13 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6,
 
   struct ifaddrs *runp;
   for (runp = ifa; runp != NULL; runp = runp->ifa_next)
-    if (runp->ifa_addr->sa_family == PF_INET)
-      *seen_ipv4 = true;
-    else if (runp->ifa_addr->sa_family == PF_INET6)
-      *seen_ipv6 = true;
+    if (runp->ifa_addr != NULL)
+      {
+	if (runp->ifa_addr->sa_family == PF_INET)
+	  *seen_ipv4 = true;
+	else if (runp->ifa_addr->sa_family == PF_INET6)
+	  *seen_ipv6 = true;
+      }
 
   (void) freeifaddrs (ifa);
 #endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4eedc59901f93773aa5e05791e8c1eef15adc53b

commit 4eedc59901f93773aa5e05791e8c1eef15adc53b
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sun Oct 3 22:30:11 2010 -0400

    Remove specific binutils version recommendation in INSTALL file.
    (cherry picked from commit 10be4851911a00cca422c173788bce9a13dbde8e)

diff --git a/INSTALL b/INSTALL
index 8d61b3e..555e36e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -317,11 +317,12 @@ build the GNU C library:
      Check the FAQ for any special compiler issues on particular
      platforms.
 
-   * GNU `binutils' 2.15 or later
+   * GNU `binutils'
 
      You must use GNU `binutils' (as and ld) to build the GNU C library.
      No other assembler or linker has the necessary functionality at the
-     moment.
+     moment.  The configure scripts checks for the appropriate version
+     for the platform.  Too-old versions will prevent building glibc.
 
    * GNU `texinfo' 3.12f
 
@@ -460,4 +461,3 @@ or the manual has a bug, so report the disagreement.  If you find any
 errors or omissions in this manual, please report them to the bug
 database.  If you refer to specific sections of the manual, please
 include the section names for easier identification.
-

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=72f754daa024e1cceecf5073203e109b411dd530

commit 72f754daa024e1cceecf5073203e109b411dd530
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sun Oct 3 22:27:21 2010 -0400

    Handle large requests.
    (cherry picked from commit 3b11189345d0080527a76e3bf867da395a1b0261)

diff --git a/ChangeLog b/ChangeLog
index 7102745..46f0c2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -142,6 +142,9 @@
 
 2010-10-03  Ulrich Drepper  <drepper@gmail.com>
 
+	[BZ #12005]
+	* malloc/mcheck.c: Handle large requests.
+
 	[BZ #12077]
 	* sysdeps/x86_64/strcmp.S: Fix handling of remaining bytes in buffer
 	for strncmp and strncasecmp.
diff --git a/malloc/mcheck.c b/malloc/mcheck.c
index 524acc7..e2eb83f 100644
--- a/malloc/mcheck.c
+++ b/malloc/mcheck.c
@@ -1,5 +1,6 @@
 /* Standard debugging hooks for `malloc'.
-   Copyright (C) 1990-1997,1999,2000-2002,2007 Free Software Foundation, Inc.
+   Copyright (C) 1990-1997,1999,2000-2002,2007,2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written May 1989 by Mike Haertel.
 
@@ -25,6 +26,7 @@
 # include <stdint.h>
 # include <stdio.h>
 # include <libintl.h>
+# include <errno.h>
 #endif
 
 /* Old hook values.  */
@@ -209,6 +211,12 @@ mallochook (__malloc_size_t size, const __ptr_t caller)
   if (pedantic)
     mcheck_check_all ();
 
+  if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
+    {
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+
   __malloc_hook = old_malloc_hook;
   if (old_malloc_hook != NULL)
     hdr = (struct hdr *) (*old_malloc_hook) (sizeof (struct hdr) + size + 1,
@@ -241,6 +249,12 @@ memalignhook (__malloc_size_t alignment, __malloc_size_t size,
 
   slop = (sizeof *hdr + alignment - 1) & -alignment;
 
+  if (size > ~((size_t) 0) - (slop + 1))
+    {
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+
   __memalign_hook = old_memalign_hook;
   if (old_memalign_hook != NULL)
     block = (*old_memalign_hook) (alignment, slop + size + 1, caller);
@@ -276,6 +290,12 @@ reallochook (__ptr_t ptr, __malloc_size_t size, const __ptr_t caller)
   if (pedantic)
     mcheck_check_all ();
 
+  if (size > ~((size_t) 0) - (sizeof (struct hdr) + 1))
+    {
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+
   if (ptr)
     {
       hdr = ((struct hdr *) ptr) - 1;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bca48e9a92242428acd6ffa9da6b4739eae4188b

commit bca48e9a92242428acd6ffa9da6b4739eae4188b
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Sep 21 14:02:08 2010 -0700

    getdents64 fallback d_type support
    (cherry picked from commit 1ac7a2c7b448c851eb8976fcc290a906a4075203)

diff --git a/ChangeLog b/ChangeLog
index 5800ca4..7102745 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-15  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): When
+	implementing getdents64 using getdents syscall, set d_type if
+	__ASSUME_GETDENTS32_D_TYPE.
+
 2010-09-14  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index b33d178..0aa9186 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995-2003, 2004, 2006, 2007
+/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -285,7 +285,11 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
 	DIRENT_SET_DP_INO(dp, kdp->d_ino);
 	dp->d_off = kdp->d_off;
 	dp->d_reclen = new_reclen;
+#ifdef __ASSUME_GETDENTS32_D_TYPE
+	dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
+#else
 	dp->d_type = DT_UNKNOWN;
+#endif
 	memcpy (dp->d_name, kdp->d_name,
 		kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=dca25feaf72a073df5ca7cca4de5e5d0fccacc36

commit dca25feaf72a073df5ca7cca4de5e5d0fccacc36
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Sep 15 07:38:19 2010 -0700

    Fix register conflict in s390 ____longjmp_chk
    (cherry picked from commit 7291c56f9d6f5861d1c001bc63a364f047a74738)

diff --git a/ChangeLog b/ChangeLog
index 4461b2d..5800ca4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-14  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/s390/s390-32/__longjmp.c (__longjmp): Define register
+	variables after CHECK_SP call.
+	* sysdeps/s390/s390-64/__longjmp.c (__longjmp): Likewise.
+
 2010-09-08  Chung-Lin Tang  <cltang@codesourcery.com>
 	    Ulrich Drepper  <drepper@redhat.com>
 
diff --git a/sysdeps/s390/s390-32/__longjmp.c b/sysdeps/s390/s390-32/__longjmp.c
index 4abc0ec..95f8b71 100644
--- a/sysdeps/s390/s390-32/__longjmp.c
+++ b/sysdeps/s390/s390-32/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
 
@@ -29,16 +29,19 @@
 void
 __longjmp (__jmp_buf env, int val)
 {
-  register int r2 __asm ("%r2") = val == 0 ? 1 : val;
 #ifdef PTR_DEMANGLE
-  register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
-  register void *r1 __asm ("%r1") = (void *) env;
+  uintptr_t guard = THREAD_GET_POINTER_GUARD ();
 # ifdef CHECK_SP
-  CHECK_SP (env, r3);
+  CHECK_SP (env, guard);
 # endif
 #elif defined CHECK_SP
   CHECK_SP (env, 0);
 #endif
+  register int r2 __asm ("%r2") = val == 0 ? 1 : val;
+#ifdef PTR_DEMANGLE
+  register uintptr_t r3 __asm ("%r3") = guard;
+  register void *r1 __asm ("%r1") = (void *) env;
+#endif
   /* Restore registers and jump back.  */
   asm volatile ("ld   %%f6,48(%1)\n\t"
 		"ld   %%f4,40(%1)\n\t"
diff --git a/sysdeps/s390/s390-64/__longjmp.c b/sysdeps/s390/s390-64/__longjmp.c
index 445bd3b..313b338 100644
--- a/sysdeps/s390/s390-64/__longjmp.c
+++ b/sysdeps/s390/s390-64/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2005, 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
 
@@ -29,16 +29,19 @@
 void
 __longjmp (__jmp_buf env, int val)
 {
-  register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
 #ifdef PTR_DEMANGLE
-  register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
-  register void *r1 __asm ("%r1") = (void *) env;
+  uintptr_t guard = THREAD_GET_POINTER_GUARD ();
 # ifdef CHECK_SP
-  CHECK_SP (env, r3);
+  CHECK_SP (env, guard);
 # endif
 #elif defined CHECK_SP
   CHECK_SP (env, 0);
 #endif
+  register long int r2 __asm ("%r2") = val == 0 ? 1 : val;
+#ifdef PTR_DEMANGLE
+  register uintptr_t r3 __asm ("%r3") = guard;
+  register void *r1 __asm ("%r1") = (void *) env;
+#endif
   /* Restore registers and jump back.  */
   asm volatile ("ld   %%f7,104(%1)\n\t"
 		"ld   %%f5,96(%1)\n\t"

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e6ff4b8b261116ccf2867bc91891ad8f3f33ea24

commit e6ff4b8b261116ccf2867bc91891ad8f3f33ea24
Author: Chung-Lin Tang <cltang@codesourcery.com>
Date:   Wed Sep 8 15:49:50 2010 -0700

    Fix _FORITY_SOURCE version of longjmp for Linux/x86-64.
    (cherry picked from commit c044aa75354b48d4b7aaffe465706282192e54c2)

diff --git a/ChangeLog b/ChangeLog
index 2985e2d..4461b2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-08  Chung-Lin Tang  <cltang@codesourcery.com>
+	    Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11968]
+	* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+	(____longjmp_chk): Use %ebx for saving value across system call.
+	Add unwind info.
+
 2010-08-31  Mike Frysinger  <vapier@gentoo.org>
 
 	* sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Fix typo.
diff --git a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index 5e11540..da35115 100644
--- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,2009,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,9 +49,9 @@ longjmp_msg:
 	.text
 ENTRY(____longjmp_chk)
 	/* Restore registers.  */
-	movq	(JB_RSP*8)(%rdi),%r8
-	movq	(JB_RBP*8)(%rdi),%r9
-	movq	(JB_PC*8)(%rdi),%rdx
+	movq	(JB_RSP*8)(%rdi), %r8
+	movq	(JB_RBP*8)(%rdi), %r9
+	movq	(JB_PC*8)(%rdi), %rdx
 #ifdef PTR_DEMANGLE
 	PTR_DEMANGLE (%r8)
 	PTR_DEMANGLE (%r9)
@@ -63,7 +63,9 @@ ENTRY(____longjmp_chk)
 
 	/* Save function parameters.  */
 	movq	%rdi, %r10
-	movl	%esi, %ecx
+	cfi_register (%rdi, %r10)
+	movl	%esi, %ebx
+	cfi_register (%rsi, %rbx)
 
 	xorl	%edi, %edi
 	leaq	-24(%rsp), %rsi
@@ -84,7 +86,9 @@ ENTRY(____longjmp_chk)
 .Lfail:	CALL_FAIL
 
 .Lok2:	movq	%r10, %rdi
-	movl	%ecx, %esi
+	cfi_restore (%rdi)
+	movl	%ebx, %esi
+	cfi_restore (%rsi)
 
 .Lok:	/* We add unwind information for the target here.  */
 	cfi_def_cfa(%rdi, 0)
@@ -96,11 +100,11 @@ ENTRY(____longjmp_chk)
 	cfi_offset(%r13,JB_R13*8)
 	cfi_offset(%r14,JB_R14*8)
 	cfi_offset(%r15,JB_R15*8)
-	movq	(JB_RBX*8)(%rdi),%rbx
-	movq	(JB_R12*8)(%rdi),%r12
-	movq	(JB_R13*8)(%rdi),%r13
-	movq	(JB_R14*8)(%rdi),%r14
-	movq	(JB_R15*8)(%rdi),%r15
+	movq	(JB_RBX*8)(%rdi), %rbx
+	movq	(JB_R12*8)(%rdi), %r12
+	movq	(JB_R13*8)(%rdi), %r13
+	movq	(JB_R14*8)(%rdi), %r14
+	movq	(JB_R15*8)(%rdi), %r15
 	/* Set return value for setjmp.  */
 	movl	%esi, %eax
 	movq	%r8,%rsp

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=254fea5e8ff6b6823858dc5404e5e68a621d5a60

commit 254fea5e8ff6b6823858dc5404e5e68a621d5a60
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Wed Sep 1 12:42:48 2010 -0700

    Fix typo in x86-64 epoll.h.
    (cherry picked from commit e53a31fe575dcfd0dceb9f316d673de34d39abad)

diff --git a/ChangeLog b/ChangeLog
index 5b04f1b..2985e2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-31  Mike Frysinger  <vapier@gentoo.org>
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Fix typo.
+
 2010-08-31  Andreas Schwab  <schwab@redhat.com>
 
 	[BZ #7066]
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
index 234798e..d799c84 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2008, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ typedef __sigset_t sigset_t;
 #endif
 
 
-/* Flags to be passed to epoll_create2.  */
+/* Flags to be passed to epoll_create1.  */
 enum
   {
     EPOLL_CLOEXEC = 02000000,

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5f353d1e05659d8515511f28b875b9fd10c1a661

commit 5f353d1e05659d8515511f28b875b9fd10c1a661
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Sep 1 12:38:44 2010 -0700

    Fix array overflow in floating point parser
    
    (cherry picked from commit a726d7960e8a4ac784131f591114a0ef14246d8b)

diff --git a/ChangeLog b/ChangeLog
index c8bdd6d..5b04f1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-31  Andreas Schwab  <schwab@redhat.com>
+
+	[BZ #7066]
+	* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix array overflow when
+	shifting retval into place.
+
 2010-09-14  Ulrich Drepper  <drepper@redhat.com>
 
 	* resolv/res_init.c (__res_vinit): Count the default server we added.
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 9ddfa3f..099fcf7 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -1491,7 +1491,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
 			  register int i;
 			  (void) __mpn_lshift (&retval[used
 						       / BITS_PER_MP_LIMB],
-					       retval, RETURN_LIMB_SIZE,
+					       retval,
+					       (RETURN_LIMB_SIZE
+						- used / BITS_PER_MP_LIMB),
 					       used % BITS_PER_MP_LIMB);
 			  for (i = used / BITS_PER_MP_LIMB - 1; i >= 0; --i)
 			    retval[i] = 0;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=311ad04d94a2e34dc4c418fe19f146e94a41946f

commit 311ad04d94a2e34dc4c418fe19f146e94a41946f
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Tue Sep 14 00:01:42 2010 -0700

    Actually make it possible to user the default name server.
    (cherry picked from commit e66e7419a6f58200eec6941b14e2dcff9875cc6c)

diff --git a/ChangeLog b/ChangeLog
index 89bd41e..c8bdd6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-14  Ulrich Drepper  <drepper@redhat.com>
+
+	* resolv/res_init.c (__res_vinit): Count the default server we added.
+
 2010-08-25  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #10851]
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 202569d..74715f3 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -430,6 +430,7 @@ __res_vinit(res_state statp, int preinit) {
 	    statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
 	    statp->nsaddr.sin_family = AF_INET;
 	    statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
+	    statp->nscount = 1;
 	}
 	if (statp->defdname[0] == 0 &&
 	    __gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0ea58d8be31aafedeb9efcba4e901d67f2392f53

commit 0ea58d8be31aafedeb9efcba4e901d67f2392f53
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Aug 25 07:43:53 2010 -0700

    Missing server address again leads to localhost being used
    (cherry picked from commit df24a73ecdfea3690821f8176b83d811a5f23725)

diff --git a/ChangeLog b/ChangeLog
index 67dbf46..89bd41e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-25  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #10851]
+	* resolv/res_init.c (__res_vinit): When no server address at all
+	is given default to loopback.
+
 2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/i386/elf/Makefile: New file.
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 40dbe7d..202569d 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -176,13 +176,6 @@ __res_vinit(res_state statp, int preinit) {
 		statp->id = res_randomid();
 	}
 
-#ifdef USELOOPBACK
-	statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
-#else
-	statp->nsaddr.sin_addr.s_addr = INADDR_ANY;
-#endif
-	statp->nsaddr.sin_family = AF_INET;
-	statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
 	statp->nscount = 0;
 	statp->ndots = 1;
 	statp->pfcode = 0;
@@ -321,24 +314,24 @@ __res_vinit(res_state statp, int preinit) {
 			nserv++;
 #ifdef _LIBC
 			nservall++;
-                    } else {
-                        struct in6_addr a6;
-                        char *el;
+		    } else {
+			struct in6_addr a6;
+			char *el;
 
-                        if ((el = strchr(cp, '\n')) != NULL)
-                            *el = '\0';
+			if ((el = strchr(cp, '\n')) != NULL)
+			    *el = '\0';
 			if ((el = strchr(cp, SCOPE_DELIMITER)) != NULL)
 			    *el = '\0';
-                        if ((*cp != '\0') &&
-                            (inet_pton(AF_INET6, cp, &a6) > 0)) {
-                            struct sockaddr_in6 *sa6;
-
-                            sa6 = malloc(sizeof(*sa6));
-                            if (sa6 != NULL) {
-                                sa6->sin6_family = AF_INET6;
-                                sa6->sin6_port = htons(NAMESERVER_PORT);
+			if ((*cp != '\0') &&
+			    (inet_pton(AF_INET6, cp, &a6) > 0)) {
+			    struct sockaddr_in6 *sa6;
+
+			    sa6 = malloc(sizeof(*sa6));
+			    if (sa6 != NULL) {
+				sa6->sin6_family = AF_INET6;
+				sa6->sin6_port = htons(NAMESERVER_PORT);
 				sa6->sin6_flowinfo = 0;
-                                sa6->sin6_addr = a6;
+				sa6->sin6_addr = a6;
 
 				if (__builtin_expect (el == NULL, 1))
 				    sa6->sin6_scope_id = 0;
@@ -365,9 +358,9 @@ __res_vinit(res_state statp, int preinit) {
 				statp->_u._ext.nsaddrs[nservall] = sa6;
 				statp->_u._ext.nssocks[nservall] = -1;
 				statp->_u._ext.nsmap[nservall] = MAXNS + 1;
-                                nservall++;
-                            }
-                        }
+				nservall++;
+			    }
+			}
 #endif
 		    }
 		    continue;
@@ -433,6 +426,11 @@ __res_vinit(res_state statp, int preinit) {
 #endif
 	    (void) fclose(fp);
 	}
+	if (__builtin_expect(statp->nscount == 0, 0)) {
+	    statp->nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);
+	    statp->nsaddr.sin_family = AF_INET;
+	    statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
+	}
 	if (statp->defdname[0] == 0 &&
 	    __gethostname(buf, sizeof(statp->defdname) - 1) == 0 &&
 	    (cp = strchr(buf, '.')) != NULL)
@@ -538,12 +536,12 @@ res_setoptions(res_state statp, const char *options, const char *source) {
 		} else if (!strncmp(cp, "no-check-names",
 				    sizeof("no-check-names") - 1)) {
 			statp->options |= RES_NOCHECKNAME;
-                } else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
+		} else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
 			statp->options |= RES_USE_EDNS0;
-                } else if (!strncmp(cp, "single-request-reopen",
+		} else if (!strncmp(cp, "single-request-reopen",
 				    sizeof("single-request-reopen") - 1)) {
 			statp->options |= RES_SNGLKUPREOP;
-                } else if (!strncmp(cp, "single-request",
+		} else if (!strncmp(cp, "single-request",
 				    sizeof("single-request") - 1)) {
 			statp->options |= RES_SNGLKUP;
 		} else {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9d70662339289b8b49d1c83a486a49af128f1c0a

commit 9d70662339289b8b49d1c83a486a49af128f1c0a
Author: H.J. Lu <hongjiu.lu@intel.com>
Date:   Sun Aug 15 20:09:23 2010 -0700

    Add -fno-asynchronous-unwind-tables to initfini.s for i386
    (cherry picked from commit f8392f40049cf6faedcf4f26736227d9a7a04b9e)

diff --git a/ChangeLog b/ChangeLog
index 5652715..67dbf46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* sysdeps/i386/elf/Makefile: New file.
+
 2010-07-31  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 82ebdbe..73c65e6 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* nptl/sysdeps/unix/sysv/linux/i386/Makefile: New file.
+
 2010-07-01  Ulrich Drepper  <drepper@redhat.com>
 
 	* Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/Makefile b/nptl/sysdeps/unix/sysv/linux/i386/Makefile
new file mode 100644
index 0000000..48eef38
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/i386/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),nptl)
+CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables
+endif
diff --git a/sysdeps/i386/elf/Makefile b/sysdeps/i386/elf/Makefile
new file mode 100644
index 0000000..61064d4
--- /dev/null
+++ b/sysdeps/i386/elf/Makefile
@@ -0,0 +1,4 @@
+ifeq ($(subdir),csu)
+# Turn off -fasynchronous-unwind-tables
+CFLAGS-initfini.s += -fno-asynchronous-unwind-tables
+endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=07b72c0b42b82f0432afcfb60a2cbb2c0f011420

commit 07b72c0b42b82f0432afcfb60a2cbb2c0f011420
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Aug 2 16:46:12 2010 -0700

    Hurd: fix timeout rounding in select
    (cherry picked from commit 5a42321d438211210e0869e5e90f8d75d1354e14)

diff --git a/ChangeLog b/ChangeLog
index ea5e7d2..5652715 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-31  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* hurd/hurdselect.c (_hurd_select): Round timeout up instead of down
+	when converting to ms.
+
 2010-07-29  Roland McGrath  <roland@redhat.com>
 
 	[BZ 11856]
diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
index 544eee9..a7228f0 100644
--- a/hurd/hurdselect.c
+++ b/hurd/hurdselect.c
@@ -52,7 +52,7 @@ _hurd_select (int nfds,
   int firstfd, lastfd;
   mach_msg_timeout_t to = (timeout != NULL ?
 			   (timeout->tv_sec * 1000 +
-			    timeout->tv_nsec / 1000000) :
+			    (timeout->tv_nsec + 999999) / 1000000) :
 			   0);
   struct
     {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=720be42915b3f5ae735f9f044b64285a2e34d33a

commit 720be42915b3f5ae735f9f044b64285a2e34d33a
Author: Roland McGrath <roland@redhat.com>
Date:   Thu Jul 29 10:49:42 2010 -0700

    BZ 11856: fix manual nit
    (cherry picked from commit 48cbc0d6d03b0591280489ddb6a2df60b850e57d)

diff --git a/ChangeLog b/ChangeLog
index ab5d2fe..ea5e7d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-29  Roland McGrath  <roland@redhat.com>
+
+	[BZ 11856]
+	* manual/locale.texi (Yes-or-No Questions): Fix example code.
+
 2010-07-27  Andreas Schwab  <schwab@redhat.com>
 
 	* manual/memory.texi (Malloc Tunable Parameters): Document
diff --git a/manual/locale.texi b/manual/locale.texi
index e3e0563..d1a50cb 100644
--- a/manual/locale.texi
+++ b/manual/locale.texi
@@ -1210,7 +1210,7 @@ This function would normally be used like this:
   /* @r{Prepare the @code{getline} call.}  */
   line = NULL;
   len = 0;
-  while (getline (&line, &len, stdout) >= 0)
+  while (getline (&line, &len, stdin) >= 0)
     @{
       /* @r{Check the response.}  */
       int res = rpmatch (line);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=de8b6f612a76c7432cb42f153c8b87391b57ced0

commit de8b6f612a76c7432cb42f153c8b87391b57ced0
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Jul 26 15:28:15 2010 +0200

    Document M_PERTURB
    (cherry picked from commit deb9cabbf475da0b65d7acdb364987c4a15b4214)

diff --git a/ChangeLog b/ChangeLog
index 5ade17f..ab5d2fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-27  Andreas Schwab  <schwab@redhat.com>
+
+	* manual/memory.texi (Malloc Tunable Parameters): Document
+	M_PERTURB.
+
 2010-07-26  Roland McGrath  <roland@redhat.com>
 
 	[BZ #11840]
diff --git a/manual/memory.texi b/manual/memory.texi
index 59ea1ee..db63c33 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -702,6 +702,11 @@ be allocated via @code{mmap}.
 @item M_MMAP_MAX
 The maximum number of chunks to allocate with @code{mmap}.  Setting this
 to zero disables all use of @code{mmap}.
+@item M_PERTURB
+If non-zero, memory blocks are filled with values depending on some
+low order bits of this parameter when they are allocated (except when
+allocated by @code{calloc}) and freed.  This can be used to debug the
+use of uninitialized or freed heap memory.
 @end table
 
 @end deftypefun

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5881b3d98138cdcfdc1d816dc1a2b8ec5d84659d

commit 5881b3d98138cdcfdc1d816dc1a2b8ec5d84659d
Author: Roland McGrath <roland@redhat.com>
Date:   Mon Jul 26 12:45:17 2010 -0700

    BZ #11840: Fix config.cache usage for -fgnu89-inline check.
    (cherry picked from commit 1c7570ff36595cba9f5797453eda95969a72c56e)

diff --git a/ChangeLog b/ChangeLog
index 867aae4..5ade17f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-07-26  Roland McGrath  <roland@redhat.com>
+
+	[BZ #11840]
+	* configure.in (-fgnu89-inline check): Set and substitute
+	gnu89_inline, not libc_cv_gnu89_inline.
+	* configure: Regenerated.
+	* config.make.in (gnu89-inline-CFLAGS): Use @gnu89_inline@.
+
 2010-07-20  Roland McGrath  <roland@redhat.com>
 
 	* elf/dl-sysdep.c (_dl_important_hwcaps): Add dsocaps mask to
diff --git a/config.make.in b/config.make.in
index d65706c..afce048 100644
--- a/config.make.in
+++ b/config.make.in
@@ -58,7 +58,7 @@ have-cpp-asm-debuginfo = @libc_cv_cpp_asm_debuginfo@
 enable-check-abi = @enable_check_abi@
 have-forced-unwind = @libc_cv_forced_unwind@
 have-fpie = @libc_cv_fpie@
-gnu89-inline-CFLAGS = @libc_cv_gnu89_inline@
+gnu89-inline-CFLAGS = @gnu89_inline@
 have-ssp = @libc_cv_ssp@
 have-selinux = @have_selinux@
 have-libaudit = @have_libaudit@
diff --git a/configure b/configure
index ce76653..1a3f672 100755
--- a/configure
+++ b/configure
@@ -681,7 +681,7 @@ libc_cv_cc_submachine
 exceptions
 no_whole_archive
 libc_cv_have_initfini
-libc_cv_gnu89_inline
+gnu89_inline
 libc_cv_ssp
 fno_unit_at_a_time
 libc_cv_hashstyle
@@ -6890,9 +6890,9 @@ fi
 { $as_echo "$as_me:$LINENO: result: $libc_cv_gnu89_inline" >&5
 $as_echo "$libc_cv_gnu89_inline" >&6; }
 if test $libc_cv_gnu89_inline = yes; then
-  libc_cv_gnu89_inline=-fgnu89-inline
+  gnu89_inline=-fgnu89-inline
 else
-  libc_cv_gnu89_inline=
+  gnu89_inline=
 fi
 
 
diff --git a/configure.in b/configure.in
index 182c683..7992115 100644
--- a/configure.in
+++ b/configure.in
@@ -1776,11 +1776,11 @@ else
 fi
 rm -f conftest*])
 if test $libc_cv_gnu89_inline = yes; then
-  libc_cv_gnu89_inline=-fgnu89-inline
+  gnu89_inline=-fgnu89-inline
 else
-  libc_cv_gnu89_inline=
+  gnu89_inline=
 fi
-AC_SUBST(libc_cv_gnu89_inline)
+AC_SUBST(gnu89_inline)
 
 if test $elf != yes; then
   AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=62724d5f1e48077992e1655c2dc4b5c47c08090e

commit 62724d5f1e48077992e1655c2dc4b5c47c08090e
Author: Roland McGrath <roland@redhat.com>
Date:   Tue Jul 20 19:09:50 2010 -0700

    Fix vDSO synthetic hwcap handling so they are not masked out from ld.so.cache matching.
    (cherry picked from commit 5dbc3b6cc0b759bf4b22d851ccb9cbf3e3cbc6ef)

diff --git a/ChangeLog b/ChangeLog
index 3de08e9..867aae4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-20  Roland McGrath  <roland@redhat.com>
+
+	* elf/dl-sysdep.c (_dl_important_hwcaps): Add dsocaps mask to
+	dl_hwcap_mask as well as dl_hwcap.  Without this, dsocaps matching in
+	ld.so.cache was broken.  With it, there is no way to disable dsocaps
+	like LD_HWCAP_MASK can disable hwcaps.
+
 2010-07-05  Roland McGrath  <roland@redhat.com>
 
 	* manual/arith.texi (Rounding Functions): Fix rint description
diff --git a/elf/dl-sysdep.c b/elf/dl-sysdep.c
index 5700272..0f4970a 100644
--- a/elf/dl-sysdep.c
+++ b/elf/dl-sysdep.c
@@ -424,6 +424,11 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
     {
       const ElfW(Word) mask = ((const ElfW(Word) *) dsocaps)[-1];
       GLRO(dl_hwcap) |= (uint64_t) mask << _DL_FIRST_EXTRA;
+      /* Note that we add the dsocaps to the set already chosen by the
+	 LD_HWCAP_MASK environment variable (or default HWCAP_IMPORTANT).
+	 So there is no way to request ignoring an OS-supplied dsocap
+	 string and bit like you can ignore an OS-supplied HWCAP bit.  */
+      GLRO(dl_hwcap_mask) |= (uint64_t) mask << _DL_FIRST_EXTRA;
       size_t len;
       for (const char *p = dsocaps; p < dsocaps + dsocapslen; p += len + 1)
 	{

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=553fe7087a45cc8cb84a994ce85708d085788947

commit 553fe7087a45cc8cb84a994ce85708d085788947
Author: Roland McGrath <roland@redhat.com>
Date:   Mon Jul 5 18:28:24 2010 -0700

    Manual wording fix for round{,f,l}.
    (cherry picked from commit 713df3d547041fddea30fa78c52dd0615bfd4c24)

diff --git a/ChangeLog b/ChangeLog
index d5c5485..3de08e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-05  Roland McGrath  <roland@redhat.com>
+
+	* manual/arith.texi (Rounding Functions): Fix rint description
+	implicit in round description.
+
 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
 
 	* elf/Makefile: Fix linking for a few tests to make recent linker
diff --git a/manual/arith.texi b/manual/arith.texi
index b1580a0..1b8a8c3 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -1407,7 +1407,8 @@ do not raise the inexact exception if @var{x} is not an integer.
 @comment ISO
 @deftypefunx {long double} roundl (long double @var{x})
 These functions are similar to @code{rint}, but they round halfway
-cases away from zero instead of to the nearest even integer.
+cases away from zero instead of to the nearest integer (or other
+current rounding mode).
 @end deftypefun
 
 @comment math.h

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9b44d3dad91de42deef5178fb42e57ac02211dae

commit 9b44d3dad91de42deef5178fb42e57ac02211dae
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Jul 2 09:49:05 2010 -0700

    More linking issues fixed.
    (cherry picked from commit 702e8f1450279f3e5dc22bf0935ee5ece4369fdb)

diff --git a/ChangeLog b/ChangeLog
index 156de9a..d5c5485 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-02  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/Makefile: Fix linking for a few tests to make recent linker
+	happy.
+
 2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>
 
 	* hurd/lookup-at.c (__file_name_lookup_at): Accept
diff --git a/elf/Makefile b/elf/Makefile
index d57c7fe..34609a0 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -759,11 +759,11 @@ $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
 $(objpfx)tst-tls9: $(libdl)
 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
 
-$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so
+$(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
 
-$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so
+$(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
 
-$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so
+$(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
 
 $(objpfx)tst-tls13: $(libdl)
 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a17f00a81580154f1c0cd6cc9799c9584c0965e2

commit a17f00a81580154f1c0cd6cc9799c9584c0965e2
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Thu Jul 1 19:03:29 2010 -0700

    Fix build with newer linker.
    (cherry picked from commit 72b6e8c85b95a949d8c5d827a16dd1492d9ef26b)

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index bb2e5dc..82ebdbe 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,7 @@
+2010-07-01  Ulrich Drepper  <drepper@redhat.com>
+
+	* Makefile (tst-_res1): Add tst-_res1mod1 to dependency list.
+
 2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #12113]
diff --git a/nptl/Makefile b/nptl/Makefile
index f96ed45..df458ac 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -489,7 +489,8 @@ $(objpfx)tst-rwlock14: $(common-objpfx)rt/librt.so
 $(objpfx)tst-_res1mod2.so: $(objpfx)tst-_res1mod1.so
 LDFLAGS-tst-_res1mod1.so = -Wl,-soname,tst-_res1mod1.so
 LDFLAGS-tst-_res1mod2.so = -Wl,-soname,tst-_res1mod2.so
-$(objpfx)tst-_res1: $(objpfx)tst-_res1mod2.so $(shared-thread-library)
+$(objpfx)tst-_res1: $(objpfx)tst-_res1mod1.so $(objpfx)tst-_res1mod2.so \
+		    $(shared-thread-library)
 else
 $(objpfx)tst-cond11: $(common-objpfx)rt/librt.a
 $(objpfx)tst-cond19: $(common-objpfx)rt/librt.a

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768

commit 9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768
Author: Emilio Pozuelo Monfort <pochu27@gmail.com>
Date:   Wed Jun 2 10:24:59 2010 -0700

    Hurd: Fix linkat symlink handling.
    (cherry picked from commit 2a50c07836d2750baf70442f8f760bf6cd43b3af)

diff --git a/ChangeLog b/ChangeLog
index cadc5dc..156de9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>
+
+	* hurd/lookup-at.c (__file_name_lookup_at): Accept
+	AT_SYMLINK_FOLLOW in AT_FLAGS.  Fail with EINVAL if both
+	AT_SYMLINK_FOLLOW and AT_SYMLINK_NOFOLLOW are present
+	in AT_FLAGS.
+	* hurd/hurd/fd.h (__file_name_lookup_at): Update comment.
+	* sysdeps/mach/hurd/linkat.c (linkat): Pass O_NOLINK in FLAGS.
+
 2010-11-03  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #12191]
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
index d1aa867..2473476 100644
--- a/hurd/hurd/fd.h
+++ b/hurd/hurd/fd.h
@@ -254,8 +254,9 @@ extern int _hurd_select (int nfds, struct pollfd *pollfds,
 			 const sigset_t *sigmask);
 
 /* Variant of file_name_lookup used in *at function implementations.
-   AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits
-   cause EINVAL.  */
+   AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW,
+   which will remove and add O_NOLINK from FLAGS respectively.
+   Other bits cause EINVAL.  */
 extern file_t __file_name_lookup_at (int fd, int at_flags,
 				     const char *file_name,
 				     int flags, mode_t mode);
diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c
index 7f55527..728a970 100644
--- a/hurd/lookup-at.c
+++ b/hurd/lookup-at.c
@@ -30,8 +30,14 @@ __file_name_lookup_at (int fd, int at_flags,
   error_t err;
   file_t result;
 
+  if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW))
+    return (__hurd_fail (EINVAL), MACH_PORT_NULL);
+
   flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
   at_flags &= ~AT_SYMLINK_NOFOLLOW;
+  if (at_flags & AT_SYMLINK_FOLLOW)
+    flags &= ~O_NOLINK;
+  at_flags &= ~AT_SYMLINK_FOLLOW;
   if (at_flags != 0)
     return (__hurd_fail (EINVAL), MACH_PORT_NULL);
 
diff --git a/sysdeps/mach/hurd/linkat.c b/sysdeps/mach/hurd/linkat.c
index 1942144..062d913 100644
--- a/sysdeps/mach/hurd/linkat.c
+++ b/sysdeps/mach/hurd/linkat.c
@@ -1,5 +1,5 @@
 /* Make a link between file names relative to open directories.  Hurd version.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +38,9 @@ linkat (fromfd, from, tofd, to, flags)
   file_t oldfile, linknode, todir;
   char *toname;
 
-  oldfile = __file_name_lookup_at (fromfd, flags, from, 0, 0);
+  /* POSIX says linkat doesn't follow symlinks by default, so pass
+     O_NOLINK.  That can be overridden by AT_SYMLINK_FOLLOW in FLAGS.  */
+  oldfile = __file_name_lookup_at (fromfd, flags, from, O_NOLINK, 0);
   if (oldfile == MACH_PORT_NULL)
     return -1;
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=827face44bf189f562225339d015a3b4b5cad023

commit 827face44bf189f562225339d015a3b4b5cad023
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Fri Nov 5 07:57:46 2010 -0400

    32bit memset-sse2.S fails with uneven cache size
    
    32bit memset-sse2.S assumes cache size is multiple of 128 bytes.  If
    it isn't true, memset-sse2.S will fail.  For example, a processor can
    have 24576 KB L3 cache and 20 cores. That is 2516582 byte per core. Half
    of it is 1258291, which isn't helpful for vector instructions.  This
    patch rounds cache sizes to multiple of 256 bytes.
    
    (cherry picked from commit c0dde15b5dba7e02ce6f36eab3a4d1c166f9951b
    but removed introduction of new variables)

diff --git a/ChangeLog b/ChangeLog
index 0daa4e3..cadc5dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #12191]
+	* sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Round
+	__x86_64_data_cache_size_half, __x86_64_data_cache_size
+	__x86_64_shared_cache_size_half and __x86_64_shared_cache_size,
+	to multiple of 256 bytes.
+
 2010-11-03  Ulrich Drepper  <drepper@gmail.com>
 
 	[BZ #12167]
diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86_64/cacheinfo.c
index 5b66c62..31da2b8 100644
--- a/sysdeps/x86_64/cacheinfo.c
+++ b/sysdeps/x86_64/cacheinfo.c
@@ -453,10 +453,10 @@ __cache_sysconf (int name)
 
 
 /* Half the data cache size for use in memory and string routines, typically
-   L1 size.  */
+   L1 size, rounded to multiple of 256 bytes.  */
 long int __x86_64_data_cache_size_half attribute_hidden = 32 * 1024 / 2;
 /* Shared cache size for use in memory and string routines, typically
-   L2 or L3 size.  */
+   L2 or L3 size, rounded to multiple of 256 bytes.  */
 long int __x86_64_shared_cache_size_half attribute_hidden = 1024 * 1024 / 2;
 long int __x86_64_shared_cache_size attribute_hidden = 1024 * 1024;
 
@@ -657,10 +657,16 @@ init_cacheinfo (void)
     }
 
   if (data > 0)
-    __x86_64_data_cache_size_half = data / 2;
+    {
+      /* Round data cache size to multiple of 256 bytes.  */
+      data = data & ~255L;
+      __x86_64_data_cache_size_half = data / 2;
+    }
 
   if (shared > 0)
     {
+      /* Round shared cache size to multiple of 256 bytes.  */
+      shared = shared & ~255L;
       __x86_64_shared_cache_size_half = shared / 2;
       __x86_64_shared_cache_size = shared;
     }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ca47880178b8611e37786770c252827d5faba260

commit ca47880178b8611e37786770c252827d5faba260
Author: Miklos Szeredi <miklos@szeredi.hu>
Date:   Wed Nov 3 00:25:45 2010 -0400

    Verify in ttyname() that the symlink is valid.
    
    (cherry picked from commit 0e516e0e14f2f9783a21cd1727bc53776341f857)

diff --git a/ChangeLog b/ChangeLog
index 88a0dc5..0daa4e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-03  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12167]
+	* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Recognize new mangling
+	of inacessible symlinks.  Verify result of symlink before returning it.
+	* sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Likewise.
+	Patch mostly by Miklos Szeredi <miklos@szeredi.hu>.
+
 2010-10-25  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #12159]
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index 69af6ad..6cec3a9 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,1996-2002,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1996-2002,2006,2009,2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -131,6 +132,9 @@ ttyname (int fd)
   if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
     return NULL;
 
+  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+    return NULL;
+
   /* We try using the /proc filesystem.  */
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
 
@@ -161,13 +165,32 @@ ttyname (int fd)
     {
       if ((size_t) len >= buflen)
 	return NULL;
+
+#define UNREACHABLE_LEN strlen ("(unreachable)")
+      if (len > UNREACHABLE_LEN
+	  && memcmp (ttyname_buf, "(unreachable)", UNREACHABLE_LEN) == 0)
+	{
+	  memmove (ttyname_buf, ttyname_buf + UNREACHABLE_LEN,
+		   len - UNREACHABLE_LEN);
+	  len -= UNREACHABLE_LEN;
+	}
+
       /* readlink need not terminate the string.  */
       ttyname_buf[len] = '\0';
-      return ttyname_buf;
-    }
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
-    return NULL;
+      /* Verify readlink result, fall back on iterating through devices.  */
+      if (ttyname_buf[0] == '/'
+	  && __xstat64 (_STAT_VER, ttyname_buf, &st1) == 0
+#ifdef _STATBUF_ST_RDEV
+	  && S_ISCHR (st1.st_mode)
+	  && st1.st_rdev == st.st_rdev
+#else
+	  && st1.st_ino == st.st_ino
+	  && st1.st_dev == st.st_dev
+#endif
+	  )
+	return ttyname_buf;
+    }
 
   if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
     {
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
index cef8624..2fa7503 100644
--- a/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,93,1995-2001,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1993,1995-2001,2003,2006,2010
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -122,6 +123,9 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
     return errno;
 
+  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+    return errno;
+
   /* We try using the /proc filesystem.  */
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';
 
@@ -145,12 +149,30 @@ __ttyname_r (int fd, char *buf, size_t buflen)
 #endif
 			, 1))
     {
+#define UNREACHABLE_LEN strlen ("(unreachable)")
+      if (ret > UNREACHABLE_LEN
+	  && memcmp (buf, "(unreachable)", UNREACHABLE_LEN) == 0)
+	{
+	  memmove (buf, buf + UNREACHABLE_LEN, ret - UNREACHABLE_LEN);
+	  ret -= UNREACHABLE_LEN;
+	}
+
+      /* readlink need not terminate the string.  */
       buf[ret] = '\0';
-      return 0;
-    }
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
-    return errno;
+      /* Verify readlink result, fall back on iterating through devices.  */
+      if (buf[0] == '/'
+	  && __xstat64 (_STAT_VER, buf, &st1) == 0
+#ifdef _STATBUF_ST_RDEV
+	  && S_ISCHR (st1.st_mode)
+	  && st1.st_rdev == st.st_rdev
+#else
+	  && st1.st_ino == st.st_ino
+	  && st1.st_dev == st.st_dev
+#endif
+	  )
+	return 0;
+    }
 
   /* Prepare the result buffer.  */
   memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/"));

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |  177 ++++++++++++++++++++
 INSTALL                                            |    6 +-
 Makeconfig                                         |    8 +-
 config.make.in                                     |    2 +-
 configure                                          |    6 +-
 configure.in                                       |    6 +-
 elf/Makefile                                       |    6 +-
 elf/dl-open.c                                      |   29 ----
 elf/dl-sysdep.c                                    |    5 +
 elf/rtld-Rules                                     |   13 ++-
 hurd/hurd/fd.h                                     |    5 +-
 hurd/hurdselect.c                                  |    2 +-
 hurd/lookup-at.c                                   |    6 +
 malloc/malloc.c                                    |    4 +-
 malloc/mcheck.c                                    |   22 +++-
 manual/arith.texi                                  |    3 +-
 manual/locale.texi                                 |    2 +-
 manual/memory.texi                                 |    5 +
 nptl/ChangeLog                                     |   15 ++
 nptl/Makefile                                      |    3 +-
 nptl/sysdeps/unix/sysv/linux/i386/Makefile         |    3 +
 posix/Makefile                                     |   10 +-
 posix/bug-regex31.c                                |   36 ++++
 posix/bug-regex31.input                            |    4 +
 posix/regcomp.c                                    |   19 ++-
 resolv/res_init.c                                  |   53 +++---
 ...linux-gnu.data => localplt-s390-linux-gnu.data} |    0
 ...inux-gnu.data => localplt-s390x-linux-gnu.data} |    0
 stdlib/strtod_l.c                                  |    4 +-
 sysdeps/i386/elf/Makefile                          |    4 +
 sysdeps/mach/hurd/linkat.c                         |    6 +-
 sysdeps/s390/s390-32/__longjmp.c                   |   13 +-
 sysdeps/s390/s390-64/__longjmp.c                   |   13 +-
 sysdeps/unix/sysv/linux/check_pf.c                 |   13 +-
 sysdeps/unix/sysv/linux/getdents.c                 |    6 +-
 sysdeps/unix/sysv/linux/ttyname.c                  |   33 +++-
 sysdeps/unix/sysv/linux/ttyname_r.c                |   32 +++-
 sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S   |   26 ++--
 sysdeps/unix/sysv/linux/x86_64/sys/epoll.h         |    4 +-
 sysdeps/x86_64/cacheinfo.c                         |   12 +-
 40 files changed, 482 insertions(+), 134 deletions(-)
 create mode 100644 nptl/sysdeps/unix/sysv/linux/i386/Makefile
 create mode 100644 posix/bug-regex31.c
 create mode 100644 posix/bug-regex31.input
 copy scripts/data/{localplt-i386-linux-gnu.data => localplt-s390-linux-gnu.data} (100%)
 copy scripts/data/{localplt-i386-linux-gnu.data => localplt-s390x-linux-gnu.data} (100%)
 create mode 100644 sysdeps/i386/elf/Makefile


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list