Automatic import for version 2.14.90

This commit is contained in:
Rosa 2012-02-01 17:02:55 +04:00
parent f4e418c74a
commit 7ce45dd1e2
41 changed files with 8296 additions and 2284 deletions

View file

@ -1,8 +1,7 @@
---
sources:
crypt_blowfish-1.0.2.tar.gz: e83e798528e72695e610e2a6419b57272d00fa0b
glibc-2.13.tar.xz: 38e7d510b41a2c36eb392c79eb5c80e0ec35a7f2
glibc-2.13.tar.xz.sig: c7953c5c032a3394af6711c21ee8972500f5667d
crypt_blowfish-1.2.tar.gz: 306ff83af206fac786900ce5e4800516cae909d9
glibc-2.14-394-g8f3b1ff-fedora.tar.xz: 797a230fc2099d9a7bfc649adff5b1e6f26f8402
glibc-2.14-394-g8f3b1ff.tar.xz: 3f99a23b72539b29516c6cadc7fe2ab49430ab1e
glibc-manpages.tar.bz2: ca54bfb832b703c8e35170fcc1c1f5470b45ff0f
glibc-powerpc-cpu-addon-v0.03.tar.bz2: a88f5e1e7647f131984cb831d54ea885b820001e
glibc-redhat.tar.bz2: 4ac897d3bb2367d00bfed2c45a00e4a8a532e9fc
glibc-ports-2.14-25-gd3d9bde.tar.xz: 991870d43cbee8aa48a4b203b63021af516e2791

View file

@ -0,0 +1,10 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: http://www.openwall.com/signatures/
iQCVAwUATiLawHK5fbEpUCnxAQIT4wP9GTUroM4r21oggeW0k3j5vICwSVHV5BbJ
MBOfliwa1tW9JNh/dEA9GHiPeVWXr/KNWm9/3bSYGDqfsYMlQ7x8w/CCUrS/gvpv
XtvwxUE5juAH5wy4+6oV1gBWiISWGOUcCqkgxPVZKOjlSV4c7kvr10JwqYdnqjK9
RT/A2FgAxM4=
=K4Xs
-----END PGP SIGNATURE-----

View file

