Compare commits

...

29 Commits
master ... f17

Author SHA1 Message Date
Carlos O'Donell
e3b31b7519 2.15-59.f17
* Tue Mar 19 2013 Carlos O'Donell <carlos@redhat.com> - 2.15.59
  - Fix multibyte character processing crash in regexp (#922889, CVE-2013-0242)
2013-03-19 15:03:41 -04:00
Carlos O'Donell
d89518e6fa Ignore /glibc-*.tar.gz files. 2013-02-07 16:42:18 -05:00
Jeff Law
7c988d1351 - Fix fenv.h to work with -m32. 2012-11-07 12:52:46 -07:00
Jeff Law
3d90229003 Revert "Update patch based on Roland's comments"
This reverts commit 6641bd99a04b2b3d1e67f2017e0c60225acb8f2d.
2012-09-14 12:01:04 -06:00
Jeff Law
6641bd99a0 Update patch based on Roland's comments 2012-09-14 11:44:29 -06:00
Jeff Law
4be2fd778c - Fix prototype of sigsetjmp in pthread.h (#857236). 2012-09-14 11:34:29 -06:00
Jeff Law
8943ff055d Fix typo 2012-08-15 10:03:35 -06:00
Jeff Law
98c032527a Fix integer overflow leading to buffer overflow in strto* (#847718) 2012-08-15 10:02:20 -06:00
Jeff Law
954d1135ac - Mark set*uid, set*gid as __wur (warn unused result) (#845960) 2012-08-06 11:54:50 -06:00
Jeff Law
1f4b9e1d91 - Pack IPv4 servers at the start of nsaddr_list and
only track the number of IPV4 servers in EXT(statp->nscount)
(#808147)
2012-08-06 11:52:27 -06:00
Patsy Franklin
7a23eb4b36 Resolves: #841318
- Remove two extraneous lines from the previous patch for BZ841318.
2012-08-03 01:41:39 -04:00
Jeff Law
6a0409c2be - Revert patch for BZ696143, it made it impossible to use IPV6
addresses explicitly in getaddrinfo, which in turn broke
    ssh, apache and other code. (#808147)
  - Avoid unbound alloca in vfprintf (#841318)
2012-07-26 00:10:58 -06:00
Jeff Law
cccd1fdc1c + - Revert recent changes to res_send (804630, 835090).
+  - Fix memcpy args in res_send (#841787).
2012-07-25 14:36:02 -06:00
Jeff Law
b77377bda0 - Fix FMA4 detection (#829011) 2012-07-03 14:04:45 -06:00
Jeff Law
1910ee7039 Fix regression after patch for BZ804630 (#835090). 2012-07-02 07:39:17 -06:00
Jeff Law
87db5ca47f - Fix use-after-free in dcigettext.c (#816647). 2012-06-21 12:14:39 -06:00
Dennis Gilmore
1d8247d9ef remove armhfp linker changes needs more testing in rawhide before we consider backporting to f17 2012-06-19 10:24:38 -05:00
Patsy Franklin
c34fcc86a9 Resolves: #827510
- Delay setting DECIDED field in locale file structure until we have read the file's data (#827510)
2012-06-15 12:46:16 -04:00
Dennis Gilmore
d5a26cf05e only deal with the arm linker compat hack on armhfp arches
- armsfp arches do not have a linker change
2012-06-11 19:32:33 -05:00
Jeff Law
13284ef261 Turn tests back on 2012-06-08 15:03:20 -06:00
Jeff Law
5e60c66fa4 Backward compat hack for armhf binaries. 2012-06-08 09:28:49 -06:00
Patsy Franklin
ef1896c59a Resolves: 804630
- Fix option rotate with single IPV6 server (#804630)
2012-06-07 20:27:45 -04:00
Patsy Franklin
6bc5e7da11 Resolves: 808014
- Do not override TTL of CNAME with TTL of its alias. (#808014)
2012-06-07 10:24:35 -04:00
Patsy Franklin
1ca8b816b8 - Last edit accidently removed %patch2058. 2012-06-05 16:28:06 -04:00
Patsy Franklin
e923c6aa1f - Corrected last changelog entry. 2012-06-05 16:20:10 -04:00
Patsy Franklin
e6ecb54080 - Fix DoS in RPC implementation (#767693) 2012-06-05 16:14:31 -04:00
Patsy Franklin
300d3e0439 Resolves: sw14134
- Fix iconv() segfault when the invalid multibyte character 0xffff is input
    when converting from IBM930 (#823905)
2012-06-05 15:12:40 -04:00
Jeff Law
8cb6cdad80 - Update arm specific configury. 2012-05-31 22:53:39 -06:00
Patsy Franklin
34e56ebeef Resolves: sw#14185
-Fix fnmatch() fails when '*' wildcard is applied on the file name containing multi-byte character(s)
2012-05-30 18:12:52 -04:00
20 changed files with 47114 additions and 42 deletions

16
.gitignore vendored
View File

@ -1,15 +1 @@
/glibc-ports-2.14-25-gd3d9bde.tar.xz
/glibc-2.14-394-g8f3b1ff-fedora.tar.xz
/glibc-2.14-394-g8f3b1ff.tar.xz
glibc-2.14-394-g8f3b1ff
/glibc-2.14-a4647e7-fedora.tar.gz
/glibc-2.14-a4647e7.tar.gz
/glibc-ports-2.14-4a93ed4.tar.gz
/glibc-2.14-16c6f99-fedora.tar.gz
/glibc-2.14-16c6f99.tar.gz
/glibc-ports-2.14-c2aeee1.tar.gz
/glibc-2.15-a316c1f-fedora.tar.gz
/glibc-2.15-a316c1f.tar.gz
/glibc-ports-2.15-8a70b2d.tar.gz
/glibc-2.15-0ea698a.tar.gz
/glibc-ports-2.15-ad8ae7d.tar.gz
/glibc-*.tar.gz

View File

@ -40,3 +40,292 @@ diff -rup c/sysdeps/arm/shlib-versions d/sysdeps/arm/shlib-versions
+%endif
arm.*-.*-linux.* ld=ld-linux.so.2
*** a/sysdeps/arm/configure Sun Jan 8 22:47:04 2012
--- b/sysdeps/arm/configure Tue May 8 12:37:21 2012
***************
*** 1 ****
--- 1,100 ----
+
+ # as_fn_set_status STATUS
+ # -----------------------
+ # Set $? to STATUS, without forking.
+ as_fn_set_status ()
+ {
+ return $1
+ } # as_fn_set_status
+
+ # as_fn_exit STATUS
+ # -----------------
+ # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+ as_fn_exit ()
+ {
+ set +e
+ as_fn_set_status $1
+ exit $1
+ } # as_fn_exit
+ # as_fn_arith ARG...
+ # ------------------
+ # Perform arithmetic evaluation on the ARGs, and store the result in the
+ # global $as_val. Take advantage of shells that can avoid forks. The arguments
+ # must be portable across $(()) and expr.
+ if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+ else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+ fi # as_fn_arith
+
+ if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+ else
+ as_expr=false
+ fi
+
+ if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+ else
+ as_basename=false
+ fi
+
+ as_me=`$as_basename -- "$0" ||
+ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+ $as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+ }
+
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
***************
*** 26,33 ****
fi
! { $as_echo "$as_me:$LINENO: result: $libc_cv_asm_cfi_directive_sections" >&5
$as_echo "$libc_cv_asm_cfi_directive_sections" >&6; }
if test $libc_cv_asm_cfi_directive_sections != yes; then
! { { $as_echo "$as_me:$LINENO: error: need .cfi_sections in this configuration" >&5
! $as_echo "$as_me: error: need .cfi_sections in this configuration" >&2;}
! { (exit 1); exit 1; }; }
fi
--- 163,335 ----
fi
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_cfi_directive_sections" >&5
$as_echo "$libc_cv_asm_cfi_directive_sections" >&6; }
if test $libc_cv_asm_cfi_directive_sections != yes; then
! as_fn_error $? "need .cfi_sections in this configuration" "$LINENO" 5
! fi
!
! # We check to see if the compiler and flags are
! # selecting the hard-float ABI and if they are then
! # we set libc_cv_arm_pcs_vfp to yes which causes
! # HAVE_ARM_PCS_VFP to be defined in config.h and
! # in include/libc-symbols.h and thus available to
! # shlib-versions to select the appropriate name for
! # the dynamic linker via %ifdef.
!
!
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
! $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
! if ${ac_cv_path_GREP+:} false; then :
! $as_echo_n "(cached) " >&6
! else
! if test -z "$GREP"; then
! ac_path_GREP_found=false
! # Loop through the user's path and test for each of PROGNAME-LIST
! as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
! for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
! do
! IFS=$as_save_IFS
! test -z "$as_dir" && as_dir=.
! for ac_prog in grep ggrep; do
! for ac_exec_ext in '' $ac_executable_extensions; do
! ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
! { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
! # Check for GNU ac_path_GREP and select it if it is found.
! # Check for GNU $ac_path_GREP
! case `"$ac_path_GREP" --version 2>&1` in
! *GNU*)
! ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
! *)
! ac_count=0
! $as_echo_n 0123456789 >"conftest.in"
! while :
! do
! cat "conftest.in" "conftest.in" >"conftest.tmp"
! mv "conftest.tmp" "conftest.in"
! cp "conftest.in" "conftest.nl"
! $as_echo 'GREP' >> "conftest.nl"
! "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
! diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
! as_fn_arith $ac_count + 1 && ac_count=$as_val
! if test $ac_count -gt ${ac_path_GREP_max-0}; then
! # Best one so far, save it but keep looking for a better one
! ac_cv_path_GREP="$ac_path_GREP"
! ac_path_GREP_max=$ac_count
! fi
! # 10*(2^10) chars as input seems more than enough
! test $ac_count -gt 10 && break
! done
! rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
! esac
!
! $ac_path_GREP_found && break 3
! done
! done
! done
! IFS=$as_save_IFS
! if test -z "$ac_cv_path_GREP"; then
! as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
! fi
! else
! ac_cv_path_GREP=$GREP
! fi
!
! fi
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
! $as_echo "$ac_cv_path_GREP" >&6; }
! GREP="$ac_cv_path_GREP"
!
!
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
! $as_echo_n "checking for egrep... " >&6; }
! if ${ac_cv_path_EGREP+:} false; then :
! $as_echo_n "(cached) " >&6
! else
! if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
! then ac_cv_path_EGREP="$GREP -E"
! else
! if test -z "$EGREP"; then
! ac_path_EGREP_found=false
! # Loop through the user's path and test for each of PROGNAME-LIST
! as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
! for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
! do
! IFS=$as_save_IFS
! test -z "$as_dir" && as_dir=.
! for ac_prog in egrep; do
! for ac_exec_ext in '' $ac_executable_extensions; do
! ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
! { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
! # Check for GNU ac_path_EGREP and select it if it is found.
! # Check for GNU $ac_path_EGREP
! case `"$ac_path_EGREP" --version 2>&1` in
! *GNU*)
! ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
! *)
! ac_count=0
! $as_echo_n 0123456789 >"conftest.in"
! while :
! do
! cat "conftest.in" "conftest.in" >"conftest.tmp"
! mv "conftest.tmp" "conftest.in"
! cp "conftest.in" "conftest.nl"
! $as_echo 'EGREP' >> "conftest.nl"
! "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
! diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
! as_fn_arith $ac_count + 1 && ac_count=$as_val
! if test $ac_count -gt ${ac_path_EGREP_max-0}; then
! # Best one so far, save it but keep looking for a better one
! ac_cv_path_EGREP="$ac_path_EGREP"
! ac_path_EGREP_max=$ac_count
! fi
! # 10*(2^10) chars as input seems more than enough
! test $ac_count -gt 10 && break
! done
! rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
! esac
!
! $ac_path_EGREP_found && break 3
! done
! done
! done
! IFS=$as_save_IFS
! if test -z "$ac_cv_path_EGREP"; then
! as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
! fi
! else
! ac_cv_path_EGREP=$EGREP
! fi
!
! fi
! fi
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
! $as_echo "$ac_cv_path_EGREP" >&6; }
! EGREP="$ac_cv_path_EGREP"
!
!
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is using the ARM hard-float ABI" >&5
! $as_echo_n "checking whether the compiler is using the ARM hard-float ABI... " >&6; }
! if ${libc_cv_arm_pcs_vfp+:} false; then :
! $as_echo_n "(cached) " >&6
! else
! cat confdefs.h - <<_ACEOF >conftest.$ac_ext
! /* end confdefs.h. */
! #ifdef __ARM_PCS_VFP
! yes
! #endif
!
! _ACEOF
! if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
! $EGREP "yes" >/dev/null 2>&1; then :
! libc_cv_arm_pcs_vfp=yes
! else
! libc_cv_arm_pcs_vfp=no
! fi
! rm -f conftest*
!
! fi
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcs_vfp" >&5
! $as_echo "$libc_cv_arm_pcs_vfp" >&6; }
! if test $libc_cv_arm_pcs_vfp = yes; then
! $as_echo "#define HAVE_ARM_PCS_VFP 1" >>confdefs.h
!
fi

View File

@ -0,0 +1,20 @@
diff -Nrup a/elf/dl-load.c b/elf/dl-load.c
--- a/elf/dl-load.c 2012-06-06 13:07:41.727524312 -0600
+++ b/elf/dl-load.c 2012-06-06 13:11:19.308681002 -0600
@@ -2093,10 +2093,14 @@ _dl_map_object (struct link_map *loader,
soname = ((const char *) D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_SONAME]->d_un.d_val);
if (strcmp (name, soname) != 0)
- continue;
+#ifdef __arm__
+ if (strcmp (name, "ld-linux.so.3")
+ || strcmp (soname, "ld-linux-armhf.so.3"))
+#endif
+ continue;
/* We have a match on a new name -- cache it. */
- add_name_to_object (l, soname);
+ add_name_to_object (l, name);
l->l_soname_added = 1;
}

42
glibc-fenvfix.patch Normal file
View File

@ -0,0 +1,42 @@
commit a728a38fb658f8b2f0acbea8a586db8bd054f3fe
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Jun 6 10:11:14 2012 -0700
Check __SSE_MATH__ in x86_64 feraiseexcept
2012-06-06 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14117]
* sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Check
__SSE_MATH__.
diff --git a/sysdeps/x86_64/fpu/bits/fenv.h b/sysdeps/x86_64/fpu/bits/fenv.h
index bb790c9..b2c01c4 100644
--- a/sysdeps/x86_64/fpu/bits/fenv.h
+++ b/sysdeps/x86_64/fpu/bits/fenv.h
@@ -109,7 +109,12 @@ __NTH (feraiseexcept (int __excepts))
/* One example of a invalid operation is 0.0 / 0.0. */
float __f = 0.0;
+# ifdef __SSE_MATH__
__asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
+# else
+ __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
+ : "=t" (__f) : "0" (__f));
+# endif
(void) &__f;
}
if ((FE_DIVBYZERO & __excepts) != 0)
@@ -117,7 +122,12 @@ __NTH (feraiseexcept (int __excepts))
float __f = 1.0;
float __g = 0.0;
+# ifdef __SSE_MATH__
__asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
+# else
+ __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
+ : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
+# endif
(void) &__f;
}

View File

@ -1,14 +0,0 @@
diff -rup a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
--- a/sysdeps/unix/sysv/linux/check_pf.c 2012-02-16 22:51:17.148797741 -0700
+++ b/sysdeps/unix/sysv/linux/check_pf.c 2012-02-17 10:55:26.513139941 -0700
@@ -209,7 +209,8 @@ make_request (int fd, pid_t pid)
}
else
{
- if (!IN6_IS_ADDR_LOOPBACK (address))
+ if (!IN6_IS_ADDR_LOOPBACK (address)
+ && !IN6_IS_ADDR_LINKLOCAL (address))
seen_ipv6 = true;
}
}
Only in b/sysdeps/x86_64: .dl-trampoline.S.swp

76
glibc-rh767693-2.patch Normal file
View File

@ -0,0 +1,76 @@
diff -rup a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
--- a/sunrpc/svc_tcp.c 2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_tcp.c 2012-06-05 11:30:09.948733571 -0600
@@ -44,6 +44,7 @@
#include <sys/poll.h>
#include <errno.h>
#include <stdlib.h>
+#include <time.h>
#include <wchar.h>
#include <libio/iolibio.h>
@@ -247,6 +248,11 @@ again:
{
if (errno == EINTR)
goto again;
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep(&ts , NULL);
+ }
return FALSE;
}
/*
diff -rup a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
--- a/sunrpc/svc_udp.c 2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_udp.c 2012-06-05 11:30:09.948733571 -0600
@@ -40,6 +40,7 @@
#include <sys/socket.h>
#include <errno.h>
#include <libintl.h>
+#include <time.h>
#ifdef IP_PKTINFO
#include <sys/uio.h>
@@ -277,8 +278,16 @@ again:
(int) su->su_iosz, 0,
(struct sockaddr *) &(xprt->xp_raddr), &len);
xprt->xp_addrlen = len;
- if (rlen == -1 && errno == EINTR)
- goto again;
+ if (rlen == -1)
+ {
+ if (errno == EINTR)
+ goto again;
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep(&ts , NULL);
+ }
+ }
if (rlen < 16) /* < 4 32-bit ints? */
return FALSE;
xdrs->x_op = XDR_DECODE;
diff -rup a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
--- a/sunrpc/svc_unix.c 2012-05-31 20:37:43.000000000 -0600
+++ b/sunrpc/svc_unix.c 2012-06-05 11:30:36.495612770 -0600
@@ -46,6 +46,7 @@
#include <errno.h>
#include <stdlib.h>
#include <libintl.h>
+#include <time.h>
#include <wchar.h>
/*
@@ -244,6 +245,11 @@ again:
{
if (errno == EINTR)
goto again;
+ if (errno == EMFILE)
+ {
+ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
+ __nanosleep(&ts , NULL);
+ }
return FALSE;
}
/*

23
glibc-rh808014.patch Normal file
View File

@ -0,0 +1,23 @@
diff -Nrup a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
--- a/resolv/nss_dns/dns-host.c 2012-06-07 09:10:06.145448414 -0400
+++ b/resolv/nss_dns/dns-host.c 2012-06-07 09:18:40.850019678 -0400
@@ -745,6 +745,10 @@ getanswer_r (const querybuf *answer, int
if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
{
+ /* A CNAME could also have a TTL entry. */
+ if (ttlp != NULL && ttl < *ttlp)
+ *ttlp = ttl;
+
if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
continue;
n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf);
@@ -906,7 +910,7 @@ getanswer_r (const querybuf *answer, int
{
register int nn;
- if (ttlp != NULL)
+ if (ttlp != NULL && ttl != 0 && ttl < *ttlp)
*ttlp = ttl;
if (canonp != NULL)
*canonp = bp;

25
glibc-rh816647.patch Normal file
View File

@ -0,0 +1,25 @@
2012-06-21 Jeff Law <law@redhat.com>
* intl/dcigettext.c (_nl_find_msg): Do not dereference memory
that may have just been free'd.
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index f6b7573..9c673d4 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -1149,13 +1149,14 @@ _nl_find_msg (domain_file, domainbinding, msgid, convert, lengthp)
/* We must allocate a new buffer or resize the old one. */
if (malloc_count > 0)
{
+ struct transmem_list *next = transmem_list->next;
++malloc_count;
freemem_size = malloc_count * INITIAL_BLOCK_SIZE;
newmem = (transmem_block_t *) realloc (transmem_list,
freemem_size);
# ifdef _LIBC
if (newmem != NULL)
- transmem_list = transmem_list->next;
+ transmem_list = next;
else
{
struct transmem_list *old = transmem_list;

78
glibc-rh819430.patch Normal file
View File

@ -0,0 +1,78 @@
diff -Nrup a/posix/fnmatch.c b/posix/fnmatch.c
--- a/posix/fnmatch.c 2012-01-01 07:16:32.000000000 -0500
+++ b/posix/fnmatch.c 2012-05-23 14:14:29.099461189 -0400
@@ -333,6 +333,7 @@ fnmatch (pattern, string, flags)
# if HANDLE_MULTIBYTE
if (__builtin_expect (MB_CUR_MAX, 1) != 1)
{
+ const char *orig_pattern = pattern;
mbstate_t ps;
size_t n;
const char *p;
@@ -356,10 +357,8 @@ fnmatch (pattern, string, flags)
alloca_used);
n = mbsrtowcs (wpattern, &p, n + 1, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- /* Something wrong.
- XXX Do we have to set `errno' to something which mbsrtows hasn't
- already done? */
- return -1;
+ /* Something wrong: Fall back to single byte matching. */
+ goto try_singlebyte;
if (p)
{
memset (&ps, '\0', sizeof (ps));
@@ -371,10 +370,8 @@ fnmatch (pattern, string, flags)
prepare_wpattern:
n = mbsrtowcs (NULL, &pattern, 0, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- /* Something wrong.
- XXX Do we have to set `errno' to something which mbsrtows hasn't
- already done? */
- return -1;
+ /*Something wrong: Fall back to single byte matching. */
+ goto try_singlebyte;
if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
{
__set_errno (ENOMEM);
@@ -401,14 +398,8 @@ fnmatch (pattern, string, flags)
alloca_used);
n = mbsrtowcs (wstring, &p, n + 1, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- {
- /* Something wrong.
- XXX Do we have to set `errno' to something which
- mbsrtows hasn't already done? */
- free_return:
- free (wpattern_malloc);
- return -1;
- }
+ /* Something wrong: Fall back to single byte matching. */
+ goto free_and_try_singlebyte;
if (p)
{
memset (&ps, '\0', sizeof (ps));
@@ -420,10 +411,8 @@ fnmatch (pattern, string, flags)
prepare_wstring:
n = mbsrtowcs (NULL, &string, 0, &ps);
if (__builtin_expect (n == (size_t) -1, 0))
- /* Something wrong.
- XXX Do we have to set `errno' to something which mbsrtows hasn't
- already done? */
- goto free_return;
+ /* Something wrong: Fall back to singlebyte matching. */
+ goto free_and_try_singlebyte;
if (__builtin_expect (n >= (size_t) -1 / sizeof (wchar_t), 0))
{
free (wpattern_malloc);
@@ -450,6 +439,10 @@ fnmatch (pattern, string, flags)
free (wpattern_malloc);
return res;
+ free_and_try_singlebyte:
+ free(wpattern_malloc);
+ try_singlebyte:
+ pattern = orig_pattern;
}
# endif /* mbstate_t and mbsrtowcs or _LIBC. */

14
glibc-rh823905.patch Normal file
View File

@ -0,0 +1,14 @@
diff --git a/iconvdata/ibm930.c b/iconvdata/ibm930.c
index 25a9be0..6f758eb 100644
--- a/iconvdata/ibm930.c
+++ b/iconvdata/ibm930.c
@@ -162,7 +162,8 @@ enum
while (ch > rp2->end) \
++rp2; \
\
- if (__builtin_expect (ch < rp2->start, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm930db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
{ \

27
glibc-rh827510.patch Normal file
View File

@ -0,0 +1,27 @@
2012-06-14 Jeff Law <law@redhat.com>
* locale/loadlocale.c (_nl_load_locale): Delay setting
file->decided until we have successfully loaded the file's
data.
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index e3fa187..9fd9216 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -169,7 +169,6 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
int save_err;
int alloc = ld_mapped;
- file->decided = 1;
file->data = NULL;
fd = open_not_cancel_2 (file->filename, O_RDONLY | O_CLOEXEC);
@@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
newdata->alloc = alloc;
file->data = newdata;
+ file->decided = 1;
}
void

432
glibc-rh829011.patch Normal file
View File

@ -0,0 +1,432 @@
diff -Nrup a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
--- a/sysdeps/i386/i686/multiarch/Makefile 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/i386/i686/multiarch/Makefile 2012-07-03 06:54:52.816446222 -0600
@@ -1,5 +1,6 @@
ifeq ($(subdir),csu)
aux += init-arch
+tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
endif
diff -Nrup a/sysdeps/i386/i686/multiarch/test-multiarch.c b/sysdeps/i386/i686/multiarch/test-multiarch.c
--- a/sysdeps/i386/i686/multiarch/test-multiarch.c 1969-12-31 17:00:00.000000000 -0700
+++ b/sysdeps/i386/i686/multiarch/test-multiarch.c 2012-07-03 06:54:58.989413307 -0600
@@ -0,0 +1 @@
+#include <sysdeps/x86_64/multiarch/test-multiarch.c>
diff -Nrup a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
--- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c 2012-07-03 06:52:21.747254987 -0600
+++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c 2012-07-03 10:26:59.261017426 -0600
@@ -14,7 +14,7 @@ extern double __ieee754_atan2_fma4 (doub
libm_ifunc (__ieee754_atan2,
HAS_FMA4 ? __ieee754_atan2_fma4
- : (HAS_YMM_USABLE ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
+ : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
strong_alias (__ieee754_atan2, __atan2_finite)
# define __ieee754_atan2 __ieee754_atan2_sse2
diff -Nrup a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c
--- a/sysdeps/x86_64/fpu/multiarch/e_exp.c 2012-07-03 06:52:21.748254982 -0600
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c 2012-07-03 10:26:59.261017426 -0600
@@ -14,7 +14,7 @@ extern double __ieee754_exp_fma4 (double
libm_ifunc (__ieee754_exp,
HAS_FMA4 ? __ieee754_exp_fma4
- : (HAS_YMM_USABLE ? __ieee754_exp_avx : __ieee754_exp_sse2));
+ : (HAS_AVX ? __ieee754_exp_avx : __ieee754_exp_sse2));
strong_alias (__ieee754_exp, __exp_finite)
# define __ieee754_exp __ieee754_exp_sse2
diff -Nrup a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c
--- a/sysdeps/x86_64/fpu/multiarch/e_log.c 2012-07-03 06:52:21.748254982 -0600
+++ b/sysdeps/x86_64/fpu/multiarch/e_log.c 2012-07-03 10:26:59.262017420 -0600
@@ -14,8 +14,7 @@ extern double __ieee754_log_fma4 (double
libm_ifunc (__ieee754_log,
HAS_FMA4 ? __ieee754_log_fma4
- : (HAS_YMM_USABLE ? __ieee754_log_avx
- : __ieee754_log_sse2));
+ : (HAS_AVX ? __ieee754_log_avx : __ieee754_log_sse2));
strong_alias (__ieee754_log, __log_finite)
# define __ieee754_log __ieee754_log_sse2
diff -Nrup a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c
--- a/sysdeps/x86_64/fpu/multiarch/s_atan.c 2012-07-03 06:52:21.749254977 -0600
+++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c 2012-07-03 10:26:59.263017414 -0600
@@ -13,7 +13,7 @@ extern double __atan_fma4 (double);
# endif
libm_ifunc (atan, (HAS_FMA4 ? __atan_fma4 :
- HAS_YMM_USABLE ? __atan_avx : __atan_sse2));
+ HAS_AVX ? __atan_avx : __atan_sse2));
# define atan __atan_sse2
#endif
diff -Nrup a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c
--- a/sysdeps/x86_64/fpu/multiarch/s_sin.c 2012-07-03 06:52:21.749254977 -0600
+++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c 2012-07-03 10:26:59.263017414 -0600
@@ -18,11 +18,11 @@ extern double __sin_fma4 (double);
# endif
libm_ifunc (__cos, (HAS_FMA4 ? __cos_fma4 :
- HAS_YMM_USABLE ? __cos_avx : __cos_sse2));
+ HAS_AVX ? __cos_avx : __cos_sse2));
weak_alias (__cos, cos)
libm_ifunc (__sin, (HAS_FMA4 ? __sin_fma4 :
- HAS_YMM_USABLE ? __sin_avx : __sin_sse2));
+ HAS_AVX ? __sin_avx : __sin_sse2));
weak_alias (__sin, sin)
# define __cos __cos_sse2
diff -Nrup a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c
--- a/sysdeps/x86_64/fpu/multiarch/s_tan.c 2012-07-03 06:52:21.750254972 -0600
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c 2012-07-03 10:26:59.264017408 -0600
@@ -13,7 +13,7 @@ extern double __tan_fma4 (double);
# endif
libm_ifunc (tan, (HAS_FMA4 ? __tan_fma4 :
- HAS_YMM_USABLE ? __tan_avx : __tan_sse2));
+ HAS_AVX ? __tan_avx : __tan_sse2));
# define tan __tan_sse2
#endif
diff -Nrup a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile
--- a/sysdeps/x86_64/multiarch/Makefile 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/x86_64/multiarch/Makefile 2012-07-03 06:53:48.964787267 -0600
@@ -1,5 +1,6 @@
ifeq ($(subdir),csu)
aux += init-arch
+tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
endif
diff -Nrup a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
--- a/sysdeps/x86_64/multiarch/init-arch.c 2012-07-03 06:52:21.792254746 -0600
+++ b/sysdeps/x86_64/multiarch/init-arch.c 2012-07-03 06:53:20.227941127 -0600
@@ -1,6 +1,6 @@
/* Initialize CPU feature data.
This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2012 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>.
The GNU C Library is free software; you can redistribute it and/or
@@ -14,9 +14,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <atomic.h>
#include <cpuid.h>
@@ -144,18 +143,23 @@ __init_cpu_features (void)
else
kind = arch_kind_other;
- if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
+ /* Can we call xgetbv? */
+ if (CPUID_OSXSAVE)
{
- /* Reset the AVX bit in case OSXSAVE is disabled. */
- if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) != 0
- && ({ unsigned int xcrlow;
- unsigned int xcrhigh;
- asm ("xgetbv"
- : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
- (xcrlow & 6) == 6; }))
- __cpu_features.feature[index_YMM_Usable] |= bit_YMM_Usable;
- else
- __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~bit_AVX;
+ unsigned int xcrlow;
+ unsigned int xcrhigh;
+ asm ("xgetbv" : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
+ /* Is YMM and XMM state usable? */
+ if ((xcrlow & (bit_YMM_state | bit_XMM_state)) ==
+ (bit_YMM_state | bit_XMM_state))
+ {
+ /* Determine if AVX is usable. */
+ if (CPUID_AVX)
+ __cpu_features.feature[index_AVX_Usable] |= bit_AVX_Usable;
+ /* Determine if FMA4 is usable. */
+ if (CPUID_FMA4)
+ __cpu_features.feature[index_FMA4_Usable] |= bit_FMA4_Usable;
+ }
}
__cpu_features.family = family;
diff -Nrup a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
--- a/sysdeps/x86_64/multiarch/init-arch.h 2012-07-03 06:52:21.751254967 -0600
+++ b/sysdeps/x86_64/multiarch/init-arch.h 2012-07-03 06:53:10.548993004 -0600
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2012 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -12,9 +12,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define bit_Fast_Rep_String (1 << 0)
#define bit_Fast_Copy_Backward (1 << 1)
@@ -22,8 +21,10 @@
#define bit_Prefer_SSE_for_memop (1 << 3)
#define bit_Fast_Unaligned_Load (1 << 4)
#define bit_Prefer_PMINUB_for_stringop (1 << 5)
-#define bit_YMM_Usable (1 << 6)
+#define bit_AVX_Usable (1 << 6)
+#define bit_FMA4_Usable (1 << 7)
+/* CPUID Feature flags. */
#define bit_SSE2 (1 << 26)
#define bit_SSSE3 (1 << 9)
#define bit_SSE4_1 (1 << 19)
@@ -34,6 +35,10 @@
#define bit_FMA (1 << 12)
#define bit_FMA4 (1 << 16)
+/* XCR0 Feature flags. */
+#define bit_XMM_state (1 << 1)
+#define bit_YMM_state (2 << 1)
+
#ifdef __ASSEMBLER__
# include <ifunc-defines.h>
@@ -50,7 +55,8 @@
# define index_Prefer_SSE_for_memop FEATURE_INDEX_1*FEATURE_SIZE
# define index_Fast_Unaligned_Load FEATURE_INDEX_1*FEATURE_SIZE
# define index_Prefer_PMINUB_for_stringop FEATURE_INDEX_1*FEATURE_SIZE
-# define index_YMM_Usable FEATURE_INDEX_1*FEATURE_SIZE
+# define index_AVX_Usable FEATURE_INDEX_1*FEATURE_SIZE
+# define index_FMA4_Usable FEATURE_INDEX_1*FEATURE_SIZE
#else /* __ASSEMBLER__ */
@@ -114,35 +120,45 @@ extern const struct cpu_features *__get_
/* Following are the feature tests used throughout libc. */
+/* CPUID_* evaluates to true if the feature flag is enabled.
+ We always use &__cpu_features because the HAS_CPUID_* macros
+ are called only within __init_cpu_features, where we can't
+ call __get_cpu_features without infinite recursion. */
+# define HAS_CPUID_FLAG(idx, reg, bit) \
+ (((&__cpu_features)->cpuid[idx].reg & (bit)) != 0)
+
+# define CPUID_OSXSAVE \
+ HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_OSXSAVE)
+# define CPUID_AVX \
+ HAS_CPUID_FLAG (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
+# define CPUID_FMA4 \
+ HAS_CPUID_FLAG (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
+
+/* HAS_* evaluates to true if we may use the feature at runtime. */
# define HAS_SSE2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, edx, bit_SSE2)
# define HAS_POPCOUNT HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_POPCOUNT)
# define HAS_SSSE3 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSSE3)
# define HAS_SSE4_1 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_1)
# define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_SSE4_2)
# define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_FMA)
-# define HAS_AVX HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, bit_AVX)
-# define HAS_FMA4 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_80000001, ecx, bit_FMA4)
# define index_Fast_Rep_String FEATURE_INDEX_1
# define index_Fast_Copy_Backward FEATURE_INDEX_1
# define index_Slow_BSF FEATURE_INDEX_1
# define index_Prefer_SSE_for_memop FEATURE_INDEX_1
# define index_Fast_Unaligned_Load FEATURE_INDEX_1
-# define index_YMM_Usable FEATURE_INDEX_1
+# define index_AVX_Usable FEATURE_INDEX_1
+# define index_FMA4_Usable FEATURE_INDEX_1
# define HAS_ARCH_FEATURE(name) \
((__get_cpu_features ()->feature[index_##name] & (bit_##name)) != 0)
-# define HAS_FAST_REP_STRING HAS_ARCH_FEATURE (Fast_Rep_String)
-
-# define HAS_FAST_COPY_BACKWARD HAS_ARCH_FEATURE (Fast_Copy_Backward)
-
-# define HAS_SLOW_BSF HAS_ARCH_FEATURE (Slow_BSF)
-
-# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
-
-# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-
-# define HAS_YMM_USABLE HAS_ARCH_FEATURE (YMM_Usable)
+# define HAS_FAST_REP_STRING HAS_ARCH_FEATURE (Fast_Rep_String)
+# define HAS_FAST_COPY_BACKWARD HAS_ARCH_FEATURE (Fast_Copy_Backward)
+# define HAS_SLOW_BSF HAS_ARCH_FEATURE (Slow_BSF)
+# define HAS_PREFER_SSE_FOR_MEMOP HAS_ARCH_FEATURE (Prefer_SSE_for_memop)
+# define HAS_FAST_UNALIGNED_LOAD HAS_ARCH_FEATURE (Fast_Unaligned_Load)
+# define HAS_AVX HAS_ARCH_FEATURE (AVX_Usable)
+# define HAS_FMA4 HAS_ARCH_FEATURE (FMA4_Usable)
#endif /* __ASSEMBLER__ */
diff -Nrup a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S
--- a/sysdeps/x86_64/multiarch/strcmp.S 2012-01-01 05:16:32.000000000 -0700
+++ b/sysdeps/x86_64/multiarch/strcmp.S 2012-07-03 06:53:42.956819413 -0600
@@ -1,5 +1,5 @@
/* strcmp with SSE4.2
- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2009-2012 Free Software Foundation, Inc.
Contributed by Intel Corporation.
This file is part of the GNU C Library.
@@ -14,9 +14,8 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <sysdep.h>
#include <init-arch.h>
@@ -84,6 +83,7 @@
.text
ENTRY(STRCMP)
.type STRCMP, @gnu_indirect_function
+ /* Manually inlined call to __get_cpu_features. */
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
@@ -101,13 +101,14 @@ END(STRCMP)
# ifdef USE_AS_STRCASECMP_L
ENTRY(__strcasecmp)
.type __strcasecmp, @gnu_indirect_function
+ /* Manually inlined call to __get_cpu_features. */
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
1:
# ifdef HAVE_AVX_SUPPORT
leaq __strcasecmp_avx(%rip), %rax
- testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+ testl $bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
jnz 2f
# endif
leaq __strcasecmp_sse42(%rip), %rax
@@ -124,13 +125,14 @@ weak_alias (__strcasecmp, strcasecmp)
# ifdef USE_AS_STRNCASECMP_L
ENTRY(__strncasecmp)
.type __strncasecmp, @gnu_indirect_function
+ /* Manually inlined call to __get_cpu_features. */
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
1:
# ifdef HAVE_AVX_SUPPORT
leaq __strncasecmp_avx(%rip), %rax
- testl $bit_AVX, __cpu_features+CPUID_OFFSET+index_AVX(%rip)
+ testl $bit_AVX_Usable, __cpu_features+FEATURE_OFFSET+index_AVX_Usable(%rip)
jnz 2f
# endif
leaq __strncasecmp_sse42(%rip), %rax
diff -Nrup a/sysdeps/x86_64/multiarch/test-multiarch.c b/sysdeps/x86_64/multiarch/test-multiarch.c
--- a/sysdeps/x86_64/multiarch/test-multiarch.c 1969-12-31 17:00:00.000000000 -0700
+++ b/sysdeps/x86_64/multiarch/test-multiarch.c 2012-07-03 06:53:54.418758092 -0600
@@ -0,0 +1,90 @@
+/* Test CPU feature data.
+ This file is part of the GNU C Library.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <init-arch.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static char *cpu_flags;
+
+/* Search for flags in /proc/cpuinfo and store line
+ in cpu_flags. */
+void
+get_cpuinfo (void)
+{
+ FILE *f;
+ char *line = NULL;
+ size_t len = 0;
+ ssize_t read;
+
+ f = fopen ("/proc/cpuinfo", "r");
+ if (f == NULL)
+ {
+ printf ("cannot open /proc/cpuinfo");
+ exit (1);
+ }
+
+ while ((read = getline (&line, &len, f)) != -1)
+ {
+ if (strncmp (line, "flags", 5) == 0)
+ {
+ cpu_flags = strdup (line);
+ break;
+ }
+ }
+ fclose (f);
+ free (line);
+}
+
+int
+check_proc (const char *proc_name, int flag, const char *name)
+{
+ int found = 0;
+
+ printf ("Checking %s:\n", name);
+ printf (" init-arch %d\n", flag);
+ if (strstr (cpu_flags, proc_name) != NULL)
+ found = 1;
+ printf (" cpuinfo (%s) %d\n", proc_name, found);
+
+ if (found != flag)
+ printf (" *** failure ***\n");
+
+ return (found != flag);
+}
+
+static int
+do_test (int argc, char **argv)
+{
+ int fails;
+
+ get_cpuinfo ();
+ fails = check_proc ("avx", HAS_AVX, "HAS_AVX");
+ fails += check_proc ("fma4", HAS_FMA4, "HAS_FMA4");
+ fails += check_proc ("sse4_2", HAS_SSE4_2, "HAS_SSE4_2");
+ fails += check_proc ("sse4_1", HAS_SSE4_1, "HAS_SSE4_1");
+ fails += check_proc ("ssse3", HAS_SSSE3, "HAS_SSSE3");
+ fails += check_proc ("popcnt", HAS_POPCOUNT, "HAS_POPCOUNT");
+
+ printf ("%d differences between /proc/cpuinfo and glibc code.\n", fails);
+
+ return (fails != 0);
+}
+
+#include "../../../test-skeleton.c"

13
glibc-rh841318-2.patch Normal file
View File

@ -0,0 +1,13 @@
diff -Nrup a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
--- a/stdio-common/vfprintf.c 2012-08-03 00:02:42.253538998 -0400
+++ b/stdio-common/vfprintf.c 2012-08-03 00:50:08.969629495 -0400
@@ -1682,8 +1682,6 @@ do_positional:
/* Now set SPECS_MALLOCED if needed. */
if (!__libc_use_alloca (nspecs_size))
specs_malloced = true;
- /* Copy the old array's elements to the new space. */
- memmove (specs, old, nspecs * sizeof (*specs));
}
/* Parse the format specifier. */
Binary files a/stdio-common/.vfprintf.c.swp and b/stdio-common/.vfprintf.c.swp differ

45231
glibc-rh841318.patch Normal file

File diff suppressed because it is too large Load Diff

42
glibc-rh841787.patch Normal file
View File

@ -0,0 +1,42 @@
diff -rup a/resolv/res_init.c b/resolv/res_init.c
--- a/resolv/res_init.c 2012-07-26 15:10:45.655638776 -0600
+++ b/resolv/res_init.c 2012-07-26 15:11:27.731423002 -0600
@@ -314,9 +314,9 @@ __res_vinit(res_state statp, int preinit
cp++;
if ((*cp != '\0') && (*cp != '\n')
&& __inet_aton(cp, &a)) {
- statp->nsaddr_list[nservall].sin_addr = a;
- statp->nsaddr_list[nservall].sin_family = AF_INET;
- statp->nsaddr_list[nservall].sin_port =
+ statp->nsaddr_list[nserv].sin_addr = a;
+ statp->nsaddr_list[nserv].sin_family = AF_INET;
+ statp->nsaddr_list[nserv].sin_port =
htons(NAMESERVER_PORT);
nserv++;
#ifdef _LIBC
diff -rup a/resolv/res_send.c b/resolv/res_send.c
--- a/resolv/res_send.c 2010-05-04 05:27:23.000000000 -0600
+++ b/resolv/res_send.c 2012-07-26 15:34:58.398261659 -0600
@@ -421,10 +421,10 @@ __libc_res_nsend(res_state statp, const
EXT(statp).nsmap[n] = MAXNS;
}
}
- n = statp->nscount;
- if (statp->nscount > EXT(statp).nscount)
+ n = statp->nscount - EXT(statp).nscount6;
+ if (n > EXT(statp).nscount)
for (n = EXT(statp).nscount, ns = 0;
- n < statp->nscount; n++) {
+ n < statp->nscount - EXT(statp).nscount6; n++) {
while (ns < MAXNS
&& EXT(statp).nsmap[ns] != MAXNS)
ns++;
@@ -441,7 +441,7 @@ __libc_res_nsend(res_state statp, const
malloc(sizeof (struct sockaddr_in6));
if (EXT(statp).nsaddrs[n] != NULL) {
memset (mempcpy(EXT(statp).nsaddrs[n],
- &statp->nsaddr_list[n],
+ &statp->nsaddr_list[ns],
sizeof (struct sockaddr_in)),
'\0',
sizeof (struct sockaddr_in6)

110
glibc-rh845960.patch Normal file
View File

@ -0,0 +1,110 @@
commit 7e66ee5142deda977163d0a858c3d2883cae3f07
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Jul 24 13:45:59 2012 +0200
* posix/unistd.h (setuid, setreuid, seteuid, setresuid):
Declare with warn_unused_result.
(setgid, setregid, setegid, setresgid): Likewise.
* sysdeps/unix/sysv/linux/sys/fsuid.h (setfsuid, setfsgid):
Likewise.
* WUR-REPORT: Remove set*id functions.
diff --git a/WUR-REPORT b/WUR-REPORT
index ef407cf..d997bd0 100644
--- a/WUR-REPORT
+++ b/WUR-REPORT
@@ -4,17 +4,6 @@ lssek: Probably should be __wur but lseek(fd,SEEK_SET,0) will succeed if
the descriptor is fine.
lseek64: same
-setuid: will always succeed given correct privileges, so there might
- be places which don't check for it.
-setreuid: same
-seteuid: same
-setgid: same
-setregid: same
-setegid: same
-setresuid: same
-setresgid: same
-
-
<stdio.h>:
setvbuf: if stream and buffer are fine and other parameters constant,
diff --git a/posix/unistd.h b/posix/unistd.h
index 9839761..88d711a 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -719,34 +719,34 @@ extern int group_member (__gid_t __gid) __THROW;
If the calling process is the super-user, set the real
and effective user IDs, and the saved set-user-ID to UID;
if not, the effective user ID is set to UID. */
-extern int setuid (__uid_t __uid) __THROW;
+extern int setuid (__uid_t __uid) __THROW __wur;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Set the real user ID of the calling process to RUID,
and the effective user ID of the calling process to EUID. */
-extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW;
+extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur;
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set the effective user ID of the calling process to UID. */
-extern int seteuid (__uid_t __uid) __THROW;
+extern int seteuid (__uid_t __uid) __THROW __wur;
#endif /* Use BSD. */
/* Set the group ID of the calling process to GID.
If the calling process is the super-user, set the real
and effective group IDs, and the saved set-group-ID to GID;
if not, the effective group ID is set to GID. */
-extern int setgid (__gid_t __gid) __THROW;
+extern int setgid (__gid_t __gid) __THROW __wur;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Set the real group ID of the calling process to RGID,
and the effective group ID of the calling process to EGID. */
-extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW;
+extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur;
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set the effective group ID of the calling process to GID. */
-extern int setegid (__gid_t __gid) __THROW;
+extern int setegid (__gid_t __gid) __THROW __wur;
#endif /* Use BSD. */
#ifdef __USE_GNU
@@ -763,12 +763,12 @@ extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
/* Set the real user ID, effective user ID, and saved-set user ID,
of the calling process to RUID, EUID, and SUID, respectively. */
extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
- __THROW;
+ __THROW __wur;
/* Set the real group ID, effective group ID, and saved-set group ID,
of the calling process to RGID, EGID, and SGID, respectively. */
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
- __THROW;
+ __THROW __wur;
#endif
diff --git a/sysdeps/unix/sysv/linux/sys/fsuid.h b/sysdeps/unix/sysv/linux/sys/fsuid.h
index 2fd512e..4494baf 100644
--- a/sysdeps/unix/sysv/linux/sys/fsuid.h
+++ b/sysdeps/unix/sysv/linux/sys/fsuid.h
@@ -25,10 +25,10 @@ __BEGIN_DECLS
/* Change uid used for file access control to UID, without affecting
other privileges (such as who can send signals at the process). */
-extern int setfsuid (__uid_t __uid) __THROW;
+extern int setfsuid (__uid_t __uid) __THROW __wur;
/* Ditto for group id. */
-extern int setfsgid (__gid_t __gid) __THROW;
+extern int setfsgid (__gid_t __gid) __THROW __wur;
__END_DECLS

353
glibc-rh847718.patch Normal file
View File

@ -0,0 +1,353 @@
diff -Nrup a/stdlib/Makefile b/stdlib/Makefile
--- a/stdlib/Makefile 2012-01-01 05:16:32.000000000 -0700
+++ b/stdlib/Makefile 2012-08-15 10:00:16.507875913 -0600
@@ -71,7 +71,7 @@ tests := tst-strtol tst-strtod testmb t
tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2 \
tst-makecontext2 tst-strtod6 tst-unsetenv1 \
- tst-makecontext3 bug-getcontext
+ tst-makecontext3 bug-getcontext tst-strtod-overflow
include ../Makeconfig
diff -Nrup a/stdlib/strtod_l.c b/stdlib/strtod_l.c
--- a/stdlib/strtod_l.c 2012-01-01 05:16:32.000000000 -0700
+++ b/stdlib/strtod_l.c 2012-08-15 09:59:54.091968453 -0600
@@ -62,6 +62,7 @@ extern unsigned long long int ____strtou
#include <math.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
/* The gmp headers need some configuration frobs. */
#define HAVE_ALLOCA 1
@@ -176,19 +177,19 @@ extern const mp_limb_t _tens_in_limb[MAX
/* Return a floating point number of the needed type according to the given
multi-precision number after possible rounding. */
static FLOAT
-round_and_return (mp_limb_t *retval, int exponent, int negative,
+round_and_return (mp_limb_t *retval, intmax_t exponent, int negative,
mp_limb_t round_limb, mp_size_t round_bit, int more_bits)
{
if (exponent < MIN_EXP - 1)
{
- mp_size_t shift = MIN_EXP - 1 - exponent;
-
- if (shift > MANT_DIG)
+ if (exponent < MIN_EXP - 1 - MANT_DIG)
{
__set_errno (ERANGE);
return 0.0;
}
+ mp_size_t shift = MIN_EXP - 1 - exponent;
+
more_bits |= (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0;
if (shift == MANT_DIG)
/* This is a special case to handle the very seldom case where
@@ -235,6 +236,9 @@ round_and_return (mp_limb_t *retval, int
__set_errno (ERANGE);
}
+ if (exponent > MAX_EXP)
+ goto overflow;
+
if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
&& (more_bits || (retval[0] & 1) != 0
|| (round_limb & ((((mp_limb_t) 1) << round_bit) - 1)) != 0))
@@ -260,6 +264,7 @@ round_and_return (mp_limb_t *retval, int
}
if (exponent > MAX_EXP)
+ overflow:
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
return MPN2FLOAT (retval, exponent, negative);
@@ -273,7 +278,7 @@ round_and_return (mp_limb_t *retval, int
factor for the resulting number (see code) multiply by it. */
static const STRING_TYPE *
str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
- int *exponent
+ intmax_t *exponent
#ifndef USE_WIDE_CHAR
, const char *decimal, size_t decimal_len, const char *thousands
#endif
@@ -337,7 +342,7 @@ str_to_mpn (const STRING_TYPE *str, int
}
while (--digcnt > 0);
- if (*exponent > 0 && cnt + *exponent <= MAX_DIG_PER_LIMB)
+ if (*exponent > 0 && *exponent <= MAX_DIG_PER_LIMB - cnt)
{
low *= _tens_in_limb[*exponent];
start = _tens_in_limb[cnt + *exponent];
@@ -415,7 +420,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
{
int negative; /* The sign of the number. */
MPN_VAR (num); /* MP representation of the number. */
- int exponent; /* Exponent of the number. */
+ intmax_t exponent; /* Exponent of the number. */
/* Numbers starting `0X' or `0x' have to be processed with base 16. */
int base = 10;
@@ -437,7 +442,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
/* Points at the character following the integer and fractional digits. */
const STRING_TYPE *expp;
/* Total number of digit and number of digits in integer part. */
- int dig_no, int_no, lead_zero;
+ size_t dig_no, int_no, lead_zero;
/* Contains the last character read. */
CHAR_TYPE c;
@@ -769,7 +774,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
are all or any is really a fractional digit will be decided
later. */
int_no = dig_no;
- lead_zero = int_no == 0 ? -1 : 0;
+ lead_zero = int_no == 0 ? (size_t) -1 : 0;
/* Read the fractional digits. A special case are the 'american
style' numbers like `16.' i.e. with decimal point but without
@@ -791,12 +796,13 @@ ____STRTOF_INTERNAL (nptr, endptr, group
(base == 16 && ({ CHAR_TYPE lo = TOLOWER (c);
lo >= L_('a') && lo <= L_('f'); })))
{
- if (c != L_('0') && lead_zero == -1)
+ if (c != L_('0') && lead_zero == (size_t) -1)
lead_zero = dig_no - int_no;
++dig_no;
c = *++cp;
}
}
+ assert (dig_no <= (uintmax_t) INTMAX_MAX);
/* Remember start of exponent (if any). */
expp = cp;
@@ -819,24 +825,80 @@ ____STRTOF_INTERNAL (nptr, endptr, group
if (c >= L_('0') && c <= L_('9'))
{
- int exp_limit;
+ intmax_t exp_limit;
/* Get the exponent limit. */
if (base == 16)
- exp_limit = (exp_negative ?
- -MIN_EXP + MANT_DIG + 4 * int_no :
- MAX_EXP - 4 * int_no + 4 * lead_zero + 3);
+ {
+ if (exp_negative)
+ {
+ assert (int_no <= (uintmax_t) (INTMAX_MAX
+ + MIN_EXP - MANT_DIG) / 4);
+ exp_limit = -MIN_EXP + MANT_DIG + 4 * (intmax_t) int_no;
+ }
+ else
+ {
+ if (int_no)
+ {
+ assert (lead_zero == 0
+ && int_no <= (uintmax_t) INTMAX_MAX / 4);
+ exp_limit = MAX_EXP - 4 * (intmax_t) int_no + 3;
+ }
+ else if (lead_zero == (size_t) -1)
+ {
+ /* The number is zero and this limit is
+ arbitrary. */
+ exp_limit = MAX_EXP + 3;
+ }
+ else
+ {
+ assert (lead_zero
+ <= (uintmax_t) (INTMAX_MAX - MAX_EXP - 3) / 4);
+ exp_limit = (MAX_EXP
+ + 4 * (intmax_t) lead_zero
+ + 3);
+ }
+ }
+ }
else
- exp_limit = (exp_negative ?
- -MIN_10_EXP + MANT_DIG + int_no :
- MAX_10_EXP - int_no + lead_zero + 1);
+ {
+ if (exp_negative)
+ {
+ assert (int_no
+ <= (uintmax_t) (INTMAX_MAX + MIN_10_EXP - MANT_DIG));
+ exp_limit = -MIN_10_EXP + MANT_DIG + (intmax_t) int_no;
+ }
+ else
+ {
+ if (int_no)
+ {
+ assert (lead_zero == 0
+ && int_no <= (uintmax_t) INTMAX_MAX);
+ exp_limit = MAX_10_EXP - (intmax_t) int_no + 1;
+ }
+ else if (lead_zero == (size_t) -1)
+ {
+ /* The number is zero and this limit is
+ arbitrary. */
+ exp_limit = MAX_10_EXP + 1;
+ }
+ else
+ {
+ assert (lead_zero
+ <= (uintmax_t) (INTMAX_MAX - MAX_10_EXP - 1));
+ exp_limit = MAX_10_EXP + (intmax_t) lead_zero + 1;
+ }
+ }
+ }
+
+ if (exp_limit < 0)
+ exp_limit = 0;
do
{
- exponent *= 10;
- exponent += c - L_('0');
-
- if (__builtin_expect (exponent > exp_limit, 0))
+ if (__builtin_expect ((exponent > exp_limit / 10
+ || (exponent == exp_limit / 10
+ && c - L_('0') > exp_limit % 10)), 0))
/* The exponent is too large/small to represent a valid
number. */
{
@@ -845,7 +907,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
/* We have to take care for special situation: a joker
might have written "0.0e100000" which is in fact
zero. */
- if (lead_zero == -1)
+ if (lead_zero == (size_t) -1)
result = negative ? -0.0 : 0.0;
else
{
@@ -864,6 +926,9 @@ ____STRTOF_INTERNAL (nptr, endptr, group
/* NOTREACHED */
}
+ exponent *= 10;
+ exponent += c - L_('0');
+
c = *++cp;
}
while (c >= L_('0') && c <= L_('9'));
@@ -932,7 +997,14 @@ ____STRTOF_INTERNAL (nptr, endptr, group
}
#endif
startp += lead_zero + decimal_len;
- exponent -= base == 16 ? 4 * lead_zero : lead_zero;
+ assert (lead_zero <= (base == 16
+ ? (uintmax_t) INTMAX_MAX / 4
+ : (uintmax_t) INTMAX_MAX));
+ assert (lead_zero <= (base == 16
+ ? ((uintmax_t) exponent
+ - (uintmax_t) INTMAX_MIN) / 4
+ : ((uintmax_t) exponent - (uintmax_t) INTMAX_MIN)));
+ exponent -= base == 16 ? 4 * (intmax_t) lead_zero : (intmax_t) lead_zero;
dig_no -= lead_zero;
}
@@ -974,7 +1046,10 @@ ____STRTOF_INTERNAL (nptr, endptr, group
}
/* Adjust the exponent for the bits we are shifting in. */
- exponent += bits - 1 + (int_no - 1) * 4;
+ assert (int_no <= (uintmax_t) (exponent < 0
+ ? (INTMAX_MAX - bits + 1) / 4
+ : (INTMAX_MAX - exponent - bits + 1) / 4));
+ exponent += bits - 1 + ((intmax_t) int_no - 1) * 4;
while (--dig_no > 0 && idx >= 0)
{
@@ -1014,13 +1089,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group
really integer digits or belong to the fractional part; i.e. we normalize
123e-2 to 1.23. */
{
- register int incr = (exponent < 0 ? MAX (-int_no, exponent)
- : MIN (dig_no - int_no, exponent));
+ register intmax_t incr = (exponent < 0
+ ? MAX (-(intmax_t) int_no, exponent)
+ : MIN ((intmax_t) dig_no - (intmax_t) int_no,
+ exponent));
int_no += incr;
exponent -= incr;
}
- if (__builtin_expect (int_no + exponent > MAX_10_EXP + 1, 0))
+ if (__builtin_expect (exponent > MAX_10_EXP + 1 - (intmax_t) int_no, 0))
{
__set_errno (ERANGE);
return negative ? -FLOAT_HUGE_VAL : FLOAT_HUGE_VAL;
@@ -1205,7 +1282,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
digits we should have enough bits for the result. The remaining
decimal digits give us the information that more bits are following.
This can be used while rounding. (Two added as a safety margin.) */
- if (dig_no - int_no > (MANT_DIG - bits + 2) / 3 + 2)
+ if ((intmax_t) dig_no > (intmax_t) int_no + (MANT_DIG - bits + 2) / 3 + 2)
{
dig_no = int_no + (MANT_DIG - bits + 2) / 3 + 2;
more_bits = 1;
@@ -1213,7 +1290,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
else
more_bits = 0;
- neg_exp = dig_no - int_no - exponent;
+ neg_exp = (intmax_t) dig_no - (intmax_t) int_no - exponent;
/* Construct the denominator. */
densize = 0;
diff -Nrup a/stdlib/tst-strtod-overflow.c b/stdlib/tst-strtod-overflow.c
--- a/stdlib/tst-strtod-overflow.c 1969-12-31 17:00:00.000000000 -0700
+++ b/stdlib/tst-strtod-overflow.c 2012-08-15 09:59:54.092968449 -0600
@@ -0,0 +1,48 @@
+/* Test for integer/buffer overflow in strtod.
+ Copyright (C) 2012 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define EXPONENT "e-2147483649"
+#define SIZE 214748364
+
+static int
+do_test (void)
+{
+ char *p = malloc (1 + SIZE + sizeof (EXPONENT));
+ if (p == NULL)
+ {
+ puts ("malloc failed, cannot test for overflow");
+ return 0;
+ }
+ p[0] = '1';
+ memset (p + 1, '0', SIZE);
+ memcpy (p + 1 + SIZE, EXPONENT, sizeof (EXPONENT));
+ double d = strtod (p, NULL);
+ if (d != 0)
+ {
+ printf ("strtod returned wrong value: %a\n", d);
+ return 1;
+ }
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

12
glibc-rh857236.patch Normal file
View File

@ -0,0 +1,12 @@
diff -Nrup a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
--- a/nptl/sysdeps/pthread/pthread.h 2012-06-30 13:12:34.000000000 -0600
+++ b/nptl/sysdeps/pthread/pthread.h 2012-09-14 06:37:42.165093926 -0600
@@ -731,7 +731,7 @@ extern void __pthread_unwind_next (__pth
/* Function used in the macros. */
struct __jmp_buf_tag;
-extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
/* Mutex handling. */

175
glibc-rh905877.patch Normal file
View File

@ -0,0 +1,175 @@
#
# Backported from upstream.
#
# - Add en_US.UTF-8 as pre-requisite for regression test:
#
# commit 62c4a69dc2aea24776cbf0e951d41709a7408cc6
# Author: Joseph Myers <joseph@codesourcery.com>
# Date: Thu Nov 1 00:22:04 2012 +0000
#
# Build en_US.UTF-8 locale for testing.
#
# - Fix buffer overrun:
#
# commit a445af0bc722d620afed7683cd320c0e4c7c6059
# Author: Andreas Schwab <schwab@suse.de>
# Date: Tue Jan 29 14:45:15 2013 +0100
#
# Fix buffer overrun in regexp matcher
#
# ChangeLog/
# 2013-02-12 Andreas Schwab <schwab@suse.de>
#
# [BZ #15078]
# * posix/regexec.c (extend_buffers): Add parameter min_len.
# (check_matching): Pass minimum needed length.
# (clean_state_log_if_needed): Likewise.
# (get_subexp): Likewise.
# * posix/Makefile (tests): Add bug-regex34.
# (bug-regex34-ENV): Define.
# * posix/bug-regex34.c: New file.
#
--- a/posix/Makefile 2012-01-01 07:16:32.000000000 -0500
+++ b/posix/Makefile 2013-03-19 14:06:04.066425334 -0400
@@ -94,7 +94,7 @@
tst-rfc3484-3 \
tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \
bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \
- bug-getopt5 tst-getopt_long1
+ bug-getopt5 tst-getopt_long1 bug-regex34
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
@@ -209,6 +209,7 @@
bug-regex26-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex30-ENV = LOCPATH=$(common-objpfx)localedata
bug-regex32-ENV = LOCPATH=$(common-objpfx)localedata
+bug-regex34-ENV = LOCPATH=$(common-objpfx)localedata
tst-rxspencer-ARGS = --utf8 rxspencer/tests
tst-rxspencer-ENV = LOCPATH=$(common-objpfx)localedata
tst-pcre-ARGS = PCRE.tests
diff --git a/posix/bug-regex34.c b/posix/bug-regex34.c
new file mode 100644
index 0000000..bb3b613
--- /dev/null
+++ b/posix/bug-regex34.c
@@ -0,0 +1,46 @@
+/* Test re_search with multi-byte characters in UTF-8.
+ Copyright (C) 2013 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE 1
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+#include <regex.h>
+
+static int
+do_test (void)
+{
+ struct re_pattern_buffer r;
+ /* ကျွန်ုပ်x */
+ const char *s = "\xe1\x80\x80\xe1\x80\xbb\xe1\x80\xbd\xe1\x80\x94\xe1\x80\xba\xe1\x80\xaf\xe1\x80\x95\xe1\x80\xbax";
+
+ if (setlocale (LC_ALL, "en_US.UTF-8") == NULL)
+ {
+ puts ("setlocale failed");
+ return 1;
+ }
+ memset (&r, 0, sizeof (r));
+
+ re_compile_pattern ("[^x]x", 5, &r);
+ /* This was triggering a buffer overflow. */
+ re_search (&r, s, strlen (s), 0, strlen (s), 0);
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/posix/regexec.c b/posix/regexec.c
index 7f2de85..5ca2bf6 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -197,7 +197,7 @@ static int group_nodes_into_DFAstates (const re_dfa_t *dfa,
static int check_node_accept (const re_match_context_t *mctx,
const re_token_t *node, int idx)
internal_function;
-static reg_errcode_t extend_buffers (re_match_context_t *mctx)
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len)
internal_function;
/* Entry point for POSIX code. */
@@ -1160,7 +1160,7 @@ check_matching (re_match_context_t *mctx, int fl_longest_match,
|| (BE (next_char_idx >= mctx->input.valid_len, 0)
&& mctx->input.valid_len < mctx->input.len))
{
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, next_char_idx + 1);
if (BE (err != REG_NOERROR, 0))
{
assert (err == REG_ESPACE);
@@ -1738,7 +1738,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, int next_state_log_idx)
&& mctx->input.valid_len < mctx->input.len))
{
reg_errcode_t err;
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, next_state_log_idx + 1);
if (BE (err != REG_NOERROR, 0))
return err;
}
@@ -2792,7 +2792,7 @@ get_subexp (re_match_context_t *mctx, int bkref_node, int bkref_str_idx)
if (bkref_str_off >= mctx->input.len)
break;
- err = extend_buffers (mctx);
+ err = extend_buffers (mctx, bkref_str_off + 1);
if (BE (err != REG_NOERROR, 0))
return err;
@@ -4102,7 +4102,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
static reg_errcode_t
internal_function __attribute_warn_unused_result__
-extend_buffers (re_match_context_t *mctx)
+extend_buffers (re_match_context_t *mctx, int min_len)
{
reg_errcode_t ret;
re_string_t *pstr = &mctx->input;
@@ -4111,8 +4111,10 @@ extend_buffers (re_match_context_t *mctx)
if (BE (INT_MAX / 2 / sizeof (re_dfastate_t *) <= pstr->bufs_len, 0))
return REG_ESPACE;
- /* Double the lengthes of the buffers. */
- ret = re_string_realloc_buffers (pstr, MIN (pstr->len, pstr->bufs_len * 2));
+ /* Double the lengthes of the buffers, but allocate at least MIN_LEN. */
+ ret = re_string_realloc_buffers (pstr,
+ MAX (min_len,
+ MIN (pstr->len, pstr->bufs_len * 2)));
if (BE (ret != REG_NOERROR, 0))
return ret;
--- a/localedata/Makefile 2012-01-01 07:16:32.000000000 -0500
+++ b/localedata/Makefile 2013-03-19 14:05:19.634636566 -0400
@@ -130,7 +130,7 @@
ifeq (no,$(cross-compiling))
# We have to generate locales
LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
- en_US.ISO-8859-1 ja_JP.EUC-JP da_DK.ISO-8859-1 \
+ en_US.ISO-8859-1 en_US.UTF-8 ja_JP.EUC-JP da_DK.ISO-8859-1 \
hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \
vi_VN.TCVN5712-1 nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 \
tr_TR.UTF-8 cs_CZ.UTF-8 zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 \

View File

@ -22,13 +22,13 @@
%define debuginfocommonarches %{biarcharches} alpha alphaev6
%define multiarcharches ppc ppc64 %{ix86} x86_64 %{sparc}
%define systemtaparches %{ix86} x86_64
# Remove -s to get verbose output.
%define silentrules PARALLELMFLAGS=-s
# Add -s for a less verbose build output.
%define silentrules PARALLELMFLAGS=
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 37%{?dist}
Release: 59%{?dist}
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@ -94,6 +94,10 @@ Patch0027: %{name}-rh564528.patch
# stap and thus will never be accepted upstream
Patch0044: %{name}-stap-libm.patch
# Needs to be submitted upstream
Patch0066: %{name}-rh841318.patch
Patch0067: %{name}-rh841318-2.patch
#
# Patches from upstream
#
@ -114,6 +118,10 @@ Patch1046: %{name}-rh806403.patch
Patch1048: %{name}-rh804792.patch
Patch1052: %{name}-sw13979.patch
Patch1053: %{name}-rh817276.patch
Patch1054: %{name}-rh808014.patch
Patch1068: %{name}-rh845960.patch
Patch1071: %{name}-fenvfix.patch
Patch1072: %{name}-rh905877.patch
#
# Patches submitted, but not yet approved upstream.
@ -160,9 +168,6 @@ Patch2029: %{name}-rh790298.patch
# Upstream BZ 13698
Patch2030: %{name}-rh791161.patch
# Upstream BZ 12377
Patch2031: %{name}-rh697149.patch
# Upstream BZ 9954
Patch2032: %{name}-rh739743.patch
@ -186,19 +191,50 @@ Patch2050: %{name}-rh682500.patch
# Upstream BZ 13761
Patch2051: %{name}-rh788989-2.patch
# Upstream, see libc-alpha posting from Carlos O'Donell 5/5/2012
Patch2054: %{name}-arm-hardfloat-1.patch
Patch2055: %{name}-arm-hardfloat-2.patch
# Upstream BZ 13753, probably will be fixed differently
Patch2056: %{name}-rh801650-3.patch
# Upstream BZ 14185
Patch2057: %{name}-rh819430.patch
# Upstream BZ 14134
Patch2058: %{name}-rh823905.patch
# See http://sourceware.org/ml/libc-alpha/2012-06/msg00074.html
Patch2059: %{name}-rh767693-2.patch
# Upstream BZ 14247
Patch2061: %{name}-rh827510.patch
# Upstream BZ 14277
Patch2062: %{name}-rh816647.patch
# Extracted from upstream sources
Patch2064: %{name}-rh829011.patch
# Upstream BZ 13028
Patch2065: %{name}-rh841787.patch
# Upstream BZ 14459
Patch2069: %{name}-rh847718.patch
# Upstream BZ 14583
Patch2070: %{name}-rh857236.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Obsoletes: glibc-profile < 2.4
Obsoletes: nss_db
Provides: ldconfig
# The dynamic linker supports DT_GNU_HASH
Provides: rtld(GNU_HASH)
# This is a short term need until everything is rebuilt in the ARM world
# to use the new dynamic linker path
%ifarch armv7hl armv7hnl
Provides: ld-linux.so.3
Provides: ld-linux.so.3(GLIBC_2.4)
%endif
Requires: glibc-common = %{version}-%{release}
# Require libgcc in case some program calls pthread_cancel in its %%post
Requires(pre): basesystem, libgcc
@ -437,7 +473,6 @@ rm -rf %{glibcportsdir}
%patch2028 -p1
%patch2029 -p1
%patch2030 -p1
%patch2031 -p1
%patch2032 -p1
%patch2033 -p1
%patch1034 -p1
@ -459,14 +494,27 @@ rm -rf %{glibcportsdir}
%patch2050 -p1
%patch2051 -p1
%patch1052 -p1
%patch2054 -p1
pushd ../%{glibcportsdir}
%patch1053 -p1
%patch2055 -p1
popd
%patch1054 -p1
%patch2056 -p1
%patch2057 -p1
%patch2058 -p1
%patch2059 -p1
%patch2061 -p1
%patch2062 -p1
%patch2064 -p1
%patch2065 -p1
%patch0066 -p1
%patch0067 -p1
%patch1068 -p1
%patch2069 -p1
%patch2070 -p1
%patch1071 -p1
%patch1072 -p1
# A lot of programs still misuse memcpy when they have to use
# memmove. The memcpy implementation below is not tolerant at
@ -901,12 +949,17 @@ touch -r fedora/glibc.spec.in $RPM_BUILD_ROOT/etc/ld.so.conf
touch -r timezone/northamerica $RPM_BUILD_ROOT/etc/localtime
touch -r sunrpc/etc.rpc $RPM_BUILD_ROOT/etc/rpc
# We allow undefined symbols in shared libraries because the libraries
# referenced at link time here, particularly ld.so, may be different than
# the one used at runtime. This is really only needed during the ARM
# transition from ld-linux.so.3 to ld-linux-armhf.so.3.
cd fedora
$GCC -Os -g -o build-locale-archive build-locale-archive.c \
../build-%{target}/locale/locarchive.o \
../build-%{target}/locale/md5.o \
-DDATADIR=\"%{_datadir}\" -DPREFIX=\"%{_prefix}\" \
-L../build-%{target} \
-Wl,--allow-shlib-undefined \
-B../build-%{target}/csu/ -lc -lc_nonshared
install -m 700 build-locale-archive $RPM_BUILD_ROOT/usr/sbin/build-locale-archive
cd ..
@ -933,6 +986,12 @@ ln -sf /%{_lib}/ld-linux-ia64.so.2 $RPM_BUILD_ROOT/lib/ld-linux-ia64.so.2
%endif
%endif
# Leave a compatibility symlink for the dynamic loader on armhfp targets,
# at least until the world gets rebuilt
%ifarch armv7hl armv7hnl
ln -sf /lib/ld-linux-armhf.so.3 $RPM_BUILD_ROOT/lib/ld-linux.so.3
%endif
%if %{run_glibc_tests}
# Increase timeouts
@ -1242,6 +1301,9 @@ rm -f *.filelist*
/lib/ld-linux-ia64.so.2
%endif
%endif
%ifarch armv7hl armv7hnl
/lib/ld-linux.so.3
%endif
%verify(not md5 size mtime) %config(noreplace) /etc/localtime
%verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf
%verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf
@ -1319,6 +1381,82 @@ rm -f *.filelist*
%endif
%changelog
* Tue Mar 19 2013 Carlos O'Donell <carlos@redhat.com> - 2.15.59
- Fix multibyte character processing crash in regexp (#922889, CVE-2013-0242)
* Wed Nov 7 2012 Jeff Law <law@redhat.com> - 2.15.58
- Fix fenv.h to work with -m32.
* Fri Sep 14 2012 Jeff Law <law@redhat.com> - 2.15.57
- Fix prototype of sigsetjmp in pthread.h (#857236).
* Wed Aug 15 2012 Jeff Law <law@redhat.com> - 2.15.56
- Fix integer overflow leading to buffer overflow in strto* (#847718)
* Mon Aug 6 2012 Jeff Law <law@redhat.com> - 2.15.55
- Pack IPv4 servers at the start of nsaddr_list and
only track the number of IPV4 servers in EXT(statp->nscounti (#808147)
- Mark set*uid, set*gid as __wur (warn unused result) (#845960)
* Fri Aug 3 2012 Patsy Franklin <pfrankli@redhat.com> - 2.15.54
- Remove two extraneous lines from previous patch for BZ841318 (#841318)
* Wed Jul 26 2012 Jeff Law <law@redhat.com> - 2.15.53
- Revert patch for BZ696143, it made it impossible to use IPV6
addresses explicitly in getaddrinfo, which in turn broke
ssh, apache and other code. (#808147)
- Avoid unbound alloca in vfprintf (#841318)
* Tue Jul 25 2012 Jeff Law <law@redhat.com> - 2.15.52
- Revert recent changes to res_send (804630, 835090).
- Fix memcpy args in res_send (#841787).
* Tue Jul 3 2012 Jeff Law <law@redhat.com> - 2.15.51
- Fix FMA4 detection (#829011)
* Thu Jun 28 2012 Jeff Law <law@redhat.com> - 2.15.50
- Fix regression after patch for BZ804630 (#835090).
* Thu Jun 20 2012 Jeff Law <law@redhat.com> - 2.15.49
- Fix use-after-free in dcigettext.c (#816647).
* Tue Jun 19 2012 Dennis Gilmore <dennis@ausil.us> - 2.15-48
- remove armhfp linker changes needs more testing in rawhide before we consider backporting to f17
* Fri Jun 15 2012 Patsy Franklin <pfrankli@redhat.com> - 2.15.47
- Delay setting DECIDED field in locale file structure until
we have read the file's data (#827510).
* Mon Jun 11 2012 Dennis Gilmore <dennis@ausil.us> - 2.15-46
- only deal with the arm linker compat hack on armhfp arches
- armsfp arches do not have a linker change
* Fri Jun 8 2012 Jeff Law <law@redhat.com> - 2.15.45
- Backward compat hack for armhf binaries.
* Thu Jun 7 2012 Patsy Franklin <patsy@redhat.com> - 2.15.44
- Fix option rotate with single IPV6 server (#804630)
* Thu Jun 7 2012 Patsy Franklin <patsy@redhat.com> - 2.15.43
- Do not override TTL of CNAME with TTL of its alias. (#808014)
* Tue Jun 5 2012 Patsy Franklin <patsy@redhat.com> - 2.15.42
- Last edit accidently removed %patch2058.
* Tue Jun 5 2012 Patsy Franklin <patsy@redhat.com> - 2.15.41
- Fix DoS in RPC implementation (#767693)
* Tue Jun 5 2012 Patsy Franklin <patsy@redhat.com> - 2.15.40
- Fix iconv() segfault when the invalid multibyte character 0xffff is input
when converting from IBM930 (#823905)
* Fri Jun 1 2012 Jeff Law <law@redhat.com> - 2.15-39
- Update arm specific configury.
* Thu May 24 2012 Patsy Franklin <pfrankli@redhat.com> - 2.15-38
- Fix fnmatch() when '*' wildcard is applied on a file name containing
multibyte chars. (#819430)
* Thu May 10 2012 Jeff Law <law@redhat.com> - 2.15-37
- Try again to fix AVX testing (#801650)