@ -2,8 +2,9 @@
* This version is derived from the original implementation of FreeSec
* (release 1.1) by David Burren. I've reviewed the changes made in
* OpenBSD (as of 2.7) and modified the original code in a similar way
* where applicable. I've also made it reentrant and did a number of
* other changes -- SD.
* where applicable. I've also made it reentrant and made a number of
* other changes.
* - Solar Designer <solar at openwall.com>
*/
/*
@ -36,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.4 2005/11/16 13:08:32 solar Exp $
* $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.6 2010/02/20 14:45:06 solar Exp $
* $Id: crypt.c,v 1.15 1994/09/13 04:58:49 davidb Exp $
*
* This is an original implementation of the DES and the crypt(3) interfaces
@ -54,9 +55,8 @@
* posted to the sci.crypt newsgroup by the author and is available for FTP.
*
* ARCHITECTURE ASSUMPTIONS:
* This code used to have some nasty ones, but I believe these have
* been removed by now. The code isn't very portable and requires a
* 32-bit integer type, though -- SD.
* This code used to have some nasty ones, but these have been removed
* by now. The code requires a 32-bit integer type, though.
*/
#include <sys/types.h>
@ -181,22 +181,35 @@ static u_int32_t fp_maskl[8][256], fp_maskr[8][256];
static u_int32_t key_perm_maskl[8][128], key_perm_maskr[8][128];
static u_int32_t comp_maskl[8][128], comp_maskr[8][128];
/*
* We match the behavior of UFC-crypt on systems where "char" is signed by
* default (the majority), regardless of char's signedness on our system.
*/
static inline int
ascii_to_bin(char ch)
{
if (ch > 'z')
return(0);
if (ch >= 'a')
return(ch - 'a' + 38);
if (ch > 'Z')
return(0);
if (ch >= 'A')
return(ch - 'A' + 12);
if (ch > '9')
return(0);
if (ch >= '.')
return(ch - '.');
return(0);
signed char sch = ch;
int retval;
retval = sch - '.';
if (sch >= 'A') {
retval = sch - ('A' - 12);
if (sch >= 'a')
retval = sch - ('a' - 38);
}
retval &= 0x3f;
return(retval);
}
/*
* When we choose to "support" invalid salts, nevertheless disallow those
* containing characters that would violate the passwd file format.
*/
static inline int
ascii_is_unsafe(char ch)
{
return !ch || ch == '\n' || ch == ':';
}
void
@ -626,14 +639,24 @@ _crypt_extended_r(const char *key, const char *setting,
if (*setting == _PASSWORD_EFMT1) {
/*
* "new"-style:
* setting - underscore, 4 bytes of count, 4 bytes of salt
* setting - underscore, 4 chars of count, 4 chars of salt
* key - unlimited characters
*/
for (i = 1, count = 0; i < 5; i++)
count |= ascii_to_bin(setting[i]) << (i - 1) * 6;
for (i = 1, count = 0; i < 5; i++) {
int value = ascii_to_bin(setting[i]);
if (ascii64[value] != setting[i])
return(NULL);
count |= value << (i - 1) * 6;
}
if (!count)
return(NULL);
for (i = 5, salt = 0; i < 9; i++)
salt |= ascii_to_bin(setting[i]) << (i - 5) * 6;
for (i = 5, salt = 0; i < 9; i++) {
int value = ascii_to_bin(setting[i]);
if (ascii64[value] != setting[i])
return(NULL);
salt |= value << (i - 5) * 6;
}
while (*key) {
/*
@ -652,35 +675,25 @@ _crypt_extended_r(const char *key, const char *setting,
if (des_setkey((u_char *) keybuf, data))
return(NULL);
}
strncpy(data->output, setting, 9);
/*
* Double check that we weren't given a short setting.
* If we were, the above code will probably have created
* wierd values for count and salt, but we don't really care.
* Just make sure the output string doesn't have an extra
* NUL in it.
*/
memcpy(data->output, setting, 9);
data->output[9] = '\0';
p = (u_char *) data->output + strlen(data->output);
p = (u_char *) data->output + 9;
} else {
/*
* "old"-style:
* setting - 2 bytes of salt
* setting - 2 chars of salt
* key - up to 8 characters
*/
count = 25;
if (ascii_is_unsafe(setting[0]) || ascii_is_unsafe(setting[1]))
return(NULL);
salt = (ascii_to_bin(setting[1]) << 6)
| ascii_to_bin(setting[0]);
data->output[0] = setting[0];
/*
* If the encrypted password that the salt was extracted from
* is only 1 character long, the salt will be corrupted. We
* need to ensure that the output string doesn't have an extra
* NUL in it!
*/
data->output[1] = setting[1] ? setting[1] : data->output[0];
data->output[1] = setting[1];
p = (u_char *) data->output + 2;
}
setup_salt(salt, data);
@ -734,6 +747,7 @@ static struct {
char *hash;
char *pw;
} tests[] = {
/* "new"-style */
{"_J9..CCCCXBrJUJV154M", "U*U*U*U*"},
{"_J9..CCCCXUhOBTXzaiE", "U*U***U"},
{"_J9..CCCC4gQ.mB/PffM", "U*U***U*"},
@ -746,6 +760,30 @@ static struct {
{"_J9..SDizxmRI1GjnQuE", "zxyDPWgydbQjgq"},
{"_K9..SaltNrQgIYUAeoY", "726 even"},
{"_J9..SDSD5YGyRCr4W4c", ""},
/* "old"-style, valid salts */
{"CCNf8Sbh3HDfQ", "U*U*U*U*"},
{"CCX.K.MFy4Ois", "U*U***U"},
{"CC4rMpbg9AMZ.", "U*U***U*"},
{"XXxzOu6maQKqQ", "*U*U*U*U"},
{"SDbsugeBiC58A", ""},
{"./xZjzHv5vzVE", "password"},
{"0A2hXM1rXbYgo", "password"},
{"A9RXdR23Y.cY6", "password"},
{"ZziFATVXHo2.6", "password"},
{"zZDDIZ0NOlPzw", "password"},
/* "old"-style, "reasonable" invalid salts, UFC-crypt behavior expected */
{"\001\002wyd0KZo65Jo", "password"},
{"a_C10Dk/ExaG.", "password"},
{"~\377.5OTsRVjwLo", "password"},
/* The below are erroneous inputs, so NULL return is expected/required */
{"", ""}, /* no salt */
{" ", ""}, /* setting string is too short */
{"a:", ""}, /* unsafe character */
{"\na", ""}, /* unsafe character */
{"_/......", ""}, /* setting string is too short for its type */
{"_........", ""}, /* zero iteration count */
{"_/!......", ""}, /* invalid character in count */
{"_/......!", ""}, /* invalid character in salt */
{NULL}
};
@ -753,8 +791,12 @@ int main(void)
{
int i;
for (i = 0; tests[i].hash; i++)
if (strcmp(crypt(tests[i].pw, tests[i].hash), tests[i].hash)) {
for (i = 0; tests[i].hash; i++) {
char *hash = crypt(tests[i].pw, tests[i].hash);
if (!hash && strlen(tests[i].hash) < 13)
continue; /* expected failure */
if (!strcmp(hash, tests[i].hash))
continue; /* expected success */
puts("FAILED");
return 1;
}

View file

@ -1,3 +1,12 @@
/*
* The following notice applies to this header file (only):
*
* Copyright (c) 2002,2010 Solar Designer <solar at openwall.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*/
#ifndef _CRYPT_FREESEC_H
#define _CRYPT_FREESEC_H
@ -13,7 +22,29 @@ struct _crypt_extended_data {
/*
* _crypt_extended_init() must be called explicitly before first use of
* _crypt_extended_r().
* _crypt_extended_r(). Strictly speaking, _crypt_extended_init() is not
* reentrant. All it does is initialize some global variables to constant
* values, so it is unlikely that anything would go wrong if this is done
* multiple times in parallel, but correct behavior in that case is not
* guaranteed (e.g., things may go wrong if a given CPU architecture can't
* operate on 32-bit quantities natively, requiring read-modify-write
* instruction sequences operating on larger quantities and thus affecting
* nearby array elements).
*
* Before first use of the data structure, its "initialized" field must be
* set to 0. This is compatible with the requirement of some other crypt_r()
* implementations requiring the entire data structure to be initialized
* with all zero bytes, so that approach may be applied instead (e.g., this
* may be required from the callers of a wrapper function).
*
* _crypt_extended_r() returns NULL on error. Although modern standards say
* that crypt(3) does in fact return NULL on error, many applications do not
* expect that. Thus, it is recommended that a crypt(3)-like wrapper function
* translate these NULL returns into strings guaranteed to be different from
* the "setting" string, too short for matching a valid password hash, and not
* containing any characters that would be special for the passwd file format.
* Specifically, such a wrapper function may return "*0" on error as long as
* the "setting" string does not start with "*0", or "*1" otherwise.
*/
void _crypt_extended_init(void);

View file

@ -1,15 +0,0 @@
2006-05-16 Gwenole Beauchesne <gbeauchesne@mandriva.com>
* scripts/check-local-headers.sh: Filter out multiarch headers.
diff -p -up glibc-2.10.1/scripts/check-local-headers.sh.orig glibc-2.10.1/scripts/check-local-headers.sh
--- glibc-2.10.1/scripts/check-local-headers.sh.orig 2009-04-02 13:59:53.000000000 -0300
+++ glibc-2.10.1/scripts/check-local-headers.sh 2009-05-26 23:45:32.000000000 -0300
@@ -30,6 +30,7 @@ if fgrep "$includedir" */*.{o,os,oS}.d |
fgrep -v "$includedir/asm" |
fgrep -v "$includedir/linux" |
fgrep -v "$includedir/selinux" |
+fgrep -v "$includedir/multiarch-" |
fgrep -v "$includedir/sys/capability.h" |
fgrep -v "$includedir/gd" |
fgrep -v "$includedir/nss3"; then

View file

@ -1,44 +0,0 @@
See https://qa.mandriva.com/show_bug.cgi?id=58834
Patch from bug report, updated for glibc 2.12.1 in Mandriva
diff -p -up glibc-2.12.1/posix/gai.conf.orig glibc-2.12.1/posix/gai.conf
--- glibc-2.12.1/posix/gai.conf.orig 2010-07-27 08:34:39.000000000 -0300
+++ glibc-2.12.1/posix/gai.conf 2010-08-25 11:27:32.302898528 -0300
@@ -56,9 +56,7 @@
#
# scopev4 <mask> <value>
# Add another rule to the RFC 3484 scope table for IPv4 addresses.
-# By default the scope IDs described in section 3.2 in RFC 3484 are
-# used. Changing these defaults should hardly ever be necessary.
-# The defaults are equivalent to:
+# The definitions in RFC 3484 are equivalent to:
#
#scopev4 ::ffff:169.254.0.0/112 2
#scopev4 ::ffff:127.0.0.0/104 2
@@ -69,8 +67,8 @@
#
# For sites which use site-local IPv4 addresses behind NAT there is
# the problem that even if IPv4 addresses are preferred they do not
-# have the same scope and are therefore not sorted first. To change
-# this use only these rules:
+# have the same scope and are therefore not sorted first. Therefore,
+# the following settings are used by default on this system:
#
#scopev4 ::ffff:169.254.0.0/112 2
#scopev4 ::ffff:127.0.0.0/104 2
diff -p -up glibc-2.12.1/sysdeps/posix/getaddrinfo.c.orig glibc-2.12.1/sysdeps/posix/getaddrinfo.c
--- glibc-2.12.1/sysdeps/posix/getaddrinfo.c.orig 2010-07-27 08:34:39.000000000 -0300
+++ glibc-2.12.1/sysdeps/posix/getaddrinfo.c 2010-08-25 11:24:03.960253468 -0300
@@ -1099,10 +1099,12 @@ static const struct scopeentry
/* Link-local addresses: scope 2. */
{ { { 169, 254, 0, 0 } }, htonl_c (0xffff0000), 2 },
{ { { 127, 0, 0, 0 } }, htonl_c (0xff000000), 2 },
+#if 0
/* Site-local addresses: scope 5. */
{ { { 10, 0, 0, 0 } }, htonl_c (0xff000000), 5 },
{ { { 172, 16, 0, 0 } }, htonl_c (0xfff00000), 5 },
{ { { 192, 168, 0, 0 } }, htonl_c (0xffff0000), 5 },
+#endif
/* Default: scope 14. */
{ { { 0, 0, 0, 0 } }, htonl_c (0x00000000), 14 }
};

View file

@ -1,38 +0,0 @@
diff -p -up glibc-2.12.1/sysdeps/generic/paths.h.orig glibc-2.12.1/sysdeps/generic/paths.h
--- glibc-2.12.1/sysdeps/generic/paths.h.orig 2010-07-27 08:34:39.000000000 -0300
+++ glibc-2.12.1/sysdeps/generic/paths.h 2010-12-27 11:19:18.515673954 -0200
@@ -62,13 +62,13 @@
#define _PATH_UNIX "/vmunix"
#define _PATH_UTMP "/var/run/utmp"
#define _PATH_UTMP_DB "/var/run/utmp.db"
-#define _PATH_VI "/usr/bin/vi"
+#define _PATH_VI "/bin/vi"
#define _PATH_WTMP "/var/log/wtmp"
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
#define _PATH_TMP "/tmp/"
-#define _PATH_VARDB "/var/db/"
+#define _PATH_VARDB "/var/lib/misc/"
#define _PATH_VARRUN "/var/run/"
#define _PATH_VARTMP "/var/tmp/"
diff -p -up glibc-2.12.1/sysdeps/unix/sysv/linux/paths.h.orig glibc-2.12.1/sysdeps/unix/sysv/linux/paths.h
--- glibc-2.12.1/sysdeps/unix/sysv/linux/paths.h.orig 2010-07-27 08:34:39.000000000 -0300
+++ glibc-2.12.1/sysdeps/unix/sysv/linux/paths.h 2010-12-27 11:20:43.701245004 -0200
@@ -62,13 +62,13 @@
#define _PATH_TTY "/dev/tty"
#define _PATH_UNIX "/boot/vmlinux"
#define _PATH_UTMP "/var/run/utmp"
-#define _PATH_VI "/usr/bin/vi"
+#define _PATH_VI "/bin/vi"
#define _PATH_WTMP "/var/log/wtmp"
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
#define _PATH_TMP "/tmp/"
-#define _PATH_VARDB "/var/db/"
+#define _PATH_VARDB "/var/lib/misc/"
#define _PATH_VARRUN "/var/run/"
#define _PATH_VARTMP "/var/tmp/"

View file

@ -1,92 +0,0 @@
From: Andreas Schwab <schwab at redhat dot com>
Subject: [PATCH] Never expand $ORIGIN in privileged programs
Date: Mon, 18 Oct 2010 15:12:09 +0200
Path elements containing $ORIGIN should always be ignored in privileged
programs.
Andreas.
2010-10-18 Andreas Schwab <schwab@redhat.com>
* elf/dl-load.c (is_dst): Remove last parameter.
(_dl_dst_count): Ignore $ORIGIN in privileged programs.
(_dl_dst_substitute): Likewise.
---
elf/dl-load.c | 30 +++++++++++++-----------------
1 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index a7162eb..776f7e4 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -169,8 +169,7 @@ local_strdup (const char *s)
static size_t
-is_dst (const char *start, const char *name, const char *str,
- int is_path, int secure)
+is_dst (const char *start, const char *name, const char *str, int is_path)
{
size_t len;
bool is_curly = false;
@@ -199,11 +198,6 @@ is_dst (const char *start, const char *name, const char *str,
&& (!is_path || name[len] != ':'))
return 0;
- if (__builtin_expect (secure, 0)
- && ((name[len] != '\0' && (!is_path || name[len] != ':'))
- || (name != start + 1 && (!is_path || name[-2] != ':'))))
- return 0;
-
return len;
}
@@ -218,13 +212,12 @@ _dl_dst_count (const char *name, int is_path)
{
size_t len;
- /* $ORIGIN is not expanded for SUID/GUID programs (except if it
- is $ORIGIN alone) and it must always appear first in path. */
+ /* $ORIGIN is not expanded for SUID/GUID programs. */
++name;
- if ((len = is_dst (start, name, "ORIGIN", is_path,
- INTUSE(__libc_enable_secure))) != 0
- || (len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0
- || (len = is_dst (start, name, "LIB", is_path, 0)) != 0)
+ if (((len = is_dst (start, name, "ORIGIN", is_path)) != 0
+ && !INTUSE(__libc_enable_secure))
+ || (len = is_dst (start, name, "PLATFORM", is_path)) != 0
+ || (len = is_dst (start, name, "LIB", is_path)) != 0)
++cnt;
name = strchr (name + len, '$');
@@ -256,9 +249,12 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
size_t len;
++name;
- if ((len = is_dst (start, name, "ORIGIN", is_path,
- INTUSE(__libc_enable_secure))) != 0)
+ if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0)
{
+ /* Ignore this path element in SUID/SGID programs. */
+ if (INTUSE(__libc_enable_secure))
+ repl = (const char *) -1;
+ else
#ifndef SHARED
if (l == NULL)
repl = _dl_get_origin ();
@@ -266,9 +262,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
#endif
repl = l->l_origin;
}
- else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
+ else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0)
repl = GLRO(dl_platform);
- else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0)
+ else if ((len = is_dst (start, name, "LIB", is_path)) != 0)
repl = DL_DST_LIB;
if (repl != NULL && repl != (const char *) -1)
--
1.7.2.3

View file

@ -1,35 +0,0 @@
2010-06-13 Aurelien Jarno <aurelien@aurel32.net>
* locale/C-translit.h.in: Add entry for U20A1.
diff --git a/locale/C-translit.h.in b/locale/C-translit.h.in
index ab0b130..5286802 100644
--- a/locale/C-translit.h.in
+++ b/locale/C-translit.h.in
@@ -103,6 +103,7 @@
"\x2061" "" /* <U2061> FUNCTION APPLICATION */
"\x2062" "" /* <U2062> INVISIBLE TIMES */
"\x2063" "" /* <U2063> INVISIBLE SEPARATOR */
+"\x20a1" "CRC" /* <U20A1> COLON SIGN */
"\x20a8" "Rs" /* <U20A8> RUPEE SIGN */
"\x20ac" "EUR" /* <U20AC> EURO SIGN */
"\x2100" "a/c" /* <U2100> ACCOUNT OF */
2010-06-13 Aurelien Jarno <aurelien@aurel32.net>
* locales/translit_neutral: Add entry for U20A1.
diff --git a/localedata/locales/translit_neutral b/localedata/locales/translit_neutral
index 5883d28..5712361 100644
--- a/localedata/locales/translit_neutral
+++ b/localedata/locales/translit_neutral
@@ -128,6 +128,8 @@ include "translit_wide";""
<U2063> ""
% DONG SIGN
<U20AB> "<U0110><U1ED3><U006E><U0067>"
+% COLON SIGN
+<U20A1> "<U0043><U0052><U0043>"
% EURO SIGN
<U20AC> "<U0045><U0055><U0052>"
% TRADE MARK SIGN

View file

@ -1,64 +0,0 @@
Fix a bug in tls initialization which caused __tls_get_addr to return NULL.
We need to postpone all calls to _dl_update_slotinfo until after
_dl_add_to_slotinfo is complete. This is because _dl_update_slotinfo
will modify the generation of the DTV to match that of the new
slot. We cannot allow this to happen until all slots of the generation
have been added.
2010-01-30 Martin von Gagern
References:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=12453
https://github.com/cschwan/sage-on-gentoo/issues/#issue/40
https://bugs.gentoo.org/353224
Index: glibc-2.12.2/elf/dl-open.c
===================================================================
--- glibc-2.12.2.orig/elf/dl-open.c
+++ glibc-2.12.2/elf/dl-open.c
@@ -346,7 +346,7 @@ dl_open_worker (void *a)
/* If the file is not loaded now as a dependency, add the search
list of the newly loaded object to the scope. */
- bool any_tls = false;
+ bool any_tls = false, any_static_tls = false;
for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
{
struct link_map *imap = new->l_searchlist.r_list[i];
@@ -426,6 +426,25 @@ dl_open_worker (void *a)
_dl_add_to_slotinfo (imap);
if (imap->l_need_tls_init)
+ any_static_tls = true;
+
+ /* We have to bump the generation counter. */
+ any_tls = true;
+ }
+ }
+
+ /* We need a second pass for static tls data, because _dl_update_slotinfo
+ must not be run while calls to _dl_add_to_slotinfo are still pending. */
+ if (__builtin_expect (any_static_tls, 0))
+ {
+ for (unsigned int i = 0; i < new->l_searchlist.r_nlist; ++i)
+ {
+ struct link_map *imap = new->l_searchlist.r_list[i];
+ if (__builtin_expect (imap->l_need_tls_init, 0)
+ /* The following two can likely be dropped, but let's be extra
+ safe and copy all the conditions for now. */
+ && ! imap->l_init_called
+ && __builtin_expect (imap->l_tls_blocksize > 0, 0))
{
/* For static TLS we have to allocate the memory here
and now. This includes allocating memory in the DTV.
@@ -449,9 +468,6 @@ cannot load any more object with static
GL(dl_init_static_tls) (imap);
assert (imap->l_need_tls_init == 0);
}
-
- /* We have to bump the generation counter. */
- any_tls = true;
}
}

View file

@ -1,32 +0,0 @@
--- glibc-2.13/ChangeLog.orig 2011-04-08 05:49:27.201205590 -0300
+++ glibc-2.13/ChangeLog 2011-04-08 05:50:13.815394267 -0300
@@ -0,0 +1,5 @@
+2010-09-28 Andreas Schwab <schwab@redhat.com>
+
+ * elf/rtld.c (dl_main): Move setting of GLRO(dl_init_all_dirs)
+ before performing relro protection.
+
--- glibc-2.13/elf/rtld.c.orig 2011-04-08 05:47:56.573838933 -0300
+++ glibc-2.13/elf/rtld.c 2011-04-08 05:48:53.401068817 -0300
@@ -2187,6 +2187,10 @@ ERROR: ld.so: object '%s' cannot be load
we need it in the memory handling later. */
GLRO(dl_initial_searchlist) = *GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist;
+ /* Remember the last search directory added at startup, now that
+ malloc will no longer be the one from dl-minimal.c. */
+ GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+
if (prelinked)
{
if (main_map->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL)
@@ -2306,10 +2310,6 @@ ERROR: ld.so: object '%s' cannot be load
lossage);
}
- /* Remember the last search directory added at startup, now that
- malloc will no longer be the one from dl-minimal.c. */
- GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
-
if (! prelinked && rtld_multiple_ref)
{
/* There was an explicit ref to the dynamic linker as a shared lib.

View file

@ -0,0 +1,88 @@
--- glibc-2.14-394-g8f3b1ff/misc/tst-error1.c.str_fmt~ 2011-12-10 21:54:40.788761731 +0100
+++ glibc-2.14-394-g8f3b1ff/misc/tst-error1.c 2011-12-10 21:54:42.945752731 +0100
@@ -16,8 +16,8 @@ do_test (int argc, char *argv[])
for (int i = 0; i < 1000; ++i)
memcpy (&buf[i * (sizeof (str) - 1)], str, sizeof (str));
error (0, 0, str);
- error (0, 0, buf);
- error (0, 0, buf);
+ error (0, 0, "%s", buf);
+ error (0, 0, "%s", buf);
error (0, 0, str);
return 0;
}
--- glibc-2.14-394-g8f3b1ff/posix/regexbug1.c.str_fmt~ 2011-12-10 21:53:53.809968992 +0100
+++ glibc-2.14-394-g8f3b1ff/posix/regexbug1.c 2011-12-10 21:53:56.247957690 +0100
@@ -18,7 +18,7 @@ main (void)
{
char buf[100];
regerror (reerr, &re, buf, sizeof buf);
- error (EXIT_FAILURE, 0, buf);
+ error (EXIT_FAILURE, 0, "%s", buf);
}
if (regexec (&re, "002", 2, ma, 0) != 0)
@@ -35,7 +35,7 @@ main (void)
{
char buf[100];
regerror (reerr, &re, buf, sizeof buf);
- error (EXIT_FAILURE, 0, buf);
+ error (EXIT_FAILURE, 0, "%s", buf);
}
if (regexec (&re, "002", 2, ma, 0) != 0)
--- glibc-2.14-394-g8f3b1ff/stdio-common/test-vfprintf.c.str_fmt~ 2011-12-10 21:54:12.799882569 +0100
+++ glibc-2.14-394-g8f3b1ff/stdio-common/test-vfprintf.c 2011-12-10 21:55:02.557672892 +0100
@@ -93,7 +93,7 @@ main (void)
fprintf (fp, "%s", large);
fprintf (fp, "%.*s", 30000, large);
large[20000] = '\0';
- fprintf (fp, large);
+ fprintf (fp, "%s", large);
fprintf (fp, "%-1.300000000s", "hello");
if (fflush (fp) != 0 || ferror (fp) != 0 || fclose (fp) != 0)
--- glibc-2.14-394-g8f3b1ff/sunrpc/rpc_hout.c.str_fmt~ 2011-10-19 13:03:31.000000000 +0200
+++ glibc-2.14-394-g8f3b1ff/sunrpc/rpc_hout.c 2011-12-10 20:44:52.677364034 +0100
@@ -579,7 +579,7 @@ pdeclaration (const char *name, declarat
break;
}
}
- f_print (fout, separator);
+ f_print (fout, "%s", separator);
}
static int
--- glibc-2.14-394-g8f3b1ff/sunrpc/rpc_main.c.str_fmt~ 2011-10-19 13:03:31.000000000 +0200
+++ glibc-2.14-394-g8f3b1ff/sunrpc/rpc_main.c 2011-12-10 20:44:52.683364028 +0100
@@ -651,7 +651,7 @@ h_output (const char *infile, const char
}
else if (tblflag)
{
- fprintf (fout, rpcgen_table_dcl);
+ fprintf (fout, "%s", rpcgen_table_dcl);
}
if (Cflag)
--- glibc-2.14-394-g8f3b1ff/sunrpc/rpc_svcout.c.str_fmt~ 2011-10-19 13:03:31.000000000 +0200
+++ glibc-2.14-394-g8f3b1ff/sunrpc/rpc_svcout.c 2011-12-10 20:44:52.707364008 +0100
@@ -361,7 +361,7 @@ write_real_program (const definition * d
f_print (fout, " (");
/* arg name */
if (proc->arg_num > 1)
- f_print (fout, proc->args.argname);
+ f_print (fout, "%s", proc->args.argname);
else
ptype (proc->args.decls->decl.prefix,
proc->args.decls->decl.type, 0);
--- glibc-2.14-394-g8f3b1ff/sysdeps/unix/sysv/linux/dl-osinfo.h.str_fmt~ 2011-10-19 13:03:31.000000000 +0200
+++ glibc-2.14-394-g8f3b1ff/sysdeps/unix/sysv/linux/dl-osinfo.h 2011-12-10 20:44:52.713364002 +0100
@@ -35,7 +35,7 @@ static void
__attribute__ ((__noreturn__))
dl_fatal (const char *str)
{
- _dl_dprintf (2, str);
+ _dl_dprintf (2, "%s", str);
_exit (1);
}
#endif

View file

@ -0,0 +1,13 @@
--- glibc-2.14-121-g5551a7b/ports/sysdeps/unix/sysv/linux/arm/eabi/Makefile.orig 2011-07-30 19:11:27.590451172 -0300
+++ glibc-2.14-121-g5551a7b/ports/sysdeps/unix/sysv/linux/arm/eabi/Makefile 2011-07-30 19:11:57.813615252 -0300
@@ -33,6 +33,10 @@ ifeq ($(subdir),nscd)
nscd-modules += libc-do-syscall
endif
+ifeq ($(subdir),nss)
+libnss_db-sysdep_routines += libc-do-syscall
+endif
+
ifeq ($(subdir),posix)
LDFLAGS-tst-rfc3484 += $(common-objpfx)csu/libc-do-syscall.o
LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o

View file

@ -0,0 +1,254 @@
--- glibc-2.14-394-g8f3b1ff/ChangeLog.orig 2012-01-30 22:50:24.629092682 -0200
+++ glibc-2.14-394-g8f3b1ff/ChangeLog 2012-01-30 22:50:40.564160817 -0200
@@ -0,0 +1,11 @@
+2012-01-27 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #13618]
+ * elf/dl-open.c (dl_open_worker): Sort objects by dependency before
+ relocation.
+ * Makeconfig (libm): Define.
+ * elf/Makefile: Add rules to build and run tst-relsort1.
+ * elf/tst-relsort1.c: New file.
+ * elf/tst-relsort1mod1.c: New file.
+ * elf/tst-relsort1mod2.c: New file.
+
--- glibc-2.14-394-g8f3b1ff/elf/dl-open.c.orig 2012-01-30 22:47:43.012400604 -0200
+++ glibc-2.14-394-g8f3b1ff/elf/dl-open.c 2012-01-30 22:48:33.076615234 -0200
@@ -1,5 +1,5 @@
/* Load a shared object at runtime, relocate it, and run its initializer.
- Copyright (C) 1996-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009, 2010, 2011, 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
@@ -302,45 +302,109 @@ dl_open_worker (void *a)
if (GLRO(dl_lazy))
reloc_mode |= mode & RTLD_LAZY;
- /* Relocate the objects loaded. We do this in reverse order so that copy
- relocs of earlier objects overwrite the data written by later objects. */
-
+ /* Sort the objects by dependency for the relocation process. This
+ allows IFUNC relocations to work and it also means copy
+ relocation of dependencies are if necessary overwritten. */
+ size_t nmaps = 0;
struct link_map *l = new;
- while (l->l_next)
- l = l->l_next;
- while (1)
+ do
+ {
+ if (! l->l_real->l_relocated)
+ ++nmaps;
+ l = l->l_next;
+ }
+ while (l != NULL);
+ struct link_map *maps[nmaps];
+ nmaps = 0;
+ l = new;
+ do
{
if (! l->l_real->l_relocated)
+ maps[nmaps++] = l;
+ l = l->l_next;
+ }
+ while (l != NULL);
+ if (nmaps > 1)
+ {
+ char seen[nmaps];
+ memset (seen, '\0', nmaps);
+ size_t i = 0;
+ while (1)
{
-#ifdef SHARED
- if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
+ ++seen[i];
+ struct link_map *thisp = maps[i];
+
+ /* Find the last object in the list for which the current one is
+ a dependency and move the current object behind the object
+ with the dependency. */
+ size_t k = nmaps - 1;
+ while (k > i)
{
- /* If this here is the shared object which we want to profile
- make sure the profile is started. We can find out whether
- this is necessary or not by observing the `_dl_profile_map'
- variable. If was NULL but is not NULL afterwars we must
- start the profiling. */
- struct link_map *old_profile_map = GL(dl_profile_map);
-
- _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
-
- if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
- {
- /* We must prepare the profiling. */
- _dl_start_profile ();
-
- /* Prevent unloading the object. */
- GL(dl_profile_map)->l_flags_1 |= DF_1_NODELETE;
- }
+ struct link_map **runp = maps[k]->l_initfini;
+ if (runp != NULL)
+ /* Look through the dependencies of the object. */
+ while (*runp != NULL)
+ if (__builtin_expect (*runp++ == thisp, 0))
+ {
+ /* Move the current object to the back past the last
+ object with it as the dependency. */
+ memmove (&maps[i], &maps[i + 1],
+ (k - i) * sizeof (maps[0]));
+ maps[k] = thisp;
+
+ if (seen[i + 1] > 1)
+ {
+ ++i;
+ goto next_clear;
+ }
+
+ char this_seen = seen[i];
+ memmove (&seen[i], &seen[i + 1],
+ (k - i) * sizeof (seen[0]));
+ seen[k] = this_seen;
+
+ goto next;
+ }
+
+ --k;
}
- else
-#endif
- _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
+
+ if (++i == nmaps)
+ break;
+ next_clear:
+ memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0]));
+ next:;
}
+ }
+
+ for (size_t i = nmaps; i-- > 0; )
+ {
+ l = maps[i];
+
+#ifdef SHARED
+ if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
+ {
+ /* If this here is the shared object which we want to profile
+ make sure the profile is started. We can find out whether
+ this is necessary or not by observing the `_dl_profile_map'
+ variable. If it was NULL but is not NULL afterwars we must
+ start the profiling. */
+ struct link_map *old_profile_map = GL(dl_profile_map);
- if (l == new)
- break;
- l = l->l_prev;
+ _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1);
+
+ if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
+ {
+ /* We must prepare the profiling. */
+ _dl_start_profile ();
+
+ /* Prevent unloading the object. */
+ GL(dl_profile_map)->l_flags_1 |= DF_1_NODELETE;
+ }
+ }
+ else
+#endif
+ _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
}
/* If the file is not loaded now as a dependency, add the search
--- glibc-2.14-394-g8f3b1ff/elf/Makefile.orig 2012-01-30 22:44:52.579668275 -0200
+++ glibc-2.14-394-g8f3b1ff/elf/Makefile 2012-01-30 22:46:06.553986442 -0200
@@ -124,7 +124,8 @@ distribute := rtld-Rules \
tst-initordera1.c tst-initordera2.c tst-initorderb1.c \
tst-initorderb2.c tst-initordera3.c tst-initordera4.c \
tst-initorder.c \
- tst-initorder2.c
+ tst-initorder2.c \
+ tst-relsort1.c tst-relsort1mod1.c tst-relsort1mod2.c
CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
@@ -293,7 +294,9 @@ modules-names = testobj1 testobj2 testob
tst-initordera1 tst-initorderb1 \
tst-initordera2 tst-initorderb2 \
tst-initordera3 tst-initordera4 \
- tst-initorder2a tst-initorder2b tst-initorder2c tst-initorder2d
+ tst-initorder2a tst-initorder2b tst-initorder2c \
+ tst-initorder2d \
+ tst-relsort1mod1 tst-relsort1mod2
ifeq (yes,$(have-initfini-array))
modules-names += tst-array2dep tst-array5dep
endif
@@ -1199,3 +1202,9 @@ CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
endif
+
+$(objpfx)tst-relsort1: $(libdl)
+$(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so
+$(objpfx)tst-relsort1mod2.so: $(libm)
+$(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
+ $(objpfx)tst-relsort1mod2.so
--- glibc-2.14-394-g8f3b1ff/elf/tst-relsort1.c.orig 2012-01-30 22:49:00.915734489 -0200
+++ glibc-2.14-394-g8f3b1ff/elf/tst-relsort1.c 2012-01-30 22:52:48.300706078 -0200
@@ -0,0 +1,19 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+
+static int
+do_test ()
+{
+ const char lib[] = "$ORIGIN/tst-relsort1mod1.so";
+ void *h = dlopen (lib, RTLD_NOW);
+ if (h == NULL)
+ {
+ puts (dlerror ());
+ return 1;
+ }
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--- glibc-2.14-394-g8f3b1ff/elf/tst-relsort1mod1.c.orig 2012-01-30 22:49:08.044765017 -0200
+++ glibc-2.14-394-g8f3b1ff/elf/tst-relsort1mod1.c 2012-01-30 22:53:28.132875824 -0200
@@ -0,0 +1,7 @@
+extern int foo (double);
+
+int
+bar (void)
+{
+ return foo (1.2);
+}
--- glibc-2.14-394-g8f3b1ff/elf/tst-relsort1mod2.c.orig 2012-01-30 22:49:15.796798201 -0200
+++ glibc-2.14-394-g8f3b1ff/elf/tst-relsort1mod2.c 2012-01-30 22:53:55.132990823 -0200
@@ -0,0 +1,7 @@
+#include <math.h>
+
+int
+foo (double d)
+{
+ return floor (d) != 0.0;
+}
--- glibc-2.14-394-g8f3b1ff/Makeconfig.orig 2012-01-30 22:42:15.346009750 -0200
+++ glibc-2.14-394-g8f3b1ff/Makeconfig 2012-01-30 22:42:59.329188451 -0200
@@ -950,6 +950,12 @@ libdl =
endif
endif
+ifeq ($(build-shared),yes)
+libm = $(common-objpfx)math/libm.so$(libm.so-version)
+else
+libm = $(common-objpfx)math/libm.a
+endif
+
# These are the subdirectories containing the library source. The order
# is more or less arbitrary. The sorting step will take care of the
# dependencies.

View file

@ -0,0 +1,23 @@
--- glibc-2.14-121-g5551a7b/ports/sysdeps/unix/sysv/linux/arm/clone.S.orig 2011-11-18 20:28:25.598544826 -0200
+++ glibc-2.14-121-g5551a7b/ports/sysdeps/unix/sysv/linux/arm/clone.S 2011-11-18 20:29:20.812795485 -0200
@@ -81,8 +81,11 @@ ENTRY(__clone)
RETINSTR(, lr)
cfi_startproc
- cfi_undefined (lr)
+PSEUDO_END (__clone)
+
1:
+ .fnstart
+ .cantunwind
#ifdef RESET_PID
tst ip, #CLONE_THREAD
bne 3f
@@ -116,6 +119,6 @@ ENTRY(__clone)
@ and we are done, passing the return value through r0
b PLTJMP(HIDDEN_JUMPTARGET(_exit))
-PSEUDO_END (__clone)
+ .fnend
weak_alias (__clone, clone)

View file

@ -0,0 +1,12 @@
--- glibc-2.14-394-g8f3b1ff/sysdeps/unix/sysv/linux/check_pf.c.ark 2012-01-30 15:03:15.931233972 +0100
+++ glibc-2.14-394-g8f3b1ff/sysdeps/unix/sysv/linux/check_pf.c 2012-01-30 15:03:30.677233711 +0100
@@ -173,7 +173,8 @@ make_request (int fd, pid_t pid, bool *s
}
else
{
- if (!IN6_IS_ADDR_LOOPBACK (address))
+ if (!IN6_IS_ADDR_LOOPBACK (address) &&
+ !IN6_IS_ADDR_LINKLOCAL (address))
*seen_ipv6 = true;
}
}

View file

@ -0,0 +1,11 @@
--- glibc-2.14-121-g5551a7b/scripts/check-local-headers.sh.multiarch-check 2011-07-24 00:57:20.000000000 +0200
+++ glibc-2.14-121-g5551a7b/scripts/check-local-headers.sh 2011-07-24 00:59:27.656891856 +0200
@@ -29,7 +29,7 @@ exec ${AWK} -v includedir="$includedir"
BEGIN {
status = 0
exclude = "^" includedir \
- "/(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|sys/sdt(-config)?\\.h)"
+ "/(asm[-/]|linux/|selinux/|multiarch-|gd|nss3/|sys/capability\\.h|sys/sdt(-config)?\\.h)"
}
/^[^ ]/ && $1 ~ /.*:/ { obj = $1 }
{

View file

@ -0,0 +1,26 @@
--- glibc-2.14-121-g5551a7b/nss/nsswitch.c.nss-upgrade 2011-07-20 02:41:44.000000000 +0200
+++ glibc-2.14-121-g5551a7b/nss/nsswitch.c 2011-07-24 01:06:25.658666115 +0200
@@ -330,9 +330,20 @@ nss_load_library (service_user *ni)
ni->library->lib_handle = __libc_dlopen (shlib_name);
if (ni->library->lib_handle == NULL)
{
- /* Failed to load the library. */
- ni->library->lib_handle = (void *) -1l;
- __set_errno (saved_errno);
+ /* Failed to load the library. Try a fallback. */
+ int n = __snprintf(shlib_name, shlen, "libnss_%s.so.%d.%d",
+ ni->library->name, __GLIBC__, __GLIBC_MINOR__);
+ if (n >= shlen)
+ ni->library->lib_handle = NULL;
+ else
+ ni->library->lib_handle = __libc_dlopen (shlib_name);
+
+ if (ni->library->lib_handle == NULL)
+ {
+ /* Ok, really fail now. */
+ ni->library->lib_handle = (void *) -1l;
+ __set_errno (saved_errno);
+ }
}
else if (is_nscd)
{

View file

@ -0,0 +1,11 @@
--- glibc-2.14-121-g5551a7b/streams/Makefile.fed_streams~ 2011-07-27 15:13:29.702467500 +0000
+++ glibc-2.14-121-g5551a7b/streams/Makefile 2011-07-27 15:13:33.772466409 +0000
@@ -21,7 +21,7 @@
#
subdir := streams
-#headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
+headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
routines = isastream getmsg getpmsg putmsg putpmsg fattach fdetach
include ../Rules

View file

@ -1,26 +0,0 @@
--- glibc-2.2/nss/nsswitch.c.chmou Fri Mar 31 22:38:32 2000
+++ glibc-2.2/nss/nsswitch.c Wed Nov 22 00:35:53 2000
@@ -333,9 +333,20 @@
ni->library->lib_handle = __libc_dlopen (shlib_name);
if (ni->library->lib_handle == NULL)
{
- /* Failed to load the library. */
- ni->library->lib_handle = (void *) -1l;
- __set_errno (saved_errno);
+ /* Failed to load the library. Try a fallback. */
+ int n = __snprintf(shlib_name, shlen, "libnss_%s.so.%d.%d",
+ ni->library->name, __GLIBC__, __GLIBC_MINOR__);
+ if (n >= shlen)
+ ni->library->lib_handle = NULL;
+ else
+ ni->library->lib_handle = __libc_dlopen (shlib_name);
+
+ if (ni->library->lib_handle == NULL)
+ {
+ /* Ok, really fail now. */
+ ni->library->lib_handle = (void *) -1l;
+ __set_errno (saved_errno);
+ }
}
}

View file

@ -1,47 +0,0 @@
--- glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c.tcsetattr-kernel-bug-workaround 2003-02-24 21:26:01.000000000 +0100
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/tcsetattr.c 2003-06-05 11:11:01.000000000 +0200
@@ -56,6 +56,7 @@ tcsetattr (fd, optional_actions, termios
{
struct __kernel_termios k_termios;
unsigned long int cmd;
+ int retval;
switch (optional_actions)
{
@@ -87,6 +88,35 @@ tcsetattr (fd, optional_actions, termios
memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],
__KERNEL_NCCS * sizeof (cc_t));
- return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
+ retval = INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
+
+ if (retval == 0 && cmd == TCSETS)
+ {
+ /* The Linux kernel has a bug which silently ignore the invalid
+ c_cflag on pty. We have to check it here. */
+ int save = errno;
+ retval = INLINE_SYSCALL (ioctl, 3, fd, TCGETS, &k_termios);
+ if (retval)
+ {
+ /* We cannot verify if the setting is ok. We don't return
+ an error (?). */
+ __set_errno (save);
+ retval = 0;
+ }
+ else if ((termios_p->c_cflag & (PARENB | CREAD))
+ != (k_termios.c_cflag & (PARENB | CREAD))
+ || ((termios_p->c_cflag & CSIZE)
+ && ((termios_p->c_cflag & CSIZE)
+ != (k_termios.c_cflag & CSIZE))))
+ {
+ /* It looks like the Linux kernel silently changed the
+ PARENB/CREAD/CSIZE bits in c_cflag. Report it as an
+ error. */
+ __set_errno (EINVAL);
+ retval = -1;
+ }
+ }
+
+ return retval;
}
libc_hidden_def (tcsetattr)

View file

@ -1,13 +1,11 @@
--- glibc-2.3.5/crypt/x86.S.avx 2006-07-06 11:16:18.000000000 -0600
+++ glibc-2.3.5/crypt/x86.S 2006-07-06 11:16:30.000000000 -0600
@@ -32,8 +32,8 @@
--- crypt/x86.S 2011-07-16 11:09:42.000000000 -0400
+++ crypt/x86.S.oden 2011-11-25 04:07:23.574489383 -0500
@@ -42,7 +42,7 @@
#define DO_ALIGN(log) .align (1 << (log))
#endif
-#define BF_FRAME 0x200
-#define BF_CLEAN 0x300
+#define BF_FRAME 0x400
+#define BF_CLEAN 0x500
#define ctx %esp
#define BF_ptr (ctx)

View file

@ -1,14 +0,0 @@
--- glibc-2.3.3/sysdeps/unix/sysv/linux/powerpc/Makefile.ppc-build 2004-04-19 06:18:35.000000000 +0000
+++ glibc-2.3.3/sysdeps/unix/sysv/linux/powerpc/Makefile 2004-11-26 12:50:57.884944570 +0000
@@ -1,4 +1,11 @@
64bit-predefine = __powerpc64__
+
+ifeq ($(config-machine),powerpc)
+ifeq ($(subdir),elf)
+sysdep-others += lddlibc4
+install-bin += lddlibc4
+endif
+endif
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
endif

View file

@ -1,93 +0,0 @@
--- glibc-2.4.90/locale/iso-4217.def.compat-EUR-currencies 2006-04-27 08:54:33.000000000 -0400
+++ glibc-2.4.90/locale/iso-4217.def 2006-05-11 12:00:04.000000000 -0400
@@ -8,6 +8,7 @@
*
* !!! The list has to be sorted !!!
*/
+DEFINE_INT_CURR("ADP") /* Andorran Peseta -> EUR */
DEFINE_INT_CURR("AED") /* United Arab Emirates Dirham */
DEFINE_INT_CURR("AFN") /* Afghanistan Afgani */
DEFINE_INT_CURR("ALL") /* Albanian Lek */
@@ -15,12 +16,14 @@ DEFINE_INT_CURR("AMD") /* Armenia Dram
DEFINE_INT_CURR("ANG") /* Netherlands Antilles */
DEFINE_INT_CURR("AOA") /* Angolan Kwanza */
DEFINE_INT_CURR("ARS") /* Argentine Peso */
+DEFINE_INT_CURR("ATS") /* Austrian Schilling */
DEFINE_INT_CURR("AUD") /* Australian Dollar */
DEFINE_INT_CURR("AWG") /* Aruba Guilder */
DEFINE_INT_CURR("AZM") /* Azerbaijan Manat */
DEFINE_INT_CURR("BAM") /* Bosnian and Herzegovina Convertible Mark */
DEFINE_INT_CURR("BBD") /* Barbados Dollar */
DEFINE_INT_CURR("BDT") /* Bangladesh Taka */
+DEFINE_INT_CURR("BEF") /* Belgian Franc -> EUR */
DEFINE_INT_CURR("BGN") /* Bulgarian Lev */
DEFINE_INT_CURR("BHD") /* Bahraini Dinar */
DEFINE_INT_CURR("BIF") /* Burundi Franc */
@@ -45,6 +48,7 @@ DEFINE_INT_CURR("CUP") /* Cuban Peso *
DEFINE_INT_CURR("CVE") /* Cape Verde Escudo */
DEFINE_INT_CURR("CYP") /* Cypriot Pound */
DEFINE_INT_CURR("CZK") /* Czech Koruna */
+DEFINE_INT_CURR("DEM") /* German Mark -> EUR */
DEFINE_INT_CURR("DJF") /* Djibouti Franc */
DEFINE_INT_CURR("DKK") /* Danish Krone (Faroe Islands, Greenland) */
DEFINE_INT_CURR("DOP") /* Dominican Republic */
@@ -52,16 +56,20 @@ DEFINE_INT_CURR("DZD") /* Algerian Dina
DEFINE_INT_CURR("EEK") /* Estonian Kroon */
DEFINE_INT_CURR("EGP") /* Egyptian Pound */
DEFINE_INT_CURR("ERN") /* Eritrean Nakfa */
+DEFINE_INT_CURR("ESP") /* Spanish Peseta -> EUR */
DEFINE_INT_CURR("ETB") /* Ethiopian Birr */
DEFINE_INT_CURR("EUR") /* European Union Euro */
+DEFINE_INT_CURR("FIM") /* Finnish Markka -> EUR */
DEFINE_INT_CURR("FJD") /* Fiji Dollar */
DEFINE_INT_CURR("FKP") /* Falkland Islands Pound (Malvinas) */
+DEFINE_INT_CURR("FRF") /* French Franc -> EUR */
DEFINE_INT_CURR("GBP") /* British Pound */
DEFINE_INT_CURR("GEL") /* Georgia Lari */
DEFINE_INT_CURR("GHC") /* Ghana Cedi */
DEFINE_INT_CURR("GIP") /* Gibraltar Pound */
DEFINE_INT_CURR("GMD") /* Gambian Dalasi */
DEFINE_INT_CURR("GNF") /* Guinea Franc */
+DEFINE_INT_CURR("GRD") /* Greek Drachma -> EUR */
DEFINE_INT_CURR("GTQ") /* Guatemala Quetzal */
DEFINE_INT_CURR("GYD") /* Guyana Dollar */
DEFINE_INT_CURR("HKD") /* Hong Kong Dollar */
@@ -70,12 +78,14 @@ DEFINE_INT_CURR("HRK") /* Croatia Kuna
DEFINE_INT_CURR("HTG") /* Haiti Gourde */
DEFINE_INT_CURR("HUF") /* Hungarian Forint */
DEFINE_INT_CURR("IDR") /* Indonesia Rupiah */
+DEFINE_INT_CURR("IEP") /* Irish Pound -> EUR */
DEFINE_INT_CURR("ILS") /* Israeli Shekel */
DEFINE_INT_CURR("IMP") /* Isle of Man Pounds */
DEFINE_INT_CURR("INR") /* Indian Rupee (Bhutan) */
DEFINE_INT_CURR("IQD") /* Iraqi Dinar */
DEFINE_INT_CURR("IRR") /* Iranian Rial */
DEFINE_INT_CURR("ISK") /* Iceland Krona */
+DEFINE_INT_CURR("ITL") /* Italian Lira -> EUR */
DEFINE_INT_CURR("JEP") /* Jersey Pound */
DEFINE_INT_CURR("JMD") /* Jamaican Dollar */
DEFINE_INT_CURR("JOD") /* Jordanian Dinar */
@@ -95,6 +105,7 @@ DEFINE_INT_CURR("LKR") /* Sri Lankan Ru
DEFINE_INT_CURR("LRD") /* Liberian Dollar */
DEFINE_INT_CURR("LSL") /* Lesotho Maloti */
DEFINE_INT_CURR("LTL") /* Lithuanian Litas */
+DEFINE_INT_CURR("LUF") /* Luxembourg Franc -> EUR */
DEFINE_INT_CURR("LVL") /* Latvia Lat */
DEFINE_INT_CURR("LYD") /* Libyan Arab Jamahiriya Dinar */
DEFINE_INT_CURR("MAD") /* Moroccan Dirham */
@@ -115,6 +126,7 @@ DEFINE_INT_CURR("MZM") /* Mozambique Me
DEFINE_INT_CURR("NAD") /* Namibia Dollar */
DEFINE_INT_CURR("NGN") /* Nigeria Naira */
DEFINE_INT_CURR("NIO") /* Nicaragua Cordoba Oro */
+DEFINE_INT_CURR("NLG") /* Netherlands Guilder -> EUR */
DEFINE_INT_CURR("NOK") /* Norwegian Krone */
DEFINE_INT_CURR("NPR") /* Nepalese Rupee */
DEFINE_INT_CURR("NZD") /* New Zealand Dollar */
@@ -125,6 +137,7 @@ DEFINE_INT_CURR("PGK") /* Papau New Gui
DEFINE_INT_CURR("PHP") /* Philippines Peso */
DEFINE_INT_CURR("PKR") /* Pakistan Rupee */
DEFINE_INT_CURR("PLN") /* Polish Zloty */
+DEFINE_INT_CURR("PTE") /* Portugese Escudo -> EUR */
DEFINE_INT_CURR("PYG") /* Paraguay Guarani */
DEFINE_INT_CURR("QAR") /* Qatar Rial */
DEFINE_INT_CURR("ROL") /* Romanian Leu */

View file

@ -1,11 +0,0 @@
--- glibc-2.4.90/include/features.h.gcc4-fortify 2006-04-27 08:54:33.000000000 -0400
+++ glibc-2.4.90/include/features.h 2006-05-11 12:22:19.000000000 -0400
@@ -275,7 +275,7 @@
#endif
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+ && __GNUC_PREREQ (4, 0) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# if _FORTIFY_SOURCE > 1
# define __USE_FORTIFY_LEVEL 2
# else

View file

@ -1,16 +0,0 @@
--- glibc-2.6.orig/sysdeps/unix/nice.c 2006-08-15 02:24:45.000000000 -0300
+++ glibc-2.6/sysdeps/unix/nice.c 2007-06-25 14:40:24.000000000 -0300
@@ -42,7 +42,12 @@
__set_errno (save);
}
- result = setpriority (PRIO_PROCESS, 0, prio + incr);
+ prio += incr;
+ if (prio < PRIO_MIN)
+ prio = PRIO_MIN;
+ else if (prio >= PRIO_MAX)
+ prio = PRIO_MAX - 1;
+ result = setpriority (PRIO_PROCESS, 0, prio);
if (result == -1)
{
if (errno == EACCES)

View file

@ -1,78 +1,13 @@
--- crypt/wrapper.c.org 2008-06-17 13:29:30.000000000 -0600
+++ crypt/wrapper.c 2008-06-17 15:33:47.000000000 -0600
@@ -43,6 +43,10 @@ extern char *_crypt_gensalt_extended_rn(
__CONST char *input, int size, char *output, int output_size);
extern char *_crypt_gensalt_md5_rn(unsigned long count,
__CONST char *input, int size, char *output, int output_size);
+extern char *_crypt_gensalt_sha256c_rn(unsigned long count,
+ __CONST char *input, int size, char *output, int output_size);
+extern char *_crypt_gensalt_sha512c_rn(unsigned long count,
+ __CONST char *input, int size, char *output, int output_size);
#if defined(__GLIBC__) && defined(_LIBC)
/* crypt.h from glibc-crypt-2.1 will define struct crypt_data for us */
@@ -54,6 +58,11 @@ extern char *__md5_crypt_r(const char *k
extern char *__des_crypt_r(const char *key, const char *salt,
struct crypt_data *data);
extern struct crypt_data _ufc_foobar;
+/* support for sha256-crypt and sha512-crypt */
+extern char *__sha256_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
+extern char *__sha512_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
#endif
static int _crypt_data_alloc(void **data, int *size, int need)
@@ -142,6 +151,10 @@ char *__crypt_rn(__const char *key, __co
return _crypt_blowfish_rn(key, setting, (char *)data, size);
if (setting[0] == '$' && setting[1] == '1')
return __md5_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '5')
+ return __sha256_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '6')
+ return __sha512_crypt_r(key, setting, (char *)data, size);
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (size < sizeof(struct _crypt_extended_data)) goto out_erange;
@@ -181,6 +194,16 @@ char *__crypt_ra(__const char *key, __co
return NULL;
return __md5_crypt_r(key, setting, (char *)*data, *size);
}
+ if (setting[0] == '$' && setting[1] == '5') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha256_crypt_r(key, setting, (char *)*data, *size);
+ }
+ if (setting[0] == '$' && setting[1] == '6') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha512_crypt_r(key, setting, (char *)*data, *size);
+ }
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (_crypt_data_alloc(data, size,
@@ -271,6 +294,12 @@ char *__crypt_gensalt_rn(__CONST char *p
if (!strncmp(prefix, "$1$", 3))
use = _crypt_gensalt_md5_rn;
else
+ if (!strncmp(prefix, "$5$", 3))
+ use = _crypt_gensalt_sha256c_rn;
+ else
+ if (!strncmp(prefix, "$6$", 3))
+ use = _crypt_gensalt_sha512c_rn;
+ else
if (prefix[0] == '_')
use = _crypt_gensalt_extended_rn;
else
--- crypt/crypt_gensalt.c.org 2008-06-17 13:31:49.000000000 -0600
+++ crypt/crypt_gensalt.c 2008-06-17 15:30:35.000000000 -0600
@@ -109,3 +109,78 @@ char *_crypt_gensalt_md5_rn(unsigned lon
diff -Naurp glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.c glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.c
--- glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.c 2011-07-16 11:06:53.000000000 -0400
+++ glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.c 2011-11-25 04:08:39.264489146 -0500
@@ -122,3 +122,78 @@ char *_crypt_gensalt_md5_rn(const char *
return output;
}
+
+char *_crypt_gensalt_sha256c_rn(unsigned long count,
+ __CONST char *input, int size, char *output, int output_size)
+ const char *input, int size, char *output, int output_size)
+{
+ unsigned long value;
+
@ -110,7 +45,7 @@
+
+
+char *_crypt_gensalt_sha512c_rn(unsigned long count,
+ __CONST char *input, int size, char *output, int output_size)
+ const char *input, int size, char *output, int output_size)
+{
+ unsigned long value;
+
@ -145,3 +80,72 @@
+
+ return output;
+}
diff -Naurp glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.h glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.h
--- glibc-2.14-121-g5551a7b/crypt/crypt_gensalt.h 2011-07-16 10:58:39.000000000 -0400
+++ glibc-2.14-121-g5551a7b.oden/crypt/crypt_gensalt.h 2011-11-25 04:13:34.984489216 -0500
@@ -26,5 +26,8 @@ extern char *_crypt_gensalt_extended_rn(
const char *input, int size, char *output, int output_size);
extern char *_crypt_gensalt_md5_rn(const char *prefix, unsigned long count,
const char *input, int size, char *output, int output_size);
-
+extern char *_crypt_gensalt_sha256c_rn(unsigned long count,
+ const char *input, int size, char *output, int output_size);
+extern char *_crypt_gensalt_sha512c_rn(unsigned long count,
+ const char *input, int size, char *output, int output_size);
#endif
diff -Naurp glibc-2.14-121-g5551a7b/crypt/wrapper.c glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c
--- glibc-2.14-121-g5551a7b/crypt/wrapper.c 2011-11-25 04:08:23.654489356 -0500
+++ glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c 2011-11-25 04:08:39.264489146 -0500
@@ -55,6 +55,11 @@ extern char *__md5_crypt_r(const char *k
extern char *__des_crypt_r(const char *key, const char *salt,
struct crypt_data *data);
extern struct crypt_data _ufc_foobar;
+/* support for sha256-crypt and sha512-crypt */
+extern char *__sha256_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
+extern char *__sha512_crypt_r (const char *key, const char *salt,
+ char *buffer, int buflen);
#endif
static int _crypt_data_alloc(void **data, int *size, int need)
@@ -140,6 +145,10 @@ char *__crypt_rn(__const char *key, __co
return _crypt_blowfish_rn(key, setting, (char *)data, size);
if (setting[0] == '$' && setting[1] == '1')
return __md5_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '5')
+ return __sha256_crypt_r(key, setting, (char *)data, size);
+ if (setting[0] == '$' && setting[1] == '6')
+ return __sha512_crypt_r(key, setting, (char *)data, size);
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (size < sizeof(struct _crypt_extended_data)) goto out_erange;
@@ -179,6 +188,16 @@ char *__crypt_ra(__const char *key, __co
return NULL;
return __md5_crypt_r(key, setting, (char *)*data, *size);
}
+ if (setting[0] == '$' && setting[1] == '5') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha256_crypt_r(key, setting, (char *)*data, *size);
+ }
+ if (setting[0] == '$' && setting[1] == '6') {
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
+ return NULL;
+ return __sha512_crypt_r(key, setting, (char *)*data, *size);
+ }
if (setting[0] == '$') goto out_einval;
if (setting[0] == '_') {
if (_crypt_data_alloc(data, size,
@@ -270,6 +289,12 @@ char *__crypt_gensalt_rn(const char *pre
if (!strncmp(prefix, "$1$", 3))
use = _crypt_gensalt_md5_rn;
else
+ if (!strncmp(prefix, "$5$", 3))
+ use = _crypt_gensalt_sha256c_rn;
+ else
+ if (!strncmp(prefix, "$6$", 3))
+ use = _crypt_gensalt_sha512c_rn;
+ else
if (prefix[0] == '_')
use = _crypt_gensalt_extended_rn;
else

View file

@ -1,6 +1,6 @@
diff -p -up glibc-2.9/crypt/crypt-entry.c.orig glibc-2.9/crypt/crypt-entry.c
--- glibc-2.9/crypt/crypt-entry.c.orig 2009-01-15 10:43:01.000000000 -0500
+++ glibc-2.9/crypt/crypt-entry.c 2009-01-15 10:43:18.000000000 -0500
diff -Naurp glibc-2.14-121-g5551a7b/crypt/crypt-entry.c glibc-2.14-121-g5551a7b.oden/crypt/crypt-entry.c
--- glibc-2.14-121-g5551a7b/crypt/crypt-entry.c 2011-11-25 05:00:43.214487962 -0500
+++ glibc-2.14-121-g5551a7b.oden/crypt/crypt-entry.c 2011-11-25 05:04:42.044487854 -0500
@@ -164,18 +164,3 @@ crypt (key, salt)
#endif
@ -20,14 +20,16 @@ diff -p -up glibc-2.9/crypt/crypt-entry.c.orig glibc-2.9/crypt/crypt-entry.c
- return crypt (key, salt);
-}
-#endif
diff -p -up glibc-2.9/crypt/wrapper.c.orig glibc-2.9/crypt/wrapper.c
--- glibc-2.9/crypt/wrapper.c.orig 2009-01-15 10:43:01.000000000 -0500
+++ glibc-2.9/crypt/wrapper.c 2009-01-15 10:43:18.000000000 -0500
@@ -326,7 +326,22 @@ weak_alias(__crypt_gensalt_rn, crypt_gen
diff -Naurp glibc-2.14-121-g5551a7b/crypt/wrapper.c glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c
--- glibc-2.14-121-g5551a7b/crypt/wrapper.c 2011-11-25 05:00:43.224487962 -0500
+++ glibc-2.14-121-g5551a7b.oden/crypt/wrapper.c 2011-11-25 05:05:14.264487791 -0500
@@ -324,7 +324,22 @@ weak_alias(__crypt, crypt)
weak_alias(__crypt_gensalt_rn, crypt_gensalt_rn)
weak_alias(__crypt_gensalt_ra, crypt_gensalt_ra)
weak_alias(__crypt_gensalt, crypt_gensalt)
#endif
-
-weak_alias(crypt, fcrypt)
+#endif
+
+/*
+ * To make fcrypt users happy.
+ * They don't need to call init_des.
@ -37,13 +39,11 @@ diff -p -up glibc-2.9/crypt/wrapper.c.orig glibc-2.9/crypt/wrapper.c
+#else
+char *
+__fcrypt (key, salt)
+ const char *key;
+ const char *salt;
+ const char *key;
+ const char *salt;
+{
+ return crypt (key, salt);
+}
+#endif
+
#endif
#ifdef TEST
static struct {
char *hash;

View file

@ -1,40 +0,0 @@
diff -p -up glibc-2.9/elf/ldd.bash.in.orig glibc-2.9/elf/ldd.bash.in
--- glibc-2.9/elf/ldd.bash.in.orig 2008-01-02 14:25:22.000000000 -0500
+++ glibc-2.9/elf/ldd.bash.in 2009-01-15 07:47:41.000000000 -0500
@@ -31,6 +31,7 @@ RTLDLIST=@RTLD@
warn=
bind_now=
verbose=
+file_magic_regex="ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib)"
while test $# -gt 0; do
case "$1" in
@@ -151,8 +152,11 @@ for file do
echo "ldd: ${file}:" $"not regular file" >&2
result=1
elif test -r "$file"; then
+ if eval file -L "$file" 2>/dev/null \
+ | sed 10q | egrep -v "$file_magic_regex" > /dev/null; then
test -x "$file" || echo 'ldd:' $"\
warning: you do not have execution permission for" "\`$file'" >&2
+ fi
RTLD=
ret=1
for rtld in ${RTLDLIST}; do
@@ -169,8 +173,14 @@ warning: you do not have execution permi
# If the program exits with exit code 5, it means the process has been
# invoked with __libc_enable_secure. Fall back to running it through
# the dynamic linker.
- try_trace "$file"
- rc=$?
+ if [ ! -x "$file" ] && eval file -L "$file" 2>/dev/null \
+ | sed 10q | egrep "$file_magic_regex" > /dev/null; then
+ try_trace "$RTLD" "$file"
+ rc=$?
+ else
+ try_trace "$file"
+ rc=$?
+ fi
if [ $rc = 5 ]; then
try_trace "$RTLD" "$file"
rc=$?

146
glibc-arenalock.patch Normal file
View file

@ -0,0 +1,146 @@
commit 77cdc054e02069d72dcf54a9ad7d7df3a24bcb01
Author: Andreas Schwab <schwab@redhat.com>
Date: Wed Nov 9 17:14:39 2011 +0100
Check malloc arana limit atomically
diff --git a/ChangeLog b/ChangeLog
index bf09161..edd7dd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-11-14 Andreas Schwab <schwab@redhat.com>
+
+ * malloc/arena.c (arena_get2): Don't call reused_arena when
+ _int_new_arena failed.
+
+2011-11-10 Andreas Schwab <schwab@redhat.com>
+
+ * malloc/arena.c (_int_new_arena): Don't increment narenas.
+ (reused_arena): Don't check arena limit.
+ (arena_get2): Atomically check arena limit.
+
2011-10-19 Andreas Schwab <schwab@redhat.com>
* sysdeps/x86_64/fpu/math_private.h (libc_feupdateenv): Use
diff --git a/malloc/arena.c b/malloc/arena.c
index 9114fd2..042cac8 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -747,8 +747,6 @@ _int_new_arena(size_t size)
main_arena.next = a;
#ifdef PER_THREAD
- ++narenas;
-
(void)mutex_unlock(&list_lock);
#endif
@@ -786,30 +784,6 @@ get_free_list (void)
static mstate
reused_arena (void)
{
- if (narenas <= mp_.arena_test)
- return NULL;
-
- static int narenas_limit;
- if (narenas_limit == 0)
- {
- if (mp_.arena_max != 0)
- narenas_limit = mp_.arena_max;
- else
- {
- int n = __get_nprocs ();
-
- if (n >= 1)
- narenas_limit = NARENAS_FROM_NCORES (n);
- else
- /* We have no information about the system. Assume two
- cores. */
- narenas_limit = NARENAS_FROM_NCORES (2);
- }
- }
-
- if (narenas < narenas_limit)
- return NULL;
-
mstate result;
static mstate next_to_use;
if (next_to_use == NULL)
@@ -844,10 +818,41 @@ arena_get2(mstate a_tsd, size_t size)
mstate a;
#ifdef PER_THREAD
- if ((a = get_free_list ()) == NULL
- && (a = reused_arena ()) == NULL)
- /* Nothing immediately available, so generate a new arena. */
- a = _int_new_arena(size);
+ static size_t narenas_limit;
+
+ a = get_free_list ();
+ if (a == NULL)
+ {
+ /* Nothing immediately available, so generate a new arena. */
+ if (narenas_limit == 0)
+ {
+ if (mp_.arena_max != 0)
+ narenas_limit = mp_.arena_max;
+ else
+ {
+ int n = __get_nprocs ();
+
+ if (n >= 1)
+ narenas_limit = NARENAS_FROM_NCORES (n);
+ else
+ /* We have no information about the system. Assume two
+ cores. */
+ narenas_limit = NARENAS_FROM_NCORES (2);
+ }
+ }
+ repeat:;
+ size_t n = narenas;
+ if (__builtin_expect (n <= mp_.arena_test || n < narenas_limit, 0))
+ {
+ if (catomic_compare_and_exchange_bool_acq(&narenas, n + 1, n))
+ goto repeat;
+ a = _int_new_arena (size);
+ if (__builtin_expect (a != NULL, 1))
+ return a;
+ catomic_decrement(&narenas);
+ }
+ a = reused_arena ();
+ }
#else
if(!a_tsd)
a = a_tsd = &main_arena;
commit a5fb313cb7b7e692fd4684916aaa98e03ec7e8b6
Author: Andreas Schwab <schwab@redhat.com>
Date: Mon Nov 14 11:41:52 2011 +0100
Don't call reused_arena when _int_new_arena failed
diff --git a/malloc/arena.c b/malloc/arena.c
index 042cac8..cb8548b 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -844,14 +844,14 @@ arena_get2(mstate a_tsd, size_t size)
size_t n = narenas;
if (__builtin_expect (n <= mp_.arena_test || n < narenas_limit, 0))
{
- if (catomic_compare_and_exchange_bool_acq(&narenas, n + 1, n))
+ if (catomic_compare_and_exchange_bool_acq (&narenas, n + 1, n))
goto repeat;
a = _int_new_arena (size);
- if (__builtin_expect (a != NULL, 1))
- return a;
- catomic_decrement(&narenas);
+ if (__builtin_expect (a == NULL, 0))
+ catomic_decrement (&narenas);
}
- a = reused_arena ();
+ else
+ a = reused_arena ();
}
#else
if(!a_tsd)

0
glibc-check.sh Executable file → Normal file
View file

4533
glibc-fedora.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,140 +0,0 @@
#!/bin/bash
#
# Auto-generate requirements for executables (both ELF and a.out) and library
# sonames, script interpreters, and perl modules.
#
ulimit -c 0
#
# --- Set needed to 0 for traditional find-requires behavior.
needed=0
if [ X"$1" = Xldd ]; then
needed=0
elif [ X"$1" = Xobjdump ]; then
needed=1
fi
#
# --- Mandrake Linux specific part
#
# --- Grab the file manifest and classify files.
filelist=`sed "s/['\"]/\\\&/g"`
exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \
grep ":.*executable" | cut -d: -f1`
scriptlist=`echo $filelist | grep -v /usr/doc | grep -v /usr/share/doc | xargs -r file | \
egrep ":.* (commands|script) " | cut -d: -f1`
liblist=`echo $filelist | xargs -r file | \
grep ":.*shared object" | cut -d : -f1`
interplist=
perllist=
pythonlist=
tcllist=
#
# --- Alpha does not mark 64bit dependencies
case `uname -m` in
alpha*) mark64="" ;;
*) mark64="()(64bit)" ;;
esac
if [ "$needed" -eq 0 ]; then
#
# --- Executable dependency sonames.
for f in $exelist; do
[ -r $f -a -x $f ] || continue
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
ldd $f | awk '/=>/ {
if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
}'
done | xargs -r -n 1 basename | sort -u | grep -v 'libsafe|libfakeroot'
#
# --- Library dependency sonames.
for f in $liblist; do
[ -r $f ] || continue
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
ldd $f | awk '/=>/ {
if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
}'
done | xargs -r -n 1 basename | sort -u | grep -v 'libsafe|libfakeroot'
fi
#
# --- Perl or python deps
#
# --- Script interpreters.
for f in $scriptlist; do
[ -r $f -a -x $f ] || continue
interp=`head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
interplist="$interplist $interp"
case $interp in
*/perl) perllist="$perllist $f" ;;
esac
done
if [ -n "$interplist" ]; then
for i in `echo "$interplist" | tr '[:blank:]' \\\n | sort -u`; do
if ! rpm -qf $i --qf '%{NAME}\n' 2>/dev/null; then
echo $i
fi
done | sort -u | grep -v 'libsafe|libfakeroot'
fi
#
# --- Add perl module files to perllist.
for f in $filelist; do
[ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f"
done
#
# --- Weak symbol versions (from glibc).
[ -n "$mark64" ] && mark64="(64bit)"
for f in $liblist $exelist ; do
[ -r $f ] || continue
lib64=`if file -L $f 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
objdump -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
/^$/ { START=0; }
/^Dynamic Section:$/ { START=1; }
(START==1) && /NEEDED/ {
if (needed) { print $2 ; }
}
/^Version References:$/ { START=2; }
(START==2) && /required from/ {
sub(/:/, "", $3);
LIBNAME=$3;
}
(START==2) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
print LIBNAME "(" $4 ")'$lib64'";
}
'
done | sort -u | grep -v 'libsafe|libfakeroot'
#
# --- Perl modules.
#[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
# echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u
#
# --- Python modules.
[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.req | sort -u
#
# --- Tcl modules.
[ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \
echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.req | sort -u
exit 0

1660
glibc-localegrouping.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,49 @@
From 7327af4c323f6d4f500bf4aaa66a9cac6236772f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 26 Oct 2011 20:08:52 +0200
Subject: [PATCH] Revert "Use leaf function attribute in __THROW"
This reverts commit aa78043a4aafe5db1a1a76d544a833b63b4c5f5c
and the related 49a43d80ec5c97cf6136b1ee2687414773b2d5aa.
This fixes http://bugzilla.redhat.com/747377
---
misc/sys/cdefs.h | 15 +++------------
2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 72073e8..165a94a 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -38,27 +38,18 @@
#ifdef __GNUC__
-/* All functions, except those with callbacks, are leaf functions. */
-# if __GNUC_PREREQ (4, 6) && !defined _LIBC
-# define __LEAF , __leaf__
-# define __LEAF_ATTR __attribute__ ((__leaf__))
-# else
-# define __LEAF
-# define __LEAF_ATTR
-# endif
-
/* GCC can always grok prototypes. For C++ programs we add throw()
to help it optimize the function calls. But this works only with
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
as non-throwing using a function attribute since programs can use
the -fexceptions options for C code as well. */
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
-# define __THROW __attribute__ ((__nothrow__ __LEAF))
-# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
# else
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
-# define __NTH(fct) __LEAF_ATTR fct throw ()
+# define __NTH(fct) fct throw ()
# else
# define __THROW
# define __NTH(fct) fct
--
1.7.7.1

View file

@ -1,141 +0,0 @@
/* Portions derived from Fedora Core glibc_post_upgrade.c */
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>
#define verbose_exec(failcode, path...) \
do \
{ \
char *const arr[] = { path, NULL }; \
vexec (failcode, arr); \
} while (0)
__attribute__((noinline)) void vexec (int failcode, char *const path[]);
__attribute__((noinline)) void says (const char *str);
__attribute__((noinline)) void sayn (long num);
__attribute__((noinline)) void message (char *const path[]);
int main(int argc, char *argv[])
{
static const char *libs[] = {
"libc.so.6",
"libm.so.6",
"libpthread.so.0",
"librt.so.1",
"libthread_db.so.1"
};
static const char *dirs[] = {
SLIBDIR "/tls"
};
int i, j, ret;
/* Remove obsolete libraries. */
for (i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) {
for (j = 0; j < sizeof(libs) / sizeof(libs[0]); j++) {
char path[PATH_MAX], temp_path[PATH_MAX];
ret = snprintf(path, sizeof(path), "%s/%s", dirs[i], libs[j]);
if (ret < 0 || ret >= sizeof(path))
continue;
if ((ret = readlink(path, temp_path, sizeof(temp_path) - 1)) != -1) {
char resolved_path[PATH_MAX];
temp_path[ret] = '\0';
if (temp_path[0] == '/')
strcpy(resolved_path, temp_path);
else
ret = snprintf(resolved_path, sizeof(resolved_path), "%s/%s", dirs[i], temp_path);
if (ret > 0 && ret < sizeof(resolved_path))
unlink(resolved_path);
}
unlink(path);
}
}
/* Update ld.so.cache only. */
if (access("/sbin/ldconfig", X_OK) == 0)
verbose_exec(110, "/sbin/ldconfig", "/sbin/ldconfig", "-X");
/* Delegate to ash for normal %post execution. */
argv[0] = ASH_BIN;
execv(ASH_BIN, argv);
return 0;
}
void
vexec (int failcode, char *const path[])
{
pid_t pid;
int status, save_errno;
pid = vfork ();
if (pid == 0)
{
execv (path[0], path + 1);
save_errno = errno;
message (path);
says (" exec failed with errno ");
sayn (save_errno);
says ("\n");
_exit (failcode);
}
else if (pid < 0)
{
save_errno = errno;
message (path);
says (" fork failed with errno ");
sayn (save_errno);
says ("\n");
_exit (failcode + 1);
}
if (waitpid (0, &status, 0) != pid || !WIFEXITED (status))
{
message (path);
says (" child terminated abnormally\n");
_exit (failcode + 2);
}
if (WEXITSTATUS (status))
{
message (path);
says (" child exited with exit code ");
sayn (WEXITSTATUS (status));
says ("\n");
_exit (WEXITSTATUS (status));
}
}
void
says (const char *str)
{
write (1, str, strlen (str));
}
void
sayn (long num)
{
char string[sizeof (long) * 3 + 1];
char *p = string + sizeof (string) - 1;
*p = '\0';
if (num == 0)
*--p = '0';
else
while (num)
{
*--p = '0' + num % 10;
num = num / 10;
}
says (p);
}
void
message (char *const path[])
{
says ("/usr/sbin/glibc_post_upgrade: While trying to execute ");
says (path[0]);
}

35
glibc-rh750858.patch Normal file
View file

@ -0,0 +1,35 @@
commit 3d7ba52b68e4dc5c4d3eb19de436c66ed9bb2f0d
Author: Andreas Schwab <schwab@redhat.com>
Date: Thu Nov 3 14:26:38 2011 +0100
Don't fail in makedb if SELinux is disabled
*** a/ChangeLog Wed Nov 30 12:38:59 2011
--- b/ChangeLog Wed Nov 30 12:39:17 2011
***************
*** 9,14 ****
--- 9,19 ----
(reused_arena): Don't check arena limit.
(arena_get2): Atomically check arena limit.
+ 2011-11-03 Andreas Schwab <schwab@redhat.com>
+
+ * nss/makedb.c (set_file_creation_context): Do nothing if SELinux
+ is disabled.
+
2011-10-19 Andreas Schwab <schwab@redhat.com>
* sysdeps/x86_64/fpu/math_private.h (libc_feupdateenv): Use
diff --git a/nss/makedb.c b/nss/makedb.c
index 8cee92f..1b19966 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -842,7 +842,7 @@ set_file_creation_context (const char *outname, mode_t mode)
/* Check if SELinux is enabled, and remember. */
if (enabled == 0)
- enabled = is_selinux_enabled ();
+ enabled = is_selinux_enabled () ? 1 : -1;
if (enabled < 0)
return;

170
glibc-rh757881.patch Normal file
View file

@ -0,0 +1,170 @@
Index: glibc-2.12-2-gc4ccff1/malloc/arena.c
===================================================================
--- glibc-2.12-2-gc4ccff1.orig/malloc/arena.c
+++ glibc-2.12-2-gc4ccff1/malloc/arena.c
@@ -870,7 +870,7 @@ heap_trim(heap, pad) heap_info *heap; si
heap = prev_heap;
if(!prev_inuse(p)) { /* consolidate backward */
p = prev_chunk(p);
- unlink(p, bck, fwd);
+ unlink(ar_ptr, p, bck, fwd);
}
assert(((unsigned long)((char*)p + new_size) & (pagesz-1)) == 0);
assert( ((char*)p + new_size) == ((char*)heap + heap->size) );
Index: glibc-2.12-2-gc4ccff1/malloc/hooks.c
===================================================================
--- glibc-2.12-2-gc4ccff1.orig/malloc/hooks.c
+++ glibc-2.12-2-gc4ccff1/malloc/hooks.c
@@ -219,7 +219,9 @@ top_check()
(char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem)))
return 0;
+ mutex_unlock(&main_arena);
malloc_printerr (check_action, "malloc: top chunk is corrupt", t);
+ mutex_lock(&main_arena);
/* Try to set up a new top chunk. */
brk = MORECORE(0);
Index: glibc-2.12-2-gc4ccff1/malloc/malloc.c
===================================================================
--- glibc-2.12-2-gc4ccff1.orig/malloc/malloc.c
+++ glibc-2.12-2-gc4ccff1/malloc/malloc.c
@@ -1541,12 +1541,14 @@
#define last(b) ((b)->bk)
/* Take a chunk off a bin list */
-#define unlink(P, BK, FD) { \
+#define unlink(AV, P, BK, FD) { \
FD = P->fd; \
BK = P->bk; \
- if (__builtin_expect (FD->bk != P || BK->fd != P, 0)) \
+ if (__builtin_expect (FD->bk != P || BK->fd != P, 0)) { \
+ mutex_unlock(&(AV)->mutex); \
malloc_printerr (check_action, "corrupted double-linked list", P); \
- else { \
+ mutex_lock(&(AV)->mutex); \
+ } else { \
FD->bk = BK; \
BK->fd = FD; \
if (!in_smallbin_range (P->size) \
@@ -2593,7 +2595,9 @@
else if (contiguous(av) && old_size && brk < old_end) {
/* Oops! Someone else killed our space.. Can't touch anything. */
+ mutex_unlock(&av->mutex);
malloc_printerr (3, "break adjusted to free malloc space", brk);
+ mutex_lock(&av->mutex);
}
/*
@@ -3467,7 +3471,9 @@
{
errstr = "malloc(): memory corruption (fast)";
errout:
+ mutex_unlock(&av->mutex);
malloc_printerr (check_action, errstr, chunk2mem (victim));
+ mutex_lock(&av->mutex);
return NULL;
}
check_remalloced_chunk(av, victim, nb);
@@ -3552,8 +3558,12 @@
bck = victim->bk;
if (__builtin_expect (victim->size <= 2 * SIZE_SZ, 0)
|| __builtin_expect (victim->size > av->system_mem, 0))
- malloc_printerr (check_action, "malloc(): memory corruption",
- chunk2mem (victim));
+ {
+ void *p = chunk2mem(victim);
+ mutex_unlock(&av->mutex);
+ malloc_printerr (check_action, "malloc(): memory corruption", p);
+ mutex_lock(&av->mutex);
+ }
size = chunksize(victim);
/*
@@ -3694,7 +3704,7 @@
victim = victim->fd;
remainder_size = size - nb;
- unlink(victim, bck, fwd);
+ unlink(av, victim, bck, fwd);
/* Exhaust */
if (remainder_size < MINSIZE) {
@@ -3792,7 +3802,7 @@
remainder_size = size - nb;
/* unlink */
- unlink(victim, bck, fwd);
+ unlink(av, victim, bck, fwd);
/* Exhaust */
if (remainder_size < MINSIZE) {
@@ -3927,9 +3937,11 @@
{
errstr = "free(): invalid pointer";
errout:
- if (! have_lock && locked)
+ if (have_lock || locked)
(void)mutex_unlock(&av->mutex);
malloc_printerr (check_action, errstr, chunk2mem(p));
+ if (have_lock)
+ mutex_lock(&av->mutex);
return;
}
/* We know that each chunk is at least MINSIZE bytes in size. */
@@ -4073,7 +4085,7 @@
prevsize = p->prev_size;
size += prevsize;
p = chunk_at_offset(p, -((long) prevsize));
- unlink(p, bck, fwd);
+ unlink(av, p, bck, fwd);
}
if (nextchunk != av->top) {
@@ -4082,7 +4094,7 @@
/* consolidate forward */
if (!nextinuse) {
- unlink(nextchunk, bck, fwd);
+ unlink(av, nextchunk, bck, fwd);
size += nextsize;
} else
clear_inuse_bit_at_offset(nextchunk, 0);
@@ -4243,7 +4255,7 @@
prevsize = p->prev_size;
size += prevsize;
p = chunk_at_offset(p, -((long) prevsize));
- unlink(p, bck, fwd);
+ unlink(av, p, bck, fwd);
}
if (nextchunk != av->top) {
@@ -4251,7 +4263,7 @@
if (!nextinuse) {
size += nextsize;
- unlink(nextchunk, bck, fwd);
+ unlink(av, nextchunk, bck, fwd);
} else
clear_inuse_bit_at_offset(nextchunk, 0);
@@ -4320,7 +4332,9 @@
{
errstr = "realloc(): invalid old size";
errout:
+ mutex_unlock(&av->mutex);
malloc_printerr (check_action, errstr, chunk2mem(oldp));
+ mutex_lock(&av->mutex);
return NULL;
}
@@ -4362,7 +4376,7 @@
(unsigned long)(newsize = oldsize + nextsize) >=
(unsigned long)(nb)) {
newp = oldp;
- unlink(next, bck, fwd);
+ unlink(av, next, bck, fwd);
}
/* allocate, copy, free */

242
glibc-rh757887.patch Normal file
View file

@ -0,0 +1,242 @@
commit f3a6cc0a560a17f32a3e90d2f20501a53cab6058
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue Nov 29 10:52:22 2011 +0100
Fix access after end of search string in regex matcher
--- a/ChangeLog 2011-11-30 12:43:22.312632113 -0700
+++ b/ChangeLog 2011-11-30 12:43:50.569624022 -0700
@@ -1,3 +1,14 @@
+2011-11-29 Andreas Schwab <schwab@redhat.com>
+
+ * locale/weight.h (findidx): Add parameter len.
+ * locale/weightwc.h (findidx): Likewise.
+ * posix/fnmatch_loop.c (FCT): Adjust caller.
+ * posix/regcomp.c (build_equiv_class): Likewise.
+ * posix/regex_internal.h (re_string_elem_size_at): Likewise.
+ * posix/regexec.c (check_node_accept_bytes): Likewise.
+ * string/strcoll_l.c (STRCOLL): Likewise.
+ * string/strxfrm_l.c (STRXFRM): Likewise.
+
2011-11-14 Andreas Schwab <schwab@redhat.com>
* malloc/arena.c (arena_get2): Don't call reused_arena when
diff --git a/locale/weight.h b/locale/weight.h
index dc70a00..967e176 100644
--- a/locale/weight.h
+++ b/locale/weight.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2003,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2003,2004,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper, <drepper@cygnus.com>.
@@ -20,7 +20,7 @@
/* Find index of weight. */
auto inline int32_t
__attribute ((always_inline))
-findidx (const unsigned char **cpp)
+findidx (const unsigned char **cpp, size_t len)
{
int_fast32_t i = table[*(*cpp)++];
const unsigned char *cp;
@@ -34,6 +34,7 @@ findidx (const unsigned char **cpp)
Search for the correct one. */
cp = &extra[-i];
usrc = *cpp;
+ --len;
while (1)
{
size_t nhere;
@@ -56,7 +57,7 @@ findidx (const unsigned char **cpp)
already. */
size_t cnt;
- for (cnt = 0; cnt < nhere; ++cnt)
+ for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
@@ -79,13 +80,13 @@ findidx (const unsigned char **cpp)
size_t cnt;
size_t offset = 0;
- for (cnt = 0; cnt < nhere; ++cnt)
+ for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
if (cnt != nhere)
{
- if (cp[cnt] > usrc[cnt])
+ if (cnt == len || cp[cnt] > usrc[cnt])
{
/* Cannot be in this range. */
cp += 2 * nhere;
diff --git a/locale/weightwc.h b/locale/weightwc.h
index 9ea1126..7862091 100644
--- a/locale/weightwc.h
+++ b/locale/weightwc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2001,2003,2004,2005,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001,2003,2004,2005,2007,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper, <drepper@cygnus.com>.
@@ -20,7 +20,7 @@
/* Find index of weight. */
auto inline int32_t
__attribute ((always_inline))
-findidx (const wint_t **cpp)
+findidx (const wint_t **cpp, size_t len)
{
wint_t ch = *(*cpp)++;
int32_t i = __collidx_table_lookup ((const char *) table, ch);
@@ -32,6 +32,7 @@ findidx (const wint_t **cpp)
/* Oh well, more than one sequence starting with this byte.
Search for the correct one. */
const int32_t *cp = (const int32_t *) &extra[-i];
+ --len;
while (1)
{
size_t nhere;
@@ -54,7 +55,7 @@ findidx (const wint_t **cpp)
already. */
size_t cnt;
- for (cnt = 0; cnt < nhere; ++cnt)
+ for (cnt = 0; cnt < nhere && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
@@ -75,7 +76,7 @@ findidx (const wint_t **cpp)
size_t cnt;
size_t offset;
- for (cnt = 0; cnt < nhere - 1; ++cnt)
+ for (cnt = 0; cnt < nhere - 1 && cnt < len; ++cnt)
if (cp[cnt] != usrc[cnt])
break;
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
index 18a6667..72bd3ee 100644
--- a/posix/fnmatch_loop.c
+++ b/posix/fnmatch_loop.c
@@ -412,7 +412,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
# endif
- idx = findidx (&cp);
+ idx = findidx (&cp, 1);
if (idx != 0)
{
/* We found a table entry. Now see whether the
@@ -422,7 +422,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
int32_t idx2;
const UCHAR *np = (const UCHAR *) n;
- idx2 = findidx (&np);
+ idx2 = findidx (&np, string_end - n);
if (idx2 != 0
&& (idx >> 24) == (idx2 >> 24)
&& len == weights[idx2 & 0xffffff])
diff --git a/posix/regcomp.c b/posix/regcomp.c
index b238c08..34ee845 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -1,5 +1,5 @@
/* Extended regular expression matching and search library.
- Copyright (C) 2002-2007,2009,2010 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -3409,19 +3409,18 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
_NL_COLLATE_EXTRAMB);
indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
_NL_COLLATE_INDIRECTMB);
- idx1 = findidx (&cp);
- if (BE (idx1 == 0 || cp < name + strlen ((const char *) name), 0))
+ idx1 = findidx (&cp, -1);
+ if (BE (idx1 == 0 || *cp != '\0', 0))
/* This isn't a valid character. */
return REG_ECOLLATE;
/* Build single byte matcing table for this equivalence class. */
- char_buf[1] = (unsigned char) '\0';
len = weights[idx1 & 0xffffff];
for (ch = 0; ch < SBC_MAX; ++ch)
{
char_buf[0] = ch;
cp = char_buf;
- idx2 = findidx (&cp);
+ idx2 = findidx (&cp, 1);
/*
idx2 = table[ch];
*/
--- a/posix/regex_internal.h 2011-11-30 12:47:02.706567482 -0700
+++ a/posix/regex_internal.h 2011-11-30 12:47:32.969558337 -0700
@@ -756,7 +756,7 @@
indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
_NL_COLLATE_INDIRECTMB);
p = pstr->mbs + idx;
- tmp = findidx (&p);
+ tmp = findidx (&p, pstr->len - idx);
return p - pstr->mbs - idx;
}
else
diff --git a/posix/regexec.c b/posix/regexec.c
index 9e0c565..3ea810b 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -3924,7 +3924,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
indirect = (const int32_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
- int32_t idx = findidx (&cp);
+ int32_t idx = findidx (&cp, elem_len);
if (idx > 0)
for (i = 0; i < cset->nequiv_classes; ++i)
{
diff --git a/string/strcoll_l.c b/string/strcoll_l.c
index d8d1139..fb77d08 100644
--- a/string/strcoll_l.c
+++ b/string/strcoll_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1997,2002,2004,2007,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,2002,2004,2007,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
@@ -205,7 +205,7 @@ STRCOLL (s1, s2, l)
while (*us1 != L('\0'))
{
- int32_t tmp = findidx (&us1);
+ int32_t tmp = findidx (&us1, -1);
rule1arr[idx1max] = tmp >> 24;
idx1arr[idx1max] = tmp & 0xffffff;
idx1cnt = idx1max++;
@@ -267,7 +267,7 @@ STRCOLL (s1, s2, l)
while (*us2 != L('\0'))
{
- int32_t tmp = findidx (&us2);
+ int32_t tmp = findidx (&us2, -1);
rule2arr[idx2max] = tmp >> 24;
idx2arr[idx2max] = tmp & 0xffffff;
idx2cnt = idx2max++;
diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
index 220253c..b06556d 100644
--- a/string/strxfrm_l.c
+++ b/string/strxfrm_l.c
@@ -176,7 +176,7 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
idxmax = 0;
do
{
- int32_t tmp = findidx (&usrc);
+ int32_t tmp = findidx (&usrc, -1);
rulearr[idxmax] = tmp >> 24;
idxarr[idxmax] = tmp & 0xffffff;

2068
glibc.spec

File diff suppressed because it is too large Load diff

View file

@ -1,27 +0,0 @@
Description: unset CALL_MCOUNT for __libc_do_syscall
unset CALL_MCOUNT before __libc_do_syscall, because it only supports Thumb-2
and ARM mode, not Thumb-1; and because profiling this internal routine
is of dubious value.
Origin: https://bugs.launchpad.net/linaro-toolchain-misc/+bug/605030/+attachment/1484534/+files/libc-do-syscall.S
Author: Peter Pearse <peter.pearse@linaro.org>
Bug-Linaro: https://bugs.launchpad.net/linaro-toolchain-misc/+bug/605030
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/605030
Reviewed-by: Steve Langasek <steve.langasek@linaro.org>
Index: glibc-2.12.1/ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
===================================================================
--- glibc-2.12.1.orig/ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
+++ glibc-2.12.1/ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S
@@ -29,6 +29,12 @@
.syntax unified
.hidden __libc_do_syscall
+/*
+ * PMP Work round for https://bugs.launchpad.net/gcc-linaro/+bug/605030
+ */
+#undef CALL_MCOUNT
+#define CALL_MCOUNT
+
ENTRY (__libc_do_syscall)
.fnstart
push {r7, lr}