From 0081efc5dac12798c5720c2e3cce7cd839ceb5aa13ad49c2122b3582909703cb Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 29 Nov 2013 15:22:35 +0000 Subject: [PATCH] Accepting request 208666 from Base:System - Update to glibc 2.18.90 bd12ab55c05e: * New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW, pap_CW, quz_PE, the_NP. * Substantially revised locales: gd_GB, ht_HT * The LC_ADDRESS field was updated to support country_car for almost all supported locales. * ISO 1427 definitions were updated. * ISO 3166 definitions were updated. * The localedef utility now supports --big-endian and --little-endian command-line options to generate locales for a different system from that for which the C library was built. * Binary locale files now only depend on the endianness of the system for which they are generated and not on other properties of that system. * ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh, cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue). * SystemTap probes for malloc have been introduced. * Support for powerpc64le has been added. * The soft-float powerpc port now supports e500 processors. - Remove upstreamed patches: cbrtl-ldbl-96.patch fcntl-o-tmpfile.patch getaddrinfo-overflow.patch glibc-2.18.tar.xz glibc-ld-profile.patch glibc-nscd-hconf.diff i686-strcasecmp-fallback.patch m68k-Scrt1.patch malloc-overflows.patch nonascii-case.patch nss-database.patch (forwarded request 208665 from Andreas_Schwab) OBS-URL: https://build.opensuse.org/request/show/208666 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=161 --- cbrtl-ldbl-96.patch | 17 - fcntl-o-tmpfile.patch | 58 -- getaddrinfo-ipv6-sanity.diff | 14 +- getaddrinfo-overflow.patch | 44 -- glibc-2.18.90-bd12ab55c05e.tar.xz | 3 + glibc-2.18.tar.xz | 3 - glibc-2.3.2.no_archive.diff | 15 +- glibc-2.3.locales.diff.bz2 | 4 +- glibc-2.4.90-no_NO.diff | 18 +- glibc-2.4.90-revert-only-euro.diff | 95 --- glibc-ld-profile.patch | 79 -- glibc-nscd-hconf.diff | 38 - glibc-testsuite.changes | 39 + glibc-testsuite.spec | 54 +- glibc-utils.changes | 39 + glibc-utils.spec | 54 +- glibc.changes | 39 + glibc.spec | 54 +- i686-no-sse42-strstr.patch | 2 +- i686-strcasecmp-fallback.patch | 74 -- m68k-Scrt1.patch | 50 -- malloc-overflows.patch | 60 -- nonascii-case.patch | 148 ---- nss-database.patch | 112 --- printf-overrun.patch | 179 ----- readdir_r-overflow.patch | 297 -------- strcoll-overflow.patch | 1106 ---------------------------- 27 files changed, 161 insertions(+), 2534 deletions(-) delete mode 100644 cbrtl-ldbl-96.patch delete mode 100644 fcntl-o-tmpfile.patch delete mode 100644 getaddrinfo-overflow.patch create mode 100644 glibc-2.18.90-bd12ab55c05e.tar.xz delete mode 100644 glibc-2.18.tar.xz delete mode 100644 glibc-2.4.90-revert-only-euro.diff delete mode 100644 glibc-ld-profile.patch delete mode 100644 glibc-nscd-hconf.diff delete mode 100644 i686-strcasecmp-fallback.patch delete mode 100644 m68k-Scrt1.patch delete mode 100644 malloc-overflows.patch delete mode 100644 nonascii-case.patch delete mode 100644 nss-database.patch delete mode 100644 printf-overrun.patch delete mode 100644 readdir_r-overflow.patch delete mode 100644 strcoll-overflow.patch diff --git a/cbrtl-ldbl-96.patch b/cbrtl-ldbl-96.patch deleted file mode 100644 index 50d26b3..0000000 --- a/cbrtl-ldbl-96.patch +++ /dev/null @@ -1,17 +0,0 @@ - [BZ #15749] - * sysdeps/ieee754/ldbl-96/s_cbrtl.c (__cbrtl): Use fabsl instead - of fabs. - -Index: glibc-2.17.90/sysdeps/ieee754/ldbl-96/s_cbrtl.c -=================================================================== ---- glibc-2.17.90.orig/sysdeps/ieee754/ldbl-96/s_cbrtl.c -+++ glibc-2.17.90/sysdeps/ieee754/ldbl-96/s_cbrtl.c -@@ -45,7 +45,7 @@ __cbrtl (long double x) - int xe; - - /* Reduce X. XM now is an range 1.0 to 0.5. */ -- xm = __frexpl (fabs (x), &xe); -+ xm = __frexpl (fabsl (x), &xe); - - /* If X is not finite or is null return it (with raising exceptions - if necessary. diff --git a/fcntl-o-tmpfile.patch b/fcntl-o-tmpfile.patch deleted file mode 100644 index 493f4fa..0000000 --- a/fcntl-o-tmpfile.patch +++ /dev/null @@ -1,58 +0,0 @@ -Index: glibc-2.18/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h -=================================================================== ---- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h -+++ glibc-2.18/ports/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h -@@ -36,6 +36,7 @@ - #define __O_DIRECT 02000000 /* Direct disk access. */ - #define __O_NOATIME 04000000 /* Do not set atime. */ - #define __O_PATH 040000000 /* Resolve pathname but do not open file. */ -+#define __O_TMPFILE 0100100000 /* Atomically create nameless file. */ - - /* Not necessary, files are always with 64bit off_t. */ - #define __O_LARGEFILE 0 -Index: glibc-2.18/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h -=================================================================== ---- glibc-2.18.orig/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h -+++ glibc-2.18/ports/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h -@@ -37,6 +37,7 @@ - #define __O_CLOEXEC 010000000 /* Set close_on_exec. */ - #define __O_NOATIME 004000000 /* Do not set atime. */ - #define __O_PATH 020000000 -+#define __O_TMPFILE 040010000 /* Atomically create nameless file. */ - - #define __O_LARGEFILE 00004000 - -Index: glibc-2.18/sysdeps/unix/sysv/linux/bits/fcntl-linux.h -=================================================================== ---- glibc-2.18.orig/sysdeps/unix/sysv/linux/bits/fcntl-linux.h -+++ glibc-2.18/sysdeps/unix/sysv/linux/bits/fcntl-linux.h -@@ -96,6 +96,9 @@ - #ifndef __O_DSYNC - # define __O_DSYNC 010000 - #endif -+#ifndef __O_TMPFILE -+# define __O_TMPFILE 020200000 -+#endif - - #ifndef F_GETLK - # ifndef __USE_FILE_OFFSET64 -@@ -128,6 +131,7 @@ - # define O_DIRECT __O_DIRECT /* Direct disk access. */ - # define O_NOATIME __O_NOATIME /* Do not set atime. */ - # define O_PATH __O_PATH /* Resolve pathname but do not open file. */ -+# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ - #endif - - /* For now, Linux has no separate synchronicitiy options for read -Index: glibc-2.18/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h -=================================================================== ---- glibc-2.18.orig/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h -+++ glibc-2.18/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h -@@ -39,6 +39,7 @@ - #define __O_DIRECT 0x100000 /* direct disk access hint */ - #define __O_NOATIME 0x200000 /* Do not set atime. */ - #define __O_PATH 0x1000000 /* Resolve pathname but do not open file. */ -+#define __O_TMPFILE 0x2010000 /* Atomically create nameless file. */ - - #if __WORDSIZE == 64 - # define __O_LARGEFILE 0 diff --git a/getaddrinfo-ipv6-sanity.diff b/getaddrinfo-ipv6-sanity.diff index 1f792b1..7c0949e 100644 --- a/getaddrinfo-ipv6-sanity.diff +++ b/getaddrinfo-ipv6-sanity.diff @@ -1,8 +1,8 @@ -Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c +Index: glibc-2.18.90/sysdeps/posix/getaddrinfo.c =================================================================== ---- glibc-2.17.90.orig/sysdeps/posix/getaddrinfo.c -+++ glibc-2.17.90/sysdeps/posix/getaddrinfo.c -@@ -270,7 +270,7 @@ extern service_user *__nss_hosts_databas +--- glibc-2.18.90.orig/sysdeps/posix/getaddrinfo.c ++++ glibc-2.18.90/sysdeps/posix/getaddrinfo.c +@@ -286,7 +286,7 @@ extern service_user *__nss_hosts_databas static int gaih_inet (const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai, @@ -11,7 +11,7 @@ Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c { const struct gaih_typeproto *tp = gaih_inet_typeproto; struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv; -@@ -840,7 +840,10 @@ gaih_inet (const char *name, const struc +@@ -855,7 +855,10 @@ gaih_inet (const char *name, const struc if (req->ai_family == PF_UNSPEC) fct4 = __nss_lookup_function (nip, "gethostbyname4_r"); @@ -23,7 +23,7 @@ Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c { int herrno; -@@ -943,7 +946,7 @@ gaih_inet (const char *name, const struc +@@ -958,7 +961,7 @@ gaih_inet (const char *name, const struc if (fct != NULL) { if (req->ai_family == AF_INET6 @@ -32,7 +32,7 @@ Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c { gethosts (AF_INET6, struct in6_addr); no_inet6_data = no_data; -@@ -2471,7 +2474,11 @@ getaddrinfo (const char *name, const cha +@@ -2418,7 +2421,11 @@ getaddrinfo (const char *name, const cha if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET || hints->ai_family == AF_INET6) { diff --git a/getaddrinfo-overflow.patch b/getaddrinfo-overflow.patch deleted file mode 100644 index 6071c89..0000000 --- a/getaddrinfo-overflow.patch +++ /dev/null @@ -1,44 +0,0 @@ -2013-10-25 Siddhesh Poyarekar - - [BZ #16072] - * sysdeps/posix/getaddrinfo.c (gethosts): Allocate tmpbuf on - heap for large requests. - -Index: glibc-2.18/sysdeps/posix/getaddrinfo.c -=================================================================== ---- glibc-2.18.orig/sysdeps/posix/getaddrinfo.c -+++ glibc-2.18/sysdeps/posix/getaddrinfo.c -@@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename, - &rc, &herrno, NULL, &localcanon)); \ - if (rc != ERANGE || herrno != NETDB_INTERNAL) \ - break; \ -- tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \ -+ if (!malloc_tmpbuf && __libc_use_alloca (alloca_used + 2 * tmpbuflen)) \ -+ tmpbuf = extend_alloca_account (tmpbuf, tmpbuflen, 2 * tmpbuflen, \ -+ alloca_used); \ -+ else \ -+ { \ -+ char *newp = realloc (malloc_tmpbuf ? tmpbuf : NULL, \ -+ 2 * tmpbuflen); \ -+ if (newp == NULL) \ -+ { \ -+ result = -EAI_MEMORY; \ -+ goto free_and_return; \ -+ } \ -+ tmpbuf = newp; \ -+ malloc_tmpbuf = true; \ -+ tmpbuflen = 2 * tmpbuflen; \ -+ } \ - } \ - if (status == NSS_STATUS_SUCCESS && rc == 0) \ - h = &th; \ -@@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename, - { \ - __set_h_errno (herrno); \ - _res.options |= old_res_options & RES_USE_INET6; \ -- return -EAI_SYSTEM; \ -+ result = -EAI_SYSTEM; \ -+ goto free_and_return; \ - } \ - if (herrno == TRY_AGAIN) \ - no_data = EAI_AGAIN; \ diff --git a/glibc-2.18.90-bd12ab55c05e.tar.xz b/glibc-2.18.90-bd12ab55c05e.tar.xz new file mode 100644 index 0000000..09bd2db --- /dev/null +++ b/glibc-2.18.90-bd12ab55c05e.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ce32970ab8633d7a9cf1b11d3787c206b78e19732a53e2f309ba14fedeb561 +size 11868220 diff --git a/glibc-2.18.tar.xz b/glibc-2.18.tar.xz deleted file mode 100644 index 38b8bfb..0000000 --- a/glibc-2.18.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2cb4e1e381928f1e5e55e71ab1ba8e0ea7ede75ff9709770435bfd018ea257a3 -size 11150148 diff --git a/glibc-2.3.2.no_archive.diff b/glibc-2.3.2.no_archive.diff index c9161e8..ed68c3b 100644 --- a/glibc-2.3.2.no_archive.diff +++ b/glibc-2.3.2.no_archive.diff @@ -1,12 +1,11 @@ -------------------------------------------------------------------- Wed Jun 4 14:29:07 CEST 2003 - kukuk@suse.de - Make --no-archive default for localedef -Index: glibc-2.17.90/locale/programs/localedef.c +Index: glibc-2.18.90/locale/programs/localedef.c =================================================================== ---- glibc-2.17.90.orig/locale/programs/localedef.c -+++ glibc-2.17.90/locale/programs/localedef.c +--- glibc-2.18.90.orig/locale/programs/localedef.c ++++ glibc-2.18.90/locale/programs/localedef.c @@ -81,7 +81,7 @@ const char *alias_file; static struct localedef_t *locales; @@ -21,10 +20,10 @@ Index: glibc-2.17.90/locale/programs/localedef.c #define OPT_DELETE_FROM_ARCHIVE 308 #define OPT_LIST_ARCHIVE 309 +#define OPT_ARCHIVE 310 + #define OPT_LITTLE_ENDIAN 400 + #define OPT_BIG_ENDIAN 401 - /* Definitions of arguments for argp functions. */ - static const struct argp_option options[] = -@@ -134,6 +135,8 @@ static const struct argp_option options[ +@@ -136,6 +137,8 @@ static const struct argp_option options[ N_("Suppress warnings and information messages") }, { "verbose", 'v', NULL, 0, N_("Print more messages") }, { NULL, 0, NULL, 0, N_("Archive control:") }, @@ -33,7 +32,7 @@ Index: glibc-2.17.90/locale/programs/localedef.c { "no-archive", OPT_NO_ARCHIVE, NULL, 0, N_("Don't add new data to archive") }, { "add-to-archive", OPT_ADD_TO_ARCHIVE, NULL, 0, -@@ -311,6 +314,9 @@ parse_opt (int key, char *arg, struct ar +@@ -317,6 +320,9 @@ parse_opt (int key, char *arg, struct ar case OPT_PREFIX: output_prefix = arg; break; diff --git a/glibc-2.3.locales.diff.bz2 b/glibc-2.3.locales.diff.bz2 index 0385705..232b892 100644 --- a/glibc-2.3.locales.diff.bz2 +++ b/glibc-2.3.locales.diff.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:10f1db566a96ef0e012c79fc18844593f56424a1e5a7d1b3f6521b2fdc1753e9 -size 329284 +oid sha256:d2311caa4855d8269d8fae0c3aab97ce9f1a30abea4b40955471adf7b5413b93 +size 329303 diff --git a/glibc-2.4.90-no_NO.diff b/glibc-2.4.90-no_NO.diff index 7da8b5d..64884ea 100644 --- a/glibc-2.4.90-no_NO.diff +++ b/glibc-2.4.90-no_NO.diff @@ -1,7 +1,7 @@ -Index: glibc-2.17.90/intl/locale.alias +Index: glibc-2.18.90/intl/locale.alias =================================================================== ---- glibc-2.17.90.orig/intl/locale.alias -+++ glibc-2.17.90/intl/locale.alias +--- glibc-2.18.90.orig/intl/locale.alias ++++ glibc-2.18.90/intl/locale.alias @@ -56,8 +56,6 @@ korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR @@ -11,11 +11,11 @@ Index: glibc-2.17.90/intl/locale.alias norwegian nb_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 -Index: glibc-2.17.90/localedata/SUPPORTED +Index: glibc-2.18.90/localedata/SUPPORTED =================================================================== ---- glibc-2.17.90.orig/localedata/SUPPORTED -+++ glibc-2.17.90/localedata/SUPPORTED -@@ -324,6 +324,8 @@ nl_NL/ISO-8859-1 \ +--- glibc-2.18.90.orig/localedata/SUPPORTED ++++ glibc-2.18.90/localedata/SUPPORTED +@@ -331,6 +331,8 @@ nl_NL/ISO-8859-1 \ nl_NL@euro/ISO-8859-15 \ nn_NO.UTF-8/UTF-8 \ nn_NO/ISO-8859-1 \ @@ -24,10 +24,10 @@ Index: glibc-2.17.90/localedata/SUPPORTED nr_ZA/UTF-8 \ nso_ZA/UTF-8 \ oc_FR.UTF-8/UTF-8 \ -Index: glibc-2.17.90/localedata/locales/no_NO +Index: glibc-2.18.90/localedata/locales/no_NO =================================================================== --- /dev/null -+++ glibc-2.17.90/localedata/locales/no_NO ++++ glibc-2.18.90/localedata/locales/no_NO @@ -0,0 +1,69 @@ +escape_char / +comment_char % diff --git a/glibc-2.4.90-revert-only-euro.diff b/glibc-2.4.90-revert-only-euro.diff deleted file mode 100644 index f5e515f..0000000 --- a/glibc-2.4.90-revert-only-euro.diff +++ /dev/null @@ -1,95 +0,0 @@ -Index: glibc-2.17.90/locale/iso-4217.def -=================================================================== ---- glibc-2.17.90.orig/locale/iso-4217.def -+++ glibc-2.17.90/locale/iso-4217.def -@@ -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 -> EUR */ - 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 */ -@@ -44,6 +47,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 */ -@@ -51,16 +55,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 */ -@@ -69,12 +77,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 */ -@@ -94,6 +104,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 */ -@@ -114,6 +125,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 */ -@@ -124,6 +136,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 */ diff --git a/glibc-ld-profile.patch b/glibc-ld-profile.patch deleted file mode 100644 index 65247874..0000000 --- a/glibc-ld-profile.patch +++ /dev/null @@ -1,79 +0,0 @@ -glibc bug #13818 - -2012-03-07 Jeff Law - - * elf/dl-reloc.c (_dl_relocate_object): Move code to allocate - l_reloc_result prior to calling ELF_DYNAMIC_RELOCATE. - -diff -rup a/elf/dl-reloc.c b/elf/dl-reloc.c ---- a/elf/dl-reloc.c 2012-01-01 05:16:32.000000000 -0700 -+++ b/elf/dl-reloc.c 2012-03-06 15:41:56.486242640 -0700 -@@ -238,32 +238,9 @@ _dl_relocate_object (struct link_map *l, - /* String table object symbols. */ - const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]); - -- /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ --#define RESOLVE_MAP(ref, version, r_type) \ -- (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ -- ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ -- && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ -- ? (bump_num_cache_relocations (), \ -- (*ref) = l->l_lookup_cache.ret, \ -- l->l_lookup_cache.value) \ -- : ({ lookup_t _lr; \ -- int _tc = elf_machine_type_class (r_type); \ -- l->l_lookup_cache.type_class = _tc; \ -- l->l_lookup_cache.sym = (*ref); \ -- const struct r_found_version *v = NULL; \ -- if ((version) != NULL && (version)->hash != 0) \ -- v = (version); \ -- _lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \ -- scope, v, _tc, \ -- DL_LOOKUP_ADD_DEPENDENCY, NULL); \ -- l->l_lookup_cache.ret = (*ref); \ -- l->l_lookup_cache.value = _lr; })) \ -- : l) -- --#include "dynamic-link.h" -- -- ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc); -- -+ /* ELF_DYNAMIC_RELOCATE may need to examine l_reloc_result -+ when handling MACHINE_IRELATIVE relocs. So we must -+ allocate l_reloc_result prior to calling ELF_DYNAMIC_RELOCATE. */ - #ifndef PROF - if (__builtin_expect (consider_profiling, 0)) - { -@@ -290,6 +267,32 @@ _dl_relocate_object (struct link_map *l, - } - } - #endif -+ -+ /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ -+#define RESOLVE_MAP(ref, version, r_type) \ -+ (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ -+ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ -+ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ -+ ? (bump_num_cache_relocations (), \ -+ (*ref) = l->l_lookup_cache.ret, \ -+ l->l_lookup_cache.value) \ -+ : ({ lookup_t _lr; \ -+ int _tc = elf_machine_type_class (r_type); \ -+ l->l_lookup_cache.type_class = _tc; \ -+ l->l_lookup_cache.sym = (*ref); \ -+ const struct r_found_version *v = NULL; \ -+ if ((version) != NULL && (version)->hash != 0) \ -+ v = (version); \ -+ _lr = _dl_lookup_symbol_x (strtab + (*ref)->st_name, l, (ref), \ -+ scope, v, _tc, \ -+ DL_LOOKUP_ADD_DEPENDENCY, NULL); \ -+ l->l_lookup_cache.ret = (*ref); \ -+ l->l_lookup_cache.value = _lr; })) \ -+ : l) -+ -+#include "dynamic-link.h" -+ -+ ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc); - } - - /* Mark the object so we know this work has been done. */ diff --git a/glibc-nscd-hconf.diff b/glibc-nscd-hconf.diff deleted file mode 100644 index 3d3807b..0000000 --- a/glibc-nscd-hconf.diff +++ /dev/null @@ -1,38 +0,0 @@ -See: -http://sourceware.org/bugzilla/show_bug.cgi?id=11928 - -Index: glibc-2.17.90/nscd/aicache.c -=================================================================== ---- glibc-2.17.90.orig/nscd/aicache.c -+++ glibc-2.17.90/nscd/aicache.c -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - - #include "dbg_log.h" - #include "nscd.h" -@@ -102,6 +103,8 @@ addhstaiX (struct database_dyn *db, int - - if (__res_maybe_init (&_res, 0) == -1) - no_more = 1; -+ if (!_res_hconf.initialized) -+ _res_hconf_init (); - - /* If we are looking for both IPv4 and IPv6 address we don't want - the lookup functions to automatically promote IPv4 addresses to -Index: glibc-2.17.90/resolv/res_hconf.c -=================================================================== ---- glibc-2.17.90.orig/resolv/res_hconf.c -+++ glibc-2.17.90/resolv/res_hconf.c -@@ -81,7 +81,9 @@ static const struct cmd - }; - - /* Structure containing the state. */ -+#ifndef NOT_IN_libc - struct hconf _res_hconf; -+#endif - - /* Skip white space. */ - static const char * diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 92f4496..6975fb2 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,42 @@ +------------------------------------------------------------------- +Mon Nov 25 13:59:52 UTC 2013 - schwab@suse.de + +- Update to glibc 2.18.90 bd12ab55c05e: + * New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW, + pap_CW, quz_PE, the_NP. + * Substantially revised locales: gd_GB, ht_HT + * The LC_ADDRESS field was updated to support country_car for almost all + supported locales. + * ISO 1427 definitions were updated. + * ISO 3166 definitions were updated. + * The localedef utility now supports --big-endian and --little-endian + command-line options to generate locales for a different system from that + for which the C library was built. + * Binary locale files now only depend on the endianness of the system for + which they are generated and not on other properties of that system. + * ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh, + cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue). + * SystemTap probes for malloc have been introduced. + * Support for powerpc64le has been added. + * The soft-float powerpc port now supports e500 processors. +- Remove upstreamed patches: + cbrtl-ldbl-96.patch + fcntl-o-tmpfile.patch + getaddrinfo-overflow.patch + glibc-2.18.tar.xz + glibc-ld-profile.patch + glibc-nscd-hconf.diff + i686-strcasecmp-fallback.patch + m68k-Scrt1.patch + malloc-overflows.patch + nonascii-case.patch + nss-database.patch + printf-overrun.patch + readdir_r-overflow.patch + strcoll-overflow.patch +- Remove obsolete patches: + glibc-2.4.90-revert-only-euro.diff + ------------------------------------------------------------------- Wed Oct 30 14:05:30 UTC 2013 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index d8a0edd..360de02 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -106,14 +106,14 @@ BuildRequires: gd-devel # 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel %define enablekernel 2.6.16 %endif -Version: 2.18 +Version: 2.18.90 Release: 0 -%define glibc_major_version 2.18 -%define git_id %{nil} +%define glibc_major_version 2.18.90 +%define git_id bd12ab55c05e Url: http://www.gnu.org/software/libc/libc.html BuildRoot: %{_tmppath}/%{name}-%{version}-build -#Source: glibc-%{version}-%{git_id}.tar.xz -Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz +Source: glibc-%{version}-%{git_id}.tar.xz +#Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz Source3: noversion.tar.bz2 Source4: manpages.tar.bz2 Source5: nsswitch.conf @@ -217,8 +217,6 @@ Patch20: i686-no-sse42-strstr.patch ### Locale related patches # PATCH-FIX-OPENSUSE Add additional locales Patch100: glibc-2.3.locales.diff.bz2 -# PATCH-FIX-OPENSUSE Support pre-EURO currencies (XXX: Still needed?) -Patch101: glibc-2.4.90-revert-only-euro.diff # PATCH-FIX-OPENSUSE -- Add no_NO back (XXX: Still needed?) Patch102: glibc-2.4.90-no_NO.diff # PATCH-FIX-OPENSUSE -- Renames for China @@ -236,44 +234,18 @@ Patch301: glibc-2.2-sunrpc.diff Patch302: getaddrinfo-ipv6-sanity.diff # PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv Patch304: glibc-resolv-mdnshint.diff -# PATCH-FIX-OPENSUSE nscd does not account for 'multi on' in /etc/host.conf when ai-resolving host bso#11928 -Patch305: glibc-nscd-hconf.diff # PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719 Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM Add O_TMPFILE to -Patch1000: fcntl-o-tmpfile.patch -# PATCH-FIX-UPSTREAM Integer overflows in malloc -Patch1001: malloc-overflows.patch -# PATCH-FIX-UPSTREAM m68k: Use PIC for Scrt1.o -Patch1002: m68k-Scrt1.patch -# PATCH-FIX-UPSTREAM Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458) -Patch1003: getaddrinfo-overflow.patch ### # Patches awaiting upstream approval ### -# PATCH-FIX-UPSTREAM Fix LD_PROFILE (glibc bug#13818) - aj@suse.de -Patch2008: glibc-ld-profile.patch -# PATCH-FIX-UPSTREAM Properly cache the result from looking up the nss database config -Patch2013: nss-database.patch -# PATCH-FIX-UPSTREAM Revert problematic fixes for [BZ #11741] -Patch2015: printf-overrun.patch -# PATCH-FIX-UPSTREAM Fix strcasecmp for tr_TR.ISO-8859-9 -Patch2017: nonascii-case.patch -# PATCH-FIX-UPSTREAM Fix fallback in i686 strcasecmp/strncasecmp -Patch2018: i686-strcasecmp-fallback.patch # PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching Patch2019: pldd-wait-ptrace-stop.patch -# PATCH-FIX-UPSTREAM Fix cbrtl for ldbl-96 -Patch2020: cbrtl-ldbl-96.patch -# PATCH-FIX-UPSTREAM Fix buffer overflow in strcoll (CVE-2012-4412) -Patch2021: strcoll-overflow.patch -# PATCH-FIX-UPSTREAM Fix readdir_r with long file names (CVE-2013-4237) -Patch2022: readdir_r-overflow.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -466,7 +438,6 @@ rm nscd/s-stamp %patch20 -p1 %patch100 -p1 -%patch101 -p1 %patch102 -p1 %patch103 -p1 @@ -474,24 +445,9 @@ rm nscd/s-stamp %patch301 -p1 %patch302 -p1 %patch304 -p1 -%patch305 -p1 %patch306 -p1 -%patch1000 -p1 -%patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 - -# XXX Disable, it breaks the testsuite, test elf/tst-audit2 -# %patch2008 -p1 -%patch2013 -p1 -%patch2015 -p1 -%patch2017 -p1 -%patch2018 -p1 %patch2019 -p1 -%patch2020 -p1 -%patch2021 -p1 -%patch2022 -p1 %patch3000 diff --git a/glibc-utils.changes b/glibc-utils.changes index 92f4496..6975fb2 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,42 @@ +------------------------------------------------------------------- +Mon Nov 25 13:59:52 UTC 2013 - schwab@suse.de + +- Update to glibc 2.18.90 bd12ab55c05e: + * New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW, + pap_CW, quz_PE, the_NP. + * Substantially revised locales: gd_GB, ht_HT + * The LC_ADDRESS field was updated to support country_car for almost all + supported locales. + * ISO 1427 definitions were updated. + * ISO 3166 definitions were updated. + * The localedef utility now supports --big-endian and --little-endian + command-line options to generate locales for a different system from that + for which the C library was built. + * Binary locale files now only depend on the endianness of the system for + which they are generated and not on other properties of that system. + * ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh, + cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue). + * SystemTap probes for malloc have been introduced. + * Support for powerpc64le has been added. + * The soft-float powerpc port now supports e500 processors. +- Remove upstreamed patches: + cbrtl-ldbl-96.patch + fcntl-o-tmpfile.patch + getaddrinfo-overflow.patch + glibc-2.18.tar.xz + glibc-ld-profile.patch + glibc-nscd-hconf.diff + i686-strcasecmp-fallback.patch + m68k-Scrt1.patch + malloc-overflows.patch + nonascii-case.patch + nss-database.patch + printf-overrun.patch + readdir_r-overflow.patch + strcoll-overflow.patch +- Remove obsolete patches: + glibc-2.4.90-revert-only-euro.diff + ------------------------------------------------------------------- Wed Oct 30 14:05:30 UTC 2013 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index a92d045..4c8a61d 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -105,14 +105,14 @@ BuildRequires: gd-devel # 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel %define enablekernel 2.6.16 %endif -Version: 2.18 +Version: 2.18.90 Release: 0 -%define glibc_major_version 2.18 -%define git_id %{nil} +%define glibc_major_version 2.18.90 +%define git_id bd12ab55c05e Url: http://www.gnu.org/software/libc/libc.html BuildRoot: %{_tmppath}/%{name}-%{version}-build -#Source: glibc-%{version}-%{git_id}.tar.xz -Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz +Source: glibc-%{version}-%{git_id}.tar.xz +#Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz Source3: noversion.tar.bz2 Source4: manpages.tar.bz2 Source5: nsswitch.conf @@ -216,8 +216,6 @@ Patch20: i686-no-sse42-strstr.patch ### Locale related patches # PATCH-FIX-OPENSUSE Add additional locales Patch100: glibc-2.3.locales.diff.bz2 -# PATCH-FIX-OPENSUSE Support pre-EURO currencies (XXX: Still needed?) -Patch101: glibc-2.4.90-revert-only-euro.diff # PATCH-FIX-OPENSUSE -- Add no_NO back (XXX: Still needed?) Patch102: glibc-2.4.90-no_NO.diff # PATCH-FIX-OPENSUSE -- Renames for China @@ -235,44 +233,18 @@ Patch301: glibc-2.2-sunrpc.diff Patch302: getaddrinfo-ipv6-sanity.diff # PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv Patch304: glibc-resolv-mdnshint.diff -# PATCH-FIX-OPENSUSE nscd does not account for 'multi on' in /etc/host.conf when ai-resolving host bso#11928 -Patch305: glibc-nscd-hconf.diff # PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719 Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM Add O_TMPFILE to -Patch1000: fcntl-o-tmpfile.patch -# PATCH-FIX-UPSTREAM Integer overflows in malloc -Patch1001: malloc-overflows.patch -# PATCH-FIX-UPSTREAM m68k: Use PIC for Scrt1.o -Patch1002: m68k-Scrt1.patch -# PATCH-FIX-UPSTREAM Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458) -Patch1003: getaddrinfo-overflow.patch ### # Patches awaiting upstream approval ### -# PATCH-FIX-UPSTREAM Fix LD_PROFILE (glibc bug#13818) - aj@suse.de -Patch2008: glibc-ld-profile.patch -# PATCH-FIX-UPSTREAM Properly cache the result from looking up the nss database config -Patch2013: nss-database.patch -# PATCH-FIX-UPSTREAM Revert problematic fixes for [BZ #11741] -Patch2015: printf-overrun.patch -# PATCH-FIX-UPSTREAM Fix strcasecmp for tr_TR.ISO-8859-9 -Patch2017: nonascii-case.patch -# PATCH-FIX-UPSTREAM Fix fallback in i686 strcasecmp/strncasecmp -Patch2018: i686-strcasecmp-fallback.patch # PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching Patch2019: pldd-wait-ptrace-stop.patch -# PATCH-FIX-UPSTREAM Fix cbrtl for ldbl-96 -Patch2020: cbrtl-ldbl-96.patch -# PATCH-FIX-UPSTREAM Fix buffer overflow in strcoll (CVE-2012-4412) -Patch2021: strcoll-overflow.patch -# PATCH-FIX-UPSTREAM Fix readdir_r with long file names (CVE-2013-4237) -Patch2022: readdir_r-overflow.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -466,7 +438,6 @@ rm nscd/s-stamp %patch20 -p1 %patch100 -p1 -%patch101 -p1 %patch102 -p1 %patch103 -p1 @@ -474,24 +445,9 @@ rm nscd/s-stamp %patch301 -p1 %patch302 -p1 %patch304 -p1 -%patch305 -p1 %patch306 -p1 -%patch1000 -p1 -%patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 - -# XXX Disable, it breaks the testsuite, test elf/tst-audit2 -# %patch2008 -p1 -%patch2013 -p1 -%patch2015 -p1 -%patch2017 -p1 -%patch2018 -p1 %patch2019 -p1 -%patch2020 -p1 -%patch2021 -p1 -%patch2022 -p1 %patch3000 diff --git a/glibc.changes b/glibc.changes index 92f4496..6975fb2 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,42 @@ +------------------------------------------------------------------- +Mon Nov 25 13:59:52 UTC 2013 - schwab@suse.de + +- Update to glibc 2.18.90 bd12ab55c05e: + * New locales: ak_GH, anp_IN, ar_SS, cmn_TW, hak_TW, lzh_TW, nan_TW, pap_AW, + pap_CW, quz_PE, the_NP. + * Substantially revised locales: gd_GB, ht_HT + * The LC_ADDRESS field was updated to support country_car for almost all + supported locales. + * ISO 1427 definitions were updated. + * ISO 3166 definitions were updated. + * The localedef utility now supports --big-endian and --little-endian + command-line options to generate locales for a different system from that + for which the C library was built. + * Binary locale files now only depend on the endianness of the system for + which they are generated and not on other properties of that system. + * ISO 639 definitions were updated for Chiga (cgg) and Chinese (gan, hak, czh, + cjy, lzh, cmn, mnp, cdo, czo, cpx, wuu, hsn, yue). + * SystemTap probes for malloc have been introduced. + * Support for powerpc64le has been added. + * The soft-float powerpc port now supports e500 processors. +- Remove upstreamed patches: + cbrtl-ldbl-96.patch + fcntl-o-tmpfile.patch + getaddrinfo-overflow.patch + glibc-2.18.tar.xz + glibc-ld-profile.patch + glibc-nscd-hconf.diff + i686-strcasecmp-fallback.patch + m68k-Scrt1.patch + malloc-overflows.patch + nonascii-case.patch + nss-database.patch + printf-overrun.patch + readdir_r-overflow.patch + strcoll-overflow.patch +- Remove obsolete patches: + glibc-2.4.90-revert-only-euro.diff + ------------------------------------------------------------------- Wed Oct 30 14:05:30 UTC 2013 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index dfe8bb6..80843e3 100644 --- a/glibc.spec +++ b/glibc.spec @@ -106,14 +106,14 @@ BuildRequires: gd-devel # 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel %define enablekernel 2.6.16 %endif -Version: 2.18 +Version: 2.18.90 Release: 0 -%define glibc_major_version 2.18 -%define git_id %{nil} +%define glibc_major_version 2.18.90 +%define git_id bd12ab55c05e Url: http://www.gnu.org/software/libc/libc.html BuildRoot: %{_tmppath}/%{name}-%{version}-build -#Source: glibc-%{version}-%{git_id}.tar.xz -Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz +Source: glibc-%{version}-%{git_id}.tar.xz +#Source: http://ftp.gnu.org/pub/gnu/glibc/glibc-%{version}.tar.xz Source3: noversion.tar.bz2 Source4: manpages.tar.bz2 Source5: nsswitch.conf @@ -217,8 +217,6 @@ Patch20: i686-no-sse42-strstr.patch ### Locale related patches # PATCH-FIX-OPENSUSE Add additional locales Patch100: glibc-2.3.locales.diff.bz2 -# PATCH-FIX-OPENSUSE Support pre-EURO currencies (XXX: Still needed?) -Patch101: glibc-2.4.90-revert-only-euro.diff # PATCH-FIX-OPENSUSE -- Add no_NO back (XXX: Still needed?) Patch102: glibc-2.4.90-no_NO.diff # PATCH-FIX-OPENSUSE -- Renames for China @@ -236,44 +234,18 @@ Patch301: glibc-2.2-sunrpc.diff Patch302: getaddrinfo-ipv6-sanity.diff # PATCH-FIX-OPENSUSE Warn about usage of mdns in resolv.conv Patch304: glibc-resolv-mdnshint.diff -# PATCH-FIX-OPENSUSE nscd does not account for 'multi on' in /etc/host.conf when ai-resolving host bso#11928 -Patch305: glibc-nscd-hconf.diff # PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719 Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM Add O_TMPFILE to -Patch1000: fcntl-o-tmpfile.patch -# PATCH-FIX-UPSTREAM Integer overflows in malloc -Patch1001: malloc-overflows.patch -# PATCH-FIX-UPSTREAM m68k: Use PIC for Scrt1.o -Patch1002: m68k-Scrt1.patch -# PATCH-FIX-UPSTREAM Fix stack overflow due to large AF_INET6 requests (CVE-2013-4458) -Patch1003: getaddrinfo-overflow.patch ### # Patches awaiting upstream approval ### -# PATCH-FIX-UPSTREAM Fix LD_PROFILE (glibc bug#13818) - aj@suse.de -Patch2008: glibc-ld-profile.patch -# PATCH-FIX-UPSTREAM Properly cache the result from looking up the nss database config -Patch2013: nss-database.patch -# PATCH-FIX-UPSTREAM Revert problematic fixes for [BZ #11741] -Patch2015: printf-overrun.patch -# PATCH-FIX-UPSTREAM Fix strcasecmp for tr_TR.ISO-8859-9 -Patch2017: nonascii-case.patch -# PATCH-FIX-UPSTREAM Fix fallback in i686 strcasecmp/strncasecmp -Patch2018: i686-strcasecmp-fallback.patch # PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching Patch2019: pldd-wait-ptrace-stop.patch -# PATCH-FIX-UPSTREAM Fix cbrtl for ldbl-96 -Patch2020: cbrtl-ldbl-96.patch -# PATCH-FIX-UPSTREAM Fix buffer overflow in strcoll (CVE-2012-4412) -Patch2021: strcoll-overflow.patch -# PATCH-FIX-UPSTREAM Fix readdir_r with long file names (CVE-2013-4237) -Patch2022: readdir_r-overflow.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -466,7 +438,6 @@ rm nscd/s-stamp %patch20 -p1 %patch100 -p1 -%patch101 -p1 %patch102 -p1 %patch103 -p1 @@ -474,24 +445,9 @@ rm nscd/s-stamp %patch301 -p1 %patch302 -p1 %patch304 -p1 -%patch305 -p1 %patch306 -p1 -%patch1000 -p1 -%patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 - -# XXX Disable, it breaks the testsuite, test elf/tst-audit2 -# %patch2008 -p1 -%patch2013 -p1 -%patch2015 -p1 -%patch2017 -p1 -%patch2018 -p1 %patch2019 -p1 -%patch2020 -p1 -%patch2021 -p1 -%patch2022 -p1 %patch3000 diff --git a/i686-no-sse42-strstr.patch b/i686-no-sse42-strstr.patch index e8eab79..0f2441a 100644 --- a/i686-no-sse42-strstr.patch +++ b/i686-no-sse42-strstr.patch @@ -89,7 +89,7 @@ Index: glibc-2.18/sysdeps/i386/i686/multiarch/strstr-c.c -#include "init-arch.h" - -#define STRSTR __strstr_ia32 --#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN +-#if defined SHARED && !defined NO_HIDDEN -#undef libc_hidden_builtin_def -#define libc_hidden_builtin_def(name) \ - __hidden_ver1 (__strstr_ia32, __GI_strstr, __strstr_ia32); diff --git a/i686-strcasecmp-fallback.patch b/i686-strcasecmp-fallback.patch deleted file mode 100644 index 73e030c..0000000 --- a/i686-strcasecmp-fallback.patch +++ /dev/null @@ -1,74 +0,0 @@ - * sysdeps/i386/i686/multiarch/strcmp-sse4.S (__strcasecmp_sse4_2) - (__strncasecmp_sse4_2) [PIC]: Restore %ebx before falling through - to __strcasecmp_nonascii and __strncasecmp_nonascii. - * sysdeps/i386/i686/multiarch/strcmp-ssse3.S (__strcasecmp_ssse3) - (__strncasecmp_ssse3) [PIC]: Likewise. - -Index: glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-sse4.S -=================================================================== ---- glibc-2.17.90.orig/sysdeps/i386/i686/multiarch/strcmp-sse4.S -+++ glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-sse4.S -@@ -121,8 +121,14 @@ ENTRY (__strcasecmp_sse4_2) - movl (%eax), %eax - # endif - testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax) -+# ifdef PIC -+ je L(ascii) -+ POP (%ebx) -+ jmp __strcasecmp_nonascii -+# else - jne __strcasecmp_nonascii - jmp L(ascii) -+# endif - END (__strcasecmp_sse4_2) - #endif - -@@ -152,8 +158,14 @@ ENTRY (__strncasecmp_sse4_2) - movl (%eax), %eax - # endif - testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax) -+# ifdef PIC -+ je L(ascii) -+ POP (%ebx) -+ jmp __strncasecmp_nonascii -+# else - jne __strncasecmp_nonascii - jmp L(ascii) -+# endif - END (__strncasecmp_sse4_2) - #endif - -Index: glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-ssse3.S -=================================================================== ---- glibc-2.17.90.orig/sysdeps/i386/i686/multiarch/strcmp-ssse3.S -+++ glibc-2.17.90/sysdeps/i386/i686/multiarch/strcmp-ssse3.S -@@ -138,8 +138,14 @@ ENTRY (__strcasecmp_ssse3) - movl (%eax), %eax - # endif - testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax) -+# ifdef PIC -+ je L(ascii) -+ POP (%ebx) -+ jmp __strcasecmp_nonascii -+# else - jne __strcasecmp_nonascii - jmp L(ascii) -+# endif - END (__strcasecmp_ssse3) - #endif - -@@ -169,8 +175,14 @@ ENTRY (__strncasecmp_ssse3) - movl (%eax), %eax - # endif - testl $1, LOCALE_DATA_VALUES+_NL_CTYPE_NONASCII_CASE*SIZEOF_VALUES(%eax) -+# ifdef PIC -+ je L(ascii) -+ POP (%ebx) -+ jmp __strncasecmp_nonascii -+# else - jne __strncasecmp_nonascii - jmp L(ascii) -+# endif - END (__strncasecmp_ssse3) - #endif - diff --git a/m68k-Scrt1.patch b/m68k-Scrt1.patch deleted file mode 100644 index 66dff9f..0000000 --- a/m68k-Scrt1.patch +++ /dev/null @@ -1,50 +0,0 @@ -2013-10-08 Andreas Schwab - - * sysdeps/m68k/start.S [SHARED]: Use PIC. - -Index: glibc-2.18/ports/sysdeps/m68k/start.S -=================================================================== ---- glibc-2.18.orig/ports/sysdeps/m68k/start.S -+++ glibc-2.18/ports/sysdeps/m68k/start.S -@@ -52,6 +52,8 @@ - NULL - */ - -+#include -+ - .text - .globl _start - .type _start,@function -@@ -74,6 +76,24 @@ _start: - pea (%a1) /* Push address of the shared library - termination function. */ - -+#ifdef SHARED -+ /* Load PIC register. */ -+ LOAD_GOT (%a5) -+ -+ /* Push the address of our own entry points to `.fini' and -+ `.init'. */ -+ move.l __libc_csu_fini@GOT(%a5), -(%sp) -+ move.l __libc_csu_init@GOT(%a5), -(%sp) -+ -+ pea (%a0) /* Push second argument: argv. */ -+ move.l %d0, -(%sp) /* Push first argument: argc. */ -+ -+ move.l main@GOT(%a5), -(%sp) -+ -+ /* Call the user's main function, and exit with its value. But -+ let the libc call main. */ -+ jbsr __libc_start_main@PLTPC -+#else - /* Push the address of our own entry points to `.fini' and - `.init'. */ - pea __libc_csu_fini -@@ -87,6 +107,7 @@ _start: - /* Call the user's main function, and exit with its value. But - let the libc call main. */ - jbsr __libc_start_main -+#endif - - illegal /* Crash if somehow `exit' does return. */ - diff --git a/malloc-overflows.patch b/malloc-overflows.patch deleted file mode 100644 index 15f2369..0000000 --- a/malloc-overflows.patch +++ /dev/null @@ -1,60 +0,0 @@ -2013-09-11 Will Newton - - [BZ #15857] - * malloc/malloc.c (__libc_memalign): Check the value of bytes - does not overflow. - - [BZ #15856] - * malloc/malloc.c (__libc_valloc): Check the value of bytes - does not overflow. - - [BZ #15855] - * malloc/malloc.c (__libc_pvalloc): Check the value of bytes - does not overflow. - -Index: glibc-2.18/malloc/malloc.c -=================================================================== ---- glibc-2.18.orig/malloc/malloc.c -+++ glibc-2.18/malloc/malloc.c -@@ -3015,6 +3015,13 @@ __libc_memalign(size_t alignment, size_t - /* Otherwise, ensure that it is at least a minimum chunk size */ - if (alignment < MINSIZE) alignment = MINSIZE; - -+ /* Check for overflow. */ -+ if (bytes > SIZE_MAX - alignment - MINSIZE) -+ { -+ __set_errno (ENOMEM); -+ return 0; -+ } -+ - arena_get(ar_ptr, bytes + alignment + MINSIZE); - if(!ar_ptr) - return 0; -@@ -3046,6 +3053,13 @@ __libc_valloc(size_t bytes) - - size_t pagesz = GLRO(dl_pagesize); - -+ /* Check for overflow. */ -+ if (bytes > SIZE_MAX - pagesz - MINSIZE) -+ { -+ __set_errno (ENOMEM); -+ return 0; -+ } -+ - void *(*hook) (size_t, size_t, const void *) = - force_reg (__memalign_hook); - if (__builtin_expect (hook != NULL, 0)) -@@ -3082,6 +3096,13 @@ __libc_pvalloc(size_t bytes) - size_t page_mask = GLRO(dl_pagesize) - 1; - size_t rounded_bytes = (bytes + page_mask) & ~(page_mask); - -+ /* Check for overflow. */ -+ if (bytes > SIZE_MAX - 2*pagesz - MINSIZE) -+ { -+ __set_errno (ENOMEM); -+ return 0; -+ } -+ - void *(*hook) (size_t, size_t, const void *) = - force_reg (__memalign_hook); - if (__builtin_expect (hook != NULL, 0)) diff --git a/nonascii-case.patch b/nonascii-case.patch deleted file mode 100644 index a4be170..0000000 --- a/nonascii-case.patch +++ /dev/null @@ -1,148 +0,0 @@ - [BZ #15736] - * locale/categories.def (LC_CTYPE): Add "nonascii-case" element. - * string/Makefile (test-strcasecmp-ENV, test-strncasecmp-ENV) - (test-strcasecmp-ifunc-ENV, test-strncasecmp-ifunc-ENV): Define. - * string/test-strcasecmp.c (test_main): Run tests in several - locales. - * string/test-strncasecmp.c (test_main): Likewise. - -Index: glibc-2.17.90/locale/categories.def -=================================================================== ---- glibc-2.17.90.orig/locale/categories.def -+++ glibc-2.17.90/locale/categories.def -@@ -133,6 +133,7 @@ DEFINE_CATEGORY - DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_IGNORE_LEN, "ctype-translit-ignore-len", std, word) - DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_IGNORE, "ctype-translit-ignore", std, string) - DEFINE_ELEMENT (_NL_CTYPE_MAP_TO_NONASCII, "map-to-nonascii", std, word) -+ DEFINE_ELEMENT (_NL_CTYPE_NONASCII_CASE, "nonascii-case", std, word) - ), _nl_postload_ctype) - - -Index: glibc-2.17.90/string/Makefile -=================================================================== ---- glibc-2.17.90.orig/string/Makefile -+++ glibc-2.17.90/string/Makefile -@@ -65,6 +65,10 @@ noinl-tester-ENV = LANGUAGE=C - tst-strxfrm-ENV = LOCPATH=$(common-objpfx)localedata - tst-strxfrm2-ENV = LOCPATH=$(common-objpfx)localedata - bug-strcoll1-ENV = LOCPATH=$(common-objpfx)localedata -+test-strcasecmp-ENV = LOCPATH=$(common-objpfx)localedata -+test-strncasecmp-ENV = LOCPATH=$(common-objpfx)localedata -+test-strcasecmp-ifunc-ENV = LOCPATH=$(common-objpfx)localedata -+test-strncasecmp-ifunc-ENV = LOCPATH=$(common-objpfx)localedata - CFLAGS-inl-tester.c = -fno-builtin - CFLAGS-noinl-tester.c = -fno-builtin - CFLAGS-tst-strlen.c = -fno-builtin -Index: glibc-2.17.90/string/test-strcasecmp.c -=================================================================== ---- glibc-2.17.90.orig/string/test-strcasecmp.c -+++ glibc-2.17.90/string/test-strcasecmp.c -@@ -17,6 +17,7 @@ - License along with the GNU C Library; if not, see - . */ - -+#include - #include - #define TEST_MAIN - #define TEST_NAME "strcasecmp" -@@ -206,14 +207,18 @@ do_random_tests (void) - } - } - --int --test_main (void) -+static void -+test_locale (const char *locale) - { - size_t i; - -- test_init (); -+ if (setlocale (LC_CTYPE, locale) == NULL) -+ { -+ error (0, 0, "cannot set locale \"%s\"", locale); -+ ret = 1; -+ } - -- printf ("%23s", ""); -+ printf ("%-23s", locale); - FOR_EACH_IMPL (impl, 0) - printf ("\t%s", impl->name); - putchar ('\n'); -@@ -246,6 +251,19 @@ test_main (void) - } - - do_random_tests (); -+} -+ -+int -+test_main (void) -+{ -+ test_init (); -+ -+ test_locale ("C"); -+ test_locale ("en_US.ISO-8859-1"); -+ test_locale ("en_US.UTF-8"); -+ test_locale ("tr_TR.ISO-8859-9"); -+ test_locale ("tr_TR.UTF-8"); -+ - return ret; - } - -Index: glibc-2.17.90/string/test-strncasecmp.c -=================================================================== ---- glibc-2.17.90.orig/string/test-strncasecmp.c -+++ glibc-2.17.90/string/test-strncasecmp.c -@@ -17,6 +17,7 @@ - License along with the GNU C Library; if not, see - . */ - -+#include - #include - #define TEST_MAIN - #define TEST_NAME "strncasecmp" -@@ -256,17 +257,21 @@ bz14195 (void) - check_result (impl, empty_string, "", 5, 0); - } - --int --test_main (void) -+static void -+test_locale (const char *locale) - { - size_t i; - -- test_init (); -+ if (setlocale (LC_CTYPE, locale) == NULL) -+ { -+ error (0, 0, "cannot set locale \"%s\"", locale); -+ ret = 1; -+ } - - bz12205 (); - bz14195 (); - -- printf ("%23s", ""); -+ printf ("%23s", locale); - FOR_EACH_IMPL (impl, 0) - printf ("\t%s", impl->name); - putchar ('\n'); -@@ -329,6 +334,19 @@ test_main (void) - } - - do_random_tests (); -+} -+ -+int -+test_main (void) -+{ -+ test_init (); -+ -+ test_locale ("C"); -+ test_locale ("en_US.ISO-8859-1"); -+ test_locale ("en_US.UTF-8"); -+ test_locale ("tr_TR.ISO-8859-9"); -+ test_locale ("tr_TR.UTF-8"); -+ - return ret; - } - diff --git a/nss-database.patch b/nss-database.patch deleted file mode 100644 index 2cf36ed..0000000 --- a/nss-database.patch +++ /dev/null @@ -1,112 +0,0 @@ -From a6856a042a0669ac3f8bc675e8e1de14b5d09b94 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Thu, 24 Jan 2013 12:32:09 +0100 -Subject: [PATCH] Properly cache the result from looking up the nss database - config - - [BZ #15048] - * nscd/aicache.c (addhstaiX): Properly use the cache variable for - the nss database lookup. - * nscd/initgrcache.c (addinitgroupsX): Likewise. - * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise. ---- - nscd/aicache.c | 15 +++++++-------- - nscd/initgrcache.c | 15 +++++++-------- - sysdeps/posix/getaddrinfo.c | 14 ++++++-------- - 3 files changed, 20 insertions(+), 24 deletions(-) - -Index: glibc-2.17.90/nscd/aicache.c -=================================================================== ---- glibc-2.17.90.orig/nscd/aicache.c -+++ glibc-2.17.90/nscd/aicache.c -@@ -86,20 +86,19 @@ addhstaiX (struct database_dyn *db, int - } - - static service_user *hosts_database; -- service_user *nip = NULL; -+ service_user *nip; - int no_more; - int rc6 = 0; - int rc4 = 0; - int herrno = 0; - -- if (hosts_database != NULL) -- { -- nip = hosts_database; -- no_more = 0; -- } -- else -+ if (hosts_database == NULL) - no_more = __nss_database_lookup ("hosts", NULL, -- "dns [!UNAVAIL=return] files", &nip); -+ "dns [!UNAVAIL=return] files", -+ &hosts_database); -+ else -+ no_more = 0; -+ nip = hosts_database; - - if (__res_maybe_init (&_res, 0) == -1) - no_more = 1; -Index: glibc-2.17.90/nscd/initgrcache.c -=================================================================== ---- glibc-2.17.90.orig/nscd/initgrcache.c -+++ glibc-2.17.90/nscd/initgrcache.c -@@ -80,17 +80,16 @@ addinitgroupsX (struct database_dyn *db, - } - - static service_user *group_database; -- service_user *nip = NULL; -+ service_user *nip; - int no_more; - -- if (group_database != NULL) -- { -- nip = group_database; -- no_more = 0; -- } -- else -+ if (group_database == NULL) - no_more = __nss_database_lookup ("group", NULL, -- "compat [NOTFOUND=return] files", &nip); -+ "compat [NOTFOUND=return] files", -+ &group_database); -+ else -+ no_more = 0; -+ nip = group_database; - - /* We always use sysconf even if NGROUPS_MAX is defined. That way, the - limit can be raised in the kernel configuration without having to -Index: glibc-2.17.90/sysdeps/posix/getaddrinfo.c -=================================================================== ---- glibc-2.17.90.orig/sysdeps/posix/getaddrinfo.c -+++ glibc-2.17.90/sysdeps/posix/getaddrinfo.c -@@ -558,7 +558,7 @@ gaih_inet (const char *name, const struc - struct gaih_addrtuple **pat = &at; - int no_data = 0; - int no_inet6_data = 0; -- service_user *nip = NULL; -+ service_user *nip; - enum nss_status inet6_status = NSS_STATUS_UNAVAIL; - enum nss_status status = NSS_STATUS_UNAVAIL; - int no_more; -@@ -791,15 +791,13 @@ gaih_inet (const char *name, const struc - } - #endif - -- if (__nss_hosts_database != NULL) -- { -- no_more = 0; -- nip = __nss_hosts_database; -- } -- else -+ if (__nss_hosts_database == NULL) - no_more = __nss_database_lookup ("hosts", NULL, - "dns [!UNAVAIL=return] files", -- &nip); -+ &__nss_hosts_database); -+ else -+ no_more = 0; -+ nip = __nss_hosts_database; - - /* Initialize configurations. */ - if (__builtin_expect (!_res_hconf.initialized, 0)) diff --git a/printf-overrun.patch b/printf-overrun.patch deleted file mode 100644 index d5f3b3b..0000000 --- a/printf-overrun.patch +++ /dev/null @@ -1,179 +0,0 @@ -From 1aa92494e55792b568663b5aad81a58fad35490d Mon Sep 17 00:00:00 2001 -From: Eric Biggers -Date: Thu, 18 Apr 2013 17:46:08 +0200 -Subject: [PATCH] PR15362 - - [BZ #15362] - * libio/fileops.c: Revert problematic fixes for [BZ #11741] - * libio/iofwrite.c: Likewise. - * libio/iofwrite_u.c: Likewise. - * libio/iopadn.c: Likewise. - * libio/iowpadn.c: Likewise. - * stdio-common/vfprintf.c: Fix [BZ #11741] properly by checking whether - _IO_padn() returned the full count written. ---- - libio/fileops.c | 21 +++++++++------------ - libio/iofwrite.c | 10 +++++----- - libio/iofwrite_u.c | 10 +++++----- - libio/iopadn.c | 2 +- - libio/iowpadn.c | 2 +- - stdio-common/vfprintf.c | 12 ++++++------ - 6 files changed, 27 insertions(+), 30 deletions(-) - -Index: glibc-2.17.90/libio/fileops.c -=================================================================== ---- glibc-2.17.90.orig/libio/fileops.c -+++ glibc-2.17.90/libio/fileops.c -@@ -1245,13 +1245,12 @@ _IO_new_file_write (f, data, n) - _IO_ssize_t n; - { - _IO_ssize_t to_do = n; -- _IO_ssize_t count = 0; - while (to_do > 0) - { -- count = (__builtin_expect (f->_flags2 -- & _IO_FLAGS2_NOTCANCEL, 0) -- ? write_not_cancel (f->_fileno, data, to_do) -- : write (f->_fileno, data, to_do)); -+ _IO_ssize_t count = (__builtin_expect (f->_flags2 -+ & _IO_FLAGS2_NOTCANCEL, 0) -+ ? write_not_cancel (f->_fileno, data, to_do) -+ : write (f->_fileno, data, to_do)); - if (count < 0) - { - f->_flags |= _IO_ERR_SEEN; -@@ -1263,7 +1262,7 @@ _IO_new_file_write (f, data, n) - n -= to_do; - if (f->_offset >= 0) - f->_offset += n; -- return count < 0 ? count : n; -+ return n; - } - - _IO_size_t -@@ -1323,13 +1322,11 @@ _IO_new_file_xsputn (f, data, n) - _IO_size_t block_size, do_write; - /* Next flush the (full) buffer. */ - if (_IO_OVERFLOW (f, EOF) == EOF) -- /* If nothing else has to be written or nothing has been written, we -- must not signal the caller that the call was even partially -- successful. */ -- return (to_do == 0 || to_do == n) ? EOF : n - to_do; -+ /* If nothing else has to be written we must not signal the -+ caller that everything has been written. */ -+ return to_do == 0 ? EOF : n - to_do; - -- /* Try to maintain alignment: write a whole number of blocks. -- dont_write is what gets left over. */ -+ /* Try to maintain alignment: write a whole number of blocks. */ - block_size = f->_IO_buf_end - f->_IO_buf_base; - do_write = to_do - (block_size >= 128 ? to_do % block_size : 0); - -Index: glibc-2.17.90/libio/iofwrite.c -=================================================================== ---- glibc-2.17.90.orig/libio/iofwrite.c -+++ glibc-2.17.90/libio/iofwrite.c -@@ -42,12 +42,12 @@ _IO_fwrite (buf, size, count, fp) - if (_IO_vtable_offset (fp) != 0 || _IO_fwide (fp, -1) == -1) - written = _IO_sputn (fp, (const char *) buf, request); - _IO_release_lock (fp); -- /* We are guaranteed to have written all of the input, none of it, or -- some of it. */ -- if (written == request) -+ /* We have written all of the input in case the return value indicates -+ this or EOF is returned. The latter is a special case where we -+ simply did not manage to flush the buffer. But the data is in the -+ buffer and therefore written as far as fwrite is concerned. */ -+ if (written == request || written == EOF) - return count; -- else if (written == EOF) -- return 0; - else - return written / size; - } -Index: glibc-2.17.90/libio/iofwrite_u.c -=================================================================== ---- glibc-2.17.90.orig/libio/iofwrite_u.c -+++ glibc-2.17.90/libio/iofwrite_u.c -@@ -44,12 +44,12 @@ fwrite_unlocked (buf, size, count, fp) - if (_IO_fwide (fp, -1) == -1) - { - written = _IO_sputn (fp, (const char *) buf, request); -- /* We are guaranteed to have written all of the input, none of it, or -- some of it. */ -- if (written == request) -+ /* We have written all of the input in case the return value indicates -+ this or EOF is returned. The latter is a special case where we -+ simply did not manage to flush the buffer. But the data is in the -+ buffer and therefore written as far as fwrite is concerned. */ -+ if (written == request || written == EOF) - return count; -- else if (written == EOF) -- return 0; - } - - return written / size; -Index: glibc-2.17.90/libio/iopadn.c -=================================================================== ---- glibc-2.17.90.orig/libio/iopadn.c -+++ glibc-2.17.90/libio/iopadn.c -@@ -59,7 +59,7 @@ _IO_padn (fp, pad, count) - w = _IO_sputn (fp, padptr, PADSIZE); - written += w; - if (w != PADSIZE) -- return w == EOF ? w : written; -+ return written; - } - - if (i > 0) -Index: glibc-2.17.90/libio/iowpadn.c -=================================================================== ---- glibc-2.17.90.orig/libio/iowpadn.c -+++ glibc-2.17.90/libio/iowpadn.c -@@ -65,7 +65,7 @@ _IO_wpadn (fp, pad, count) - w = _IO_sputn (fp, (char *) padptr, PADSIZE); - written += w; - if (w != PADSIZE) -- return w == EOF ? w : written; -+ return written; - } - - if (i > 0) -Index: glibc-2.17.90/stdio-common/vfprintf.c -=================================================================== ---- glibc-2.17.90.orig/stdio-common/vfprintf.c -+++ glibc-2.17.90/stdio-common/vfprintf.c -@@ -90,13 +90,13 @@ - do { \ - if (width > 0) \ - { \ -- unsigned int d = _IO_padn (s, (Padchar), width); \ -- if (__glibc_unlikely (d == EOF)) \ -+ _IO_ssize_t written = _IO_padn (s, (Padchar), width); \ -+ if (__glibc_unlikely (written != width)) \ - { \ - done = -1; \ - goto all_done; \ - } \ -- done_add (d); \ -+ done_add (written); \ - } \ - } while (0) - # define PUTC(C, F) _IO_putc_unlocked (C, F) -@@ -119,13 +119,13 @@ - do { \ - if (width > 0) \ - { \ -- unsigned int d = _IO_wpadn (s, (Padchar), width); \ -- if (__glibc_unlikely (d == EOF)) \ -+ _IO_ssize_t written = _IO_wpadn (s, (Padchar), width); \ -+ if (__glibc_unlikely (written != width)) \ - { \ - done = -1; \ - goto all_done; \ - } \ -- done_add (d); \ -+ done_add (written); \ - } \ - } while (0) - # define PUTC(C, F) _IO_putwc_unlocked (C, F) diff --git a/readdir_r-overflow.patch b/readdir_r-overflow.patch deleted file mode 100644 index b2e3182..0000000 --- a/readdir_r-overflow.patch +++ /dev/null @@ -1,297 +0,0 @@ -2013-06-12 Florian Weimer - - [BZ #14699] - * sysdeps/posix/dirstream.h (struct __dirstream): Add errcode - member. - * sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode - member. - * sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member. - * sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit. - Return delayed error code. Remove GETDENTS_64BIT_ALIGNED - conditional. - * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define - GETDENTS_64BIT_ALIGNED. - * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. - * manual/filesys.texi (Reading/Closing Directory): Document - ENAMETOOLONG return value of readdir_r. Recommend readdir more - strongly. - * manual/conf.texi (Limits for Files): Add portability note to - NAME_MAX, PATH_MAX. - (Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX. - -Index: glibc-2.18/manual/conf.texi -=================================================================== ---- glibc-2.18.orig/manual/conf.texi -+++ glibc-2.18/manual/conf.texi -@@ -1149,6 +1149,9 @@ typed ahead as input. @xref{I/O Queues} - @deftypevr Macro int NAME_MAX - The uniform system limit (if any) for the length of a file name component, not - including the terminating null character. -+ -+@strong{Portability Note:} On some systems, @theglibc{} defines -+@code{NAME_MAX}, but does not actually enforce this limit. - @end deftypevr - - @comment limits.h -@@ -1157,6 +1160,9 @@ including the terminating null character - The uniform system limit (if any) for the length of an entire file name (that - is, the argument given to system calls such as @code{open}), including the - terminating null character. -+ -+@strong{Portability Note:} @Theglibc{} does not enforce this limit -+even if @code{PATH_MAX} is defined. - @end deftypevr - - @cindex limits, pipe buffer size -@@ -1476,6 +1482,9 @@ Inquire about the value of @code{POSIX_R - Inquire about the value of @code{POSIX_REC_XFER_ALIGN}. - @end table - -+@strong{Portability Note:} On some systems, @theglibc{} does not -+enforce @code{_PC_NAME_MAX} or @code{_PC_PATH_MAX} limits. -+ - @node Utility Limits - @section Utility Program Capacity Limits - -Index: glibc-2.18/manual/filesys.texi -=================================================================== ---- glibc-2.18.orig/manual/filesys.texi -+++ glibc-2.18/manual/filesys.texi -@@ -444,9 +444,9 @@ symbols are declared in the header file - @comment POSIX.1 - @deftypefun {struct dirent *} readdir (DIR *@var{dirstream}) - This function reads the next entry from the directory. It normally --returns a pointer to a structure containing information about the file. --This structure is statically allocated and can be rewritten by a --subsequent call. -+returns a pointer to a structure containing information about the -+file. This structure is associated with the @var{dirstream} handle -+and can be rewritten by a subsequent call. - - @strong{Portability Note:} On some systems @code{readdir} may not - return entries for @file{.} and @file{..}, even though these are always -@@ -461,19 +461,59 @@ conditions are defined for this function - The @var{dirstream} argument is not valid. - @end table - --@code{readdir} is not thread safe. Multiple threads using --@code{readdir} on the same @var{dirstream} may overwrite the return --value. Use @code{readdir_r} when this is critical. -+To distinguish between an end-of-directory condition or an error, you -+must set @code{errno} to zero before calling @code{readdir}. To avoid -+entering an infinite loop, you should stop reading from the directory -+after the first error. -+ -+In POSIX.1-2008, @code{readdir} is not thread-safe. In @theglibc{} -+implementation, it is safe to call @code{readdir} concurrently on -+different @var{dirstream}s (but multiple threads accessing the same -+@var{dirstream} result in undefined behavior). @code{readdir_r} is a -+fully thread-safe alternative, but suffers from poor portability (see -+below). It is recommended that you use @code{readdir}, with external -+locking if multiple threads access the same @var{dirstream}. - @end deftypefun - - @comment dirent.h - @comment GNU - @deftypefun int readdir_r (DIR *@var{dirstream}, struct dirent *@var{entry}, struct dirent **@var{result}) --This function is the reentrant version of @code{readdir}. Like --@code{readdir} it returns the next entry from the directory. But to --prevent conflicts between simultaneously running threads the result is --not stored in statically allocated memory. Instead the argument --@var{entry} points to a place to store the result. -+This function is a version of @code{readdir} which performs internal -+locking. Like @code{readdir} it returns the next entry from the -+directory. To prevent conflicts between simultaneously running -+threads the result is stored inside the @var{entry} object. -+ -+@strong{Portability Note:} It is recommended to use @code{readdir} -+instead of @code{readdir_r} for the following reasons: -+ -+@itemize @bullet -+@item -+On systems which do not define @code{NAME_MAX}, it may not be possible -+to use @code{readdir_r} safely because the caller does not specify the -+length of the buffer for the directory entry. -+ -+@item -+On some systems, @code{readdir_r} cannot read directory entries with -+very long names. If such a name is encountered, @theglibc{} -+implementation of @code{readdir_r} returns with an error code of -+@code{ENAMETOOLONG} after the final directory entry has been read. On -+other systems, @code{readdir_r} may return successfully, but the -+@code{d_name} member may not be NUL-terminated or may be truncated. -+ -+@item -+POSIX-1.2008 does not guarantee that @code{readdir} is thread-safe, -+even when access to the same @var{dirstream} is serialized. But in -+current implementations (including @theglibc{}), it is safe to call -+@code{readdir} concurrently on different @var{dirstream}s, so there is -+no requirement to use @code{readdir_r} even in multi-threaded -+programs. -+ -+@item -+It is expected that future versions of POSIX will obsolete -+@code{readdir_r} and mandate the level of thread safety for -+@code{readdir} which is provided by @theglibc{} and other -+implementations today. -+@end itemize - - Normally @code{readdir_r} returns zero and sets @code{*@var{result}} - to @var{entry}. If there are no more entries in the directory or an -@@ -481,15 +521,6 @@ error is detected, @code{readdir_r} sets - null pointer and returns a nonzero error code, also stored in - @code{errno}, as described for @code{readdir}. - --@strong{Portability Note:} On some systems @code{readdir_r} may not --return a NUL terminated string for the file name, even when there is no --@code{d_reclen} field in @code{struct dirent} and the file --name is the maximum allowed size. Modern systems all have the --@code{d_reclen} field, and on old systems multi-threading is not --critical. In any case there is no such problem with the @code{readdir} --function, so that even on systems without the @code{d_reclen} member one --could use multiple threads by using external locking. -- - It is also important to look at the definition of the @code{struct - dirent} type. Simply passing a pointer to an object of this type for - the second parameter of @code{readdir_r} might not be enough. Some -Index: glibc-2.18/sysdeps/posix/dirstream.h -=================================================================== ---- glibc-2.18.orig/sysdeps/posix/dirstream.h -+++ glibc-2.18/sysdeps/posix/dirstream.h -@@ -39,6 +39,8 @@ struct __dirstream - - off_t filepos; /* Position of next entry to read. */ - -+ int errcode; /* Delayed error code. */ -+ - /* Directory block. */ - char data[0] __attribute__ ((aligned (__alignof__ (void*)))); - }; -Index: glibc-2.18/sysdeps/posix/opendir.c -=================================================================== ---- glibc-2.18.orig/sysdeps/posix/opendir.c -+++ glibc-2.18/sysdeps/posix/opendir.c -@@ -231,6 +231,7 @@ __alloc_dir (int fd, bool close_fd, int - dirp->size = 0; - dirp->offset = 0; - dirp->filepos = 0; -+ dirp->errcode = 0; - - return dirp; - } -Index: glibc-2.18/sysdeps/posix/readdir_r.c -=================================================================== ---- glibc-2.18.orig/sysdeps/posix/readdir_r.c -+++ glibc-2.18/sysdeps/posix/readdir_r.c -@@ -40,6 +40,7 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *ent - DIRENT_TYPE *dp; - size_t reclen; - const int saved_errno = errno; -+ int ret; - - __libc_lock_lock (dirp->lock); - -@@ -70,10 +71,10 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *ent - bytes = 0; - __set_errno (saved_errno); - } -+ if (bytes < 0) -+ dirp->errcode = errno; - - dp = NULL; -- /* Reclen != 0 signals that an error occurred. */ -- reclen = bytes != 0; - break; - } - dirp->size = (size_t) bytes; -@@ -106,29 +107,46 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *ent - dirp->filepos += reclen; - #endif - -- /* Skip deleted files. */ -+#ifdef NAME_MAX -+ if (reclen > offsetof (DIRENT_TYPE, d_name) + NAME_MAX + 1) -+ { -+ /* The record is very long. It could still fit into the -+ caller-supplied buffer if we can skip padding at the -+ end. */ -+ size_t namelen = _D_EXACT_NAMLEN (dp); -+ if (namelen <= NAME_MAX) -+ reclen = offsetof (DIRENT_TYPE, d_name) + namelen + 1; -+ else -+ { -+ /* The name is too long. Ignore this file. */ -+ dirp->errcode = ENAMETOOLONG; -+ dp->d_ino = 0; -+ continue; -+ } -+ } -+#endif -+ -+ /* Skip deleted and ignored files. */ - } - while (dp->d_ino == 0); - - if (dp != NULL) - { --#ifdef GETDENTS_64BIT_ALIGNED -- /* The d_reclen value might include padding which is not part of -- the DIRENT_TYPE data structure. */ -- reclen = MIN (reclen, -- offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name)); --#endif - *result = memcpy (entry, dp, reclen); --#ifdef GETDENTS_64BIT_ALIGNED -+#ifdef _DIRENT_HAVE_D_RECLEN - entry->d_reclen = reclen; - #endif -+ ret = 0; - } - else -- *result = NULL; -+ { -+ *result = NULL; -+ ret = dirp->errcode; -+ } - - __libc_lock_unlock (dirp->lock); - -- return dp != NULL ? 0 : reclen ? errno : 0; -+ return ret; - } - - #ifdef __READDIR_R_ALIAS -Index: glibc-2.18/sysdeps/posix/rewinddir.c -=================================================================== ---- glibc-2.18.orig/sysdeps/posix/rewinddir.c -+++ glibc-2.18/sysdeps/posix/rewinddir.c -@@ -33,6 +33,7 @@ rewinddir (dirp) - dirp->filepos = 0; - dirp->offset = 0; - dirp->size = 0; -+ dirp->errcode = 0; - #ifndef NOT_IN_libc - __libc_lock_unlock (dirp->lock); - #endif -Index: glibc-2.18/sysdeps/unix/sysv/linux/i386/readdir64_r.c -=================================================================== ---- glibc-2.18.orig/sysdeps/unix/sysv/linux/i386/readdir64_r.c -+++ glibc-2.18/sysdeps/unix/sysv/linux/i386/readdir64_r.c -@@ -18,7 +18,6 @@ - #define __READDIR_R __readdir64_r - #define __GETDENTS __getdents64 - #define DIRENT_TYPE struct dirent64 --#define GETDENTS_64BIT_ALIGNED 1 - - #include - -Index: glibc-2.18/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c -=================================================================== ---- glibc-2.18.orig/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c -+++ glibc-2.18/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c -@@ -1,5 +1,4 @@ - #define readdir64_r __no_readdir64_r_decl --#define GETDENTS_64BIT_ALIGNED 1 - #include - #undef readdir64_r - weak_alias (__readdir_r, readdir64_r) diff --git a/strcoll-overflow.patch b/strcoll-overflow.patch deleted file mode 100644 index a36ac41..0000000 --- a/strcoll-overflow.patch +++ /dev/null @@ -1,1106 +0,0 @@ -Siddhesh Poyarekar - - [BZ #14547] - * string/tst-strcoll-overflow.c: New test case. - * string/Makefile (xtests): Add tst-strcoll-overflow. - * string/strcoll_l.c (STRCOLL): Skip allocating memory for - cache if string sizes may cause integer overflow. - - [BZ #14547] - * string/strcoll_l.c (coll_seq): New members rule, idx, - save_idx and back_us. - (get_next_seq_nocache): New function. - (do_compare_nocache): New function. - (STRCOLL): Use get_next_seq_nocache and do_compare_nocache - when malloc fails. - - * string/strcoll_l.c (coll_seq): New structure. - (get_next_seq_cached): New function. - (get_next_seq): New function. - (do_compare): New function. - (STRCOLL): Use GNU style definition. Simplify implementation - by using get_next_seq, get_next_seq_cached and do_compare. - -Index: glibc-2.18/string/Makefile -=================================================================== ---- glibc-2.18.orig/string/Makefile -+++ glibc-2.18/string/Makefile -@@ -57,6 +57,8 @@ tests := tester inl-tester noinl-tester - tests-ifunc := $(strop-tests:%=test-%-ifunc) - tests += $(tests-ifunc) - -+xtests = tst-strcoll-overflow -+ - include ../Rules - - tester-ENV = LANGUAGE=C -Index: glibc-2.18/string/strcoll_l.c -=================================================================== ---- glibc-2.18.orig/string/strcoll_l.c -+++ glibc-2.18/string/strcoll_l.c -@@ -41,11 +41,434 @@ - - #include "../locale/localeinfo.h" - -+/* Track status while looking for sequences in a string. */ -+typedef struct -+{ -+ int len; /* Length of the current sequence. */ -+ size_t val; /* Position of the sequence relative to the -+ previous non-ignored sequence. */ -+ size_t idxnow; /* Current index in sequences. */ -+ size_t idxmax; /* Maximum index in sequences. */ -+ size_t idxcnt; /* Current count of indices. */ -+ size_t backw; /* Current Backward sequence index. */ -+ size_t backw_stop; /* Index where the backward sequences stop. */ -+ const USTRING_TYPE *us; /* The string. */ -+ int32_t *idxarr; /* Array to cache weight indices. */ -+ unsigned char *rulearr; /* Array to cache rules. */ -+ unsigned char rule; /* Saved rule for the first sequence. */ -+ int32_t idx; /* Index to weight of the current sequence. */ -+ int32_t save_idx; /* Save looked up index of a forward -+ sequence after the last backward -+ sequence. */ -+ const USTRING_TYPE *back_us; /* Beginning of the backward sequence. */ -+} coll_seq; -+ -+/* Get next sequence. The weight indices are cached, so we don't need to -+ traverse the string. */ -+static void -+get_next_seq_cached (coll_seq *seq, int nrules, int pass, -+ const unsigned char *rulesets, -+ const USTRING_TYPE *weights) -+{ -+ size_t val = seq->val = 0; -+ int len = seq->len; -+ size_t backw_stop = seq->backw_stop; -+ size_t backw = seq->backw; -+ size_t idxcnt = seq->idxcnt; -+ size_t idxmax = seq->idxmax; -+ size_t idxnow = seq->idxnow; -+ unsigned char *rulearr = seq->rulearr; -+ int32_t *idxarr = seq->idxarr; -+ -+ while (len == 0) -+ { -+ ++val; -+ if (backw_stop != ~0ul) -+ { -+ /* There is something pushed. */ -+ if (backw == backw_stop) -+ { -+ /* The last pushed character was handled. Continue -+ with forward characters. */ -+ if (idxcnt < idxmax) -+ { -+ idxnow = idxcnt; -+ backw_stop = ~0ul; -+ } -+ else -+ { -+ /* Nothing any more. The backward sequence -+ ended with the last sequence in the string. */ -+ idxnow = ~0ul; -+ break; -+ } -+ } -+ else -+ idxnow = --backw; -+ } -+ else -+ { -+ backw_stop = idxcnt; -+ -+ while (idxcnt < idxmax) -+ { -+ if ((rulesets[rulearr[idxcnt] * nrules + pass] -+ & sort_backward) == 0) -+ /* No more backward characters to push. */ -+ break; -+ ++idxcnt; -+ } -+ -+ if (backw_stop == idxcnt) -+ { -+ /* No sequence at all or just one. */ -+ if (idxcnt == idxmax) -+ /* Note that LEN is still zero. */ -+ break; -+ -+ backw_stop = ~0ul; -+ idxnow = idxcnt++; -+ } -+ else -+ /* We pushed backward sequences. */ -+ idxnow = backw = idxcnt - 1; -+ } -+ len = weights[idxarr[idxnow]++]; -+ } -+ -+ /* Update the structure. */ -+ seq->val = val; -+ seq->len = len; -+ seq->backw_stop = backw_stop; -+ seq->backw = backw; -+ seq->idxcnt = idxcnt; -+ seq->idxnow = idxnow; -+} -+ -+/* Get next sequence. Traverse the string as required. */ -+static void -+get_next_seq (coll_seq *seq, int nrules, const unsigned char *rulesets, -+ const USTRING_TYPE *weights, const int32_t *table, -+ const USTRING_TYPE *extra, const int32_t *indirect) -+{ -+#include WEIGHT_H -+ size_t val = seq->val = 0; -+ int len = seq->len; -+ size_t backw_stop = seq->backw_stop; -+ size_t backw = seq->backw; -+ size_t idxcnt = seq->idxcnt; -+ size_t idxmax = seq->idxmax; -+ size_t idxnow = seq->idxnow; -+ unsigned char *rulearr = seq->rulearr; -+ int32_t *idxarr = seq->idxarr; -+ const USTRING_TYPE *us = seq->us; -+ -+ while (len == 0) -+ { -+ ++val; -+ if (backw_stop != ~0ul) -+ { -+ /* There is something pushed. */ -+ if (backw == backw_stop) -+ { -+ /* The last pushed character was handled. Continue -+ with forward characters. */ -+ if (idxcnt < idxmax) -+ { -+ idxnow = idxcnt; -+ backw_stop = ~0ul; -+ } -+ else -+ /* Nothing any more. The backward sequence ended with -+ the last sequence in the string. Note that LEN -+ is still zero. */ -+ break; -+ } -+ else -+ idxnow = --backw; -+ } -+ else -+ { -+ backw_stop = idxmax; -+ -+ while (*us != L('\0')) -+ { -+ int32_t tmp = findidx (&us, -1); -+ rulearr[idxmax] = tmp >> 24; -+ idxarr[idxmax] = tmp & 0xffffff; -+ idxcnt = idxmax++; -+ -+ if ((rulesets[rulearr[idxcnt] * nrules] -+ & sort_backward) == 0) -+ /* No more backward characters to push. */ -+ break; -+ ++idxcnt; -+ } -+ -+ if (backw_stop >= idxcnt) -+ { -+ /* No sequence at all or just one. */ -+ if (idxcnt == idxmax || backw_stop > idxcnt) -+ /* Note that LEN is still zero. */ -+ break; -+ -+ backw_stop = ~0ul; -+ idxnow = idxcnt; -+ } -+ else -+ /* We pushed backward sequences. */ -+ idxnow = backw = idxcnt - 1; -+ } -+ len = weights[idxarr[idxnow]++]; -+ } -+ -+ /* Update the structure. */ -+ seq->val = val; -+ seq->len = len; -+ seq->backw_stop = backw_stop; -+ seq->backw = backw; -+ seq->idxcnt = idxcnt; -+ seq->idxmax = idxmax; -+ seq->idxnow = idxnow; -+ seq->us = us; -+} -+ -+/* Get next sequence. Traverse the string as required. This function does not -+ set or use any index or rule cache. */ -+static void -+get_next_seq_nocache (coll_seq *seq, int nrules, const unsigned char *rulesets, -+ const USTRING_TYPE *weights, const int32_t *table, -+ const USTRING_TYPE *extra, const int32_t *indirect, -+ int pass) -+{ -+#include WEIGHT_H -+ size_t val = seq->val = 0; -+ int len = seq->len; -+ size_t backw_stop = seq->backw_stop; -+ size_t backw = seq->backw; -+ size_t idxcnt = seq->idxcnt; -+ size_t idxmax = seq->idxmax; -+ int32_t idx = seq->idx; -+ const USTRING_TYPE *us = seq->us; -+ -+ while (len == 0) -+ { -+ ++val; -+ if (backw_stop != ~0ul) -+ { -+ /* There is something pushed. */ -+ if (backw == backw_stop) -+ { -+ /* The last pushed character was handled. Continue -+ with forward characters. */ -+ if (idxcnt < idxmax) -+ { -+ idx = seq->save_idx; -+ backw_stop = ~0ul; -+ } -+ else -+ { -+ /* Nothing anymore. The backward sequence ended with -+ the last sequence in the string. Note that len is -+ still zero. */ -+ idx = 0; -+ break; -+ } -+ } -+ else -+ { -+ /* XXX Traverse BACKW sequences from the beginning of -+ BACKW_STOP to get the next sequence. Is ther a quicker way -+ to do this? */ -+ size_t i = backw_stop; -+ us = seq->back_us; -+ while (i < backw) -+ { -+ int32_t tmp = findidx (&us, -1); -+ idx = tmp & 0xffffff; -+ i++; -+ } -+ --backw; -+ us = seq->us; -+ } -+ } -+ else -+ { -+ backw_stop = idxmax; -+ int32_t prev_idx = idx; -+ -+ while (*us != L('\0')) -+ { -+ int32_t tmp = findidx (&us, -1); -+ unsigned char rule = tmp >> 24; -+ prev_idx = idx; -+ idx = tmp & 0xffffff; -+ idxcnt = idxmax++; -+ -+ /* Save the rule for the first sequence. */ -+ if (__glibc_unlikely (idxcnt == 0)) -+ seq->rule = rule; -+ -+ if ((rulesets[rule * nrules + pass] -+ & sort_backward) == 0) -+ /* No more backward characters to push. */ -+ break; -+ ++idxcnt; -+ } -+ -+ if (backw_stop >= idxcnt) -+ { -+ /* No sequence at all or just one. */ -+ if (idxcnt == idxmax || backw_stop > idxcnt) -+ /* Note that len is still zero. */ -+ break; -+ -+ backw_stop = ~0ul; -+ } -+ else -+ { -+ /* We pushed backward sequences. If the stream ended with the -+ backward sequence, then we process the last sequence we -+ found. Otherwise we process the sequence before the last -+ one since the last one was a forward sequence. */ -+ seq->back_us = seq->us; -+ seq->us = us; -+ backw = idxcnt; -+ if (idxmax > idxcnt) -+ { -+ backw--; -+ seq->save_idx = idx; -+ idx = prev_idx; -+ } -+ if (backw > backw_stop) -+ backw--; -+ } -+ } -+ -+ len = weights[idx++]; -+ /* Skip over indices of previous levels. */ -+ for (int i = 0; i < pass; i++) -+ { -+ idx += len; -+ len = weights[idx]; -+ idx++; -+ } -+ } -+ -+ /* Update the structure. */ -+ seq->val = val; -+ seq->len = len; -+ seq->backw_stop = backw_stop; -+ seq->backw = backw; -+ seq->idxcnt = idxcnt; -+ seq->idxmax = idxmax; -+ seq->us = us; -+ seq->idx = idx; -+} -+ -+/* Compare two sequences. This version does not use the index and rules -+ cache. */ -+static int -+do_compare_nocache (coll_seq *seq1, coll_seq *seq2, int position, -+ const USTRING_TYPE *weights) -+{ -+ int seq1len = seq1->len; -+ int seq2len = seq2->len; -+ size_t val1 = seq1->val; -+ size_t val2 = seq2->val; -+ int idx1 = seq1->idx; -+ int idx2 = seq2->idx; -+ int result = 0; -+ -+ /* Test for position if necessary. */ -+ if (position && val1 != val2) -+ { -+ result = val1 > val2 ? 1 : -1; -+ goto out; -+ } -+ -+ /* Compare the two sequences. */ -+ do -+ { -+ if (weights[idx1] != weights[idx2]) -+ { -+ /* The sequences differ. */ -+ result = weights[idx1] - weights[idx2]; -+ goto out; -+ } -+ -+ /* Increment the offsets. */ -+ ++idx1; -+ ++idx2; -+ -+ --seq1len; -+ --seq2len; -+ } -+ while (seq1len > 0 && seq2len > 0); -+ -+ if (position && seq1len != seq2len) -+ result = seq1len - seq2len; -+ -+out: -+ seq1->len = seq1len; -+ seq2->len = seq2len; -+ seq1->idx = idx1; -+ seq2->idx = idx2; -+ return result; -+} -+ -+/* Compare two sequences using the index cache. */ -+static int -+do_compare (coll_seq *seq1, coll_seq *seq2, int position, -+ const USTRING_TYPE *weights) -+{ -+ int seq1len = seq1->len; -+ int seq2len = seq2->len; -+ size_t val1 = seq1->val; -+ size_t val2 = seq2->val; -+ int32_t *idx1arr = seq1->idxarr; -+ int32_t *idx2arr = seq2->idxarr; -+ int idx1now = seq1->idxnow; -+ int idx2now = seq2->idxnow; -+ int result = 0; -+ -+ /* Test for position if necessary. */ -+ if (position && val1 != val2) -+ { -+ result = val1 > val2 ? 1 : -1; -+ goto out; -+ } -+ -+ /* Compare the two sequences. */ -+ do -+ { -+ if (weights[idx1arr[idx1now]] != weights[idx2arr[idx2now]]) -+ { -+ /* The sequences differ. */ -+ result = weights[idx1arr[idx1now]] - weights[idx2arr[idx2now]]; -+ goto out; -+ } -+ -+ /* Increment the offsets. */ -+ ++idx1arr[idx1now]; -+ ++idx2arr[idx2now]; -+ -+ --seq1len; -+ --seq2len; -+ } -+ while (seq1len > 0 && seq2len > 0); -+ -+ if (position && seq1len != seq2len) -+ result = seq1len - seq2len; -+ -+out: -+ seq1->len = seq1len; -+ seq2->len = seq2len; -+ return result; -+} -+ - int --STRCOLL (s1, s2, l) -- const STRING_TYPE *s1; -- const STRING_TYPE *s2; -- __locale_t l; -+STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l) - { - struct __locale_data *current = l->__locales[LC_COLLATE]; - uint_fast32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word; -@@ -56,34 +479,6 @@ STRCOLL (s1, s2, l) - const USTRING_TYPE *weights; - const USTRING_TYPE *extra; - const int32_t *indirect; -- uint_fast32_t pass; -- int result = 0; -- const USTRING_TYPE *us1; -- const USTRING_TYPE *us2; -- size_t s1len; -- size_t s2len; -- int32_t *idx1arr; -- int32_t *idx2arr; -- unsigned char *rule1arr; -- unsigned char *rule2arr; -- size_t idx1max; -- size_t idx2max; -- size_t idx1cnt; -- size_t idx2cnt; -- size_t idx1now; -- size_t idx2now; -- size_t backw1_stop; -- size_t backw2_stop; -- size_t backw1; -- size_t backw2; -- int val1; -- int val2; -- int position; -- int seq1len; -- int seq2len; -- int use_malloc; -- --#include WEIGHT_H - - if (nrules == 0) - return STRCMP (s1, s2); -@@ -98,7 +493,6 @@ STRCOLL (s1, s2, l) - current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_EXTRA,SUFFIX))].string; - indirect = (const int32_t *) - current->values[_NL_ITEM_INDEX (CONCAT(_NL_COLLATE_INDIRECT,SUFFIX))].string; -- use_malloc = 0; - - assert (((uintptr_t) table) % __alignof__ (table[0]) == 0); - assert (((uintptr_t) weights) % __alignof__ (weights[0]) == 0); -@@ -106,18 +500,13 @@ STRCOLL (s1, s2, l) - assert (((uintptr_t) indirect) % __alignof__ (indirect[0]) == 0); - - /* We need this a few times. */ -- s1len = STRLEN (s1); -- s2len = STRLEN (s2); -+ size_t s1len = STRLEN (s1); -+ size_t s2len = STRLEN (s2); - - /* Catch empty strings. */ -- if (__builtin_expect (s1len == 0, 0) || __builtin_expect (s2len == 0, 0)) -+ if (__glibc_unlikely (s1len == 0) || __glibc_unlikely (s2len == 0)) - return (s1len != 0) - (s2len != 0); - -- /* We need the elements of the strings as unsigned values since they -- are used as indeces. */ -- us1 = (const USTRING_TYPE *) s1; -- us2 = (const USTRING_TYPE *) s2; -- - /* Perform the first pass over the string and while doing this find - and store the weights for each character. Since we want this to - be as fast as possible we are using `alloca' to store the temporary -@@ -127,411 +516,122 @@ STRCOLL (s1, s2, l) - - Please note that the localedef programs makes sure that `position' - is not used at the first level. */ -- if (! __libc_use_alloca ((s1len + s2len) * (sizeof (int32_t) + 1))) -- { -- idx1arr = (int32_t *) malloc ((s1len + s2len) * (sizeof (int32_t) + 1)); -- idx2arr = &idx1arr[s1len]; -- rule1arr = (unsigned char *) &idx2arr[s2len]; -- rule2arr = &rule1arr[s1len]; -- -- if (idx1arr == NULL) -- /* No memory. Well, go with the stack then. -- -- XXX Once this implementation is stable we will handle this -- differently. Instead of precomputing the indeces we will -- do this in time. This means, though, that this happens for -- every pass again. */ -- goto try_stack; -- use_malloc = 1; -- } -- else -- { -- try_stack: -- idx1arr = (int32_t *) alloca (s1len * sizeof (int32_t)); -- idx2arr = (int32_t *) alloca (s2len * sizeof (int32_t)); -- rule1arr = (unsigned char *) alloca (s1len); -- rule2arr = (unsigned char *) alloca (s2len); -- } -- -- idx1cnt = 0; -- idx2cnt = 0; -- idx1max = 0; -- idx2max = 0; -- idx1now = 0; -- idx2now = 0; -- backw1_stop = ~0ul; -- backw2_stop = ~0ul; -- backw1 = ~0ul; -- backw2 = ~0ul; -- seq1len = 0; -- seq2len = 0; -- position = rulesets[0] & sort_position; -- while (1) -- { -- val1 = 0; -- val2 = 0; -- -- /* Get the next non-IGNOREd element for string `s1'. */ -- if (seq1len == 0) -- do -- { -- ++val1; -- -- if (backw1_stop != ~0ul) -- { -- /* The is something pushed. */ -- if (backw1 == backw1_stop) -- { -- /* The last pushed character was handled. Continue -- with forward characters. */ -- if (idx1cnt < idx1max) -- { -- idx1now = idx1cnt; -- backw1_stop = ~0ul; -- } -- else -- /* Nothing anymore. The backward sequence ended with -- the last sequence in the string. Note that seq1len -- is still zero. */ -- break; -- } -- else -- idx1now = --backw1; -- } -- else -- { -- backw1_stop = idx1max; -- -- while (*us1 != L('\0')) -- { -- int32_t tmp = findidx (&us1, -1); -- rule1arr[idx1max] = tmp >> 24; -- idx1arr[idx1max] = tmp & 0xffffff; -- idx1cnt = idx1max++; -- -- if ((rulesets[rule1arr[idx1cnt] * nrules] -- & sort_backward) == 0) -- /* No more backward characters to push. */ -- break; -- ++idx1cnt; -- } -- -- if (backw1_stop >= idx1cnt) -- { -- /* No sequence at all or just one. */ -- if (idx1cnt == idx1max || backw1_stop > idx1cnt) -- /* Note that seq1len is still zero. */ -- break; -- -- backw1_stop = ~0ul; -- idx1now = idx1cnt; -- } -- else -- /* We pushed backward sequences. */ -- idx1now = backw1 = idx1cnt - 1; -- } -- } -- while ((seq1len = weights[idx1arr[idx1now]++]) == 0); -- -- /* And the same for string `s2'. */ -- if (seq2len == 0) -- do -- { -- ++val2; -- -- if (backw2_stop != ~0ul) -- { -- /* The is something pushed. */ -- if (backw2 == backw2_stop) -- { -- /* The last pushed character was handled. Continue -- with forward characters. */ -- if (idx2cnt < idx2max) -- { -- idx2now = idx2cnt; -- backw2_stop = ~0ul; -- } -- else -- /* Nothing anymore. The backward sequence ended with -- the last sequence in the string. Note that seq2len -- is still zero. */ -- break; -- } -- else -- idx2now = --backw2; -- } -- else -- { -- backw2_stop = idx2max; -- -- while (*us2 != L('\0')) -- { -- int32_t tmp = findidx (&us2, -1); -- rule2arr[idx2max] = tmp >> 24; -- idx2arr[idx2max] = tmp & 0xffffff; -- idx2cnt = idx2max++; -- -- if ((rulesets[rule2arr[idx2cnt] * nrules] -- & sort_backward) == 0) -- /* No more backward characters to push. */ -- break; -- ++idx2cnt; -- } -- -- if (backw2_stop >= idx2cnt) -- { -- /* No sequence at all or just one. */ -- if (idx2cnt == idx2max || backw2_stop > idx2cnt) -- /* Note that seq1len is still zero. */ -- break; -- -- backw2_stop = ~0ul; -- idx2now = idx2cnt; -- } -- else -- /* We pushed backward sequences. */ -- idx2now = backw2 = idx2cnt - 1; -- } -- } -- while ((seq2len = weights[idx2arr[idx2now]++]) == 0); -- -- /* See whether any or both strings are empty. */ -- if (seq1len == 0 || seq2len == 0) -- { -- if (seq1len == seq2len) -- /* Both ended. So far so good, both strings are equal at the -- first level. */ -- break; -- -- /* This means one string is shorter than the other. Find out -- which one and return an appropriate value. */ -- result = seq1len == 0 ? -1 : 1; -- goto free_and_return; -- } -- -- /* Test for position if necessary. */ -- if (position && val1 != val2) -- { -- result = val1 - val2; -- goto free_and_return; -- } - -- /* Compare the two sequences. */ -- do -- { -- if (weights[idx1arr[idx1now]] != weights[idx2arr[idx2now]]) -- { -- /* The sequences differ. */ -- result = weights[idx1arr[idx1now]] - weights[idx2arr[idx2now]]; -- goto free_and_return; -- } -+ coll_seq seq1, seq2; -+ bool use_malloc = false; -+ int result = 0; - -- /* Increment the offsets. */ -- ++idx1arr[idx1now]; -- ++idx2arr[idx2now]; -+ memset (&seq1, 0, sizeof (seq1)); -+ seq2 = seq1; - -- --seq1len; -- --seq2len; -- } -- while (seq1len > 0 && seq2len > 0); -+ size_t size_max = SIZE_MAX / (sizeof (int32_t) + 1); - -- if (position && seq1len != seq2len) -+ if (MIN (s1len, s2len) > size_max -+ || MAX (s1len, s2len) > size_max - MIN (s1len, s2len)) -+ { -+ /* If the strings are long enough to cause overflow in the size request, -+ then skip the allocation and proceed with the non-cached routines. */ -+ } -+ else if (! __libc_use_alloca ((s1len + s2len) * (sizeof (int32_t) + 1))) -+ { -+ seq1.idxarr = (int32_t *) malloc ((s1len + s2len) * (sizeof (int32_t) + 1)); -+ -+ /* If we failed to allocate memory, we leave everything as NULL so that -+ we use the nocache version of traversal and comparison functions. */ -+ if (seq1.idxarr != NULL) - { -- result = seq1len - seq2len; -- goto free_and_return; -+ seq2.idxarr = &seq1.idxarr[s1len]; -+ seq1.rulearr = (unsigned char *) &seq2.idxarr[s2len]; -+ seq2.rulearr = &seq1.rulearr[s1len]; -+ use_malloc = true; - } - } -+ else -+ { -+ seq1.idxarr = (int32_t *) alloca (s1len * sizeof (int32_t)); -+ seq2.idxarr = (int32_t *) alloca (s2len * sizeof (int32_t)); -+ seq1.rulearr = (unsigned char *) alloca (s1len); -+ seq2.rulearr = (unsigned char *) alloca (s2len); -+ } -+ -+ int rule = 0; - -- /* Now the remaining passes over the weights. We now use the -- indeces we found before. */ -- for (pass = 1; pass < nrules; ++pass) -+ /* Cache values in the first pass and if needed, use them in subsequent -+ passes. */ -+ for (int pass = 0; pass < nrules; ++pass) - { -+ seq1.idxcnt = 0; -+ seq1.idx = 0; -+ seq2.idx = 0; -+ seq1.backw_stop = ~0ul; -+ seq1.backw = ~0ul; -+ seq2.idxcnt = 0; -+ seq2.backw_stop = ~0ul; -+ seq2.backw = ~0ul; -+ -+ /* We need the elements of the strings as unsigned values since they -+ are used as indices. */ -+ seq1.us = (const USTRING_TYPE *) s1; -+ seq2.us = (const USTRING_TYPE *) s2; -+ - /* We assume that if a rule has defined `position' in one section - this is true for all of them. */ -- idx1cnt = 0; -- idx2cnt = 0; -- backw1_stop = ~0ul; -- backw2_stop = ~0ul; -- backw1 = ~0ul; -- backw2 = ~0ul; -- position = rulesets[rule1arr[0] * nrules + pass] & sort_position; -+ int position = rulesets[rule * nrules + pass] & sort_position; - - while (1) - { -- val1 = 0; -- val2 = 0; -- -- /* Get the next non-IGNOREd element for string `s1'. */ -- if (seq1len == 0) -- do -- { -- ++val1; -- -- if (backw1_stop != ~0ul) -- { -- /* The is something pushed. */ -- if (backw1 == backw1_stop) -- { -- /* The last pushed character was handled. Continue -- with forward characters. */ -- if (idx1cnt < idx1max) -- { -- idx1now = idx1cnt; -- backw1_stop = ~0ul; -- } -- else -- { -- /* Nothing anymore. The backward sequence -- ended with the last sequence in the string. */ -- idx1now = ~0ul; -- break; -- } -- } -- else -- idx1now = --backw1; -- } -- else -- { -- backw1_stop = idx1cnt; -- -- while (idx1cnt < idx1max) -- { -- if ((rulesets[rule1arr[idx1cnt] * nrules + pass] -- & sort_backward) == 0) -- /* No more backward characters to push. */ -- break; -- ++idx1cnt; -- } -- -- if (backw1_stop == idx1cnt) -- { -- /* No sequence at all or just one. */ -- if (idx1cnt == idx1max) -- /* Note that seq1len is still zero. */ -- break; -- -- backw1_stop = ~0ul; -- idx1now = idx1cnt++; -- } -- else -- /* We pushed backward sequences. */ -- idx1now = backw1 = idx1cnt - 1; -- } -- } -- while ((seq1len = weights[idx1arr[idx1now]++]) == 0); -- -- /* And the same for string `s2'. */ -- if (seq2len == 0) -- do -- { -- ++val2; -- -- if (backw2_stop != ~0ul) -- { -- /* The is something pushed. */ -- if (backw2 == backw2_stop) -- { -- /* The last pushed character was handled. Continue -- with forward characters. */ -- if (idx2cnt < idx2max) -- { -- idx2now = idx2cnt; -- backw2_stop = ~0ul; -- } -- else -- { -- /* Nothing anymore. The backward sequence -- ended with the last sequence in the string. */ -- idx2now = ~0ul; -- break; -- } -- } -- else -- idx2now = --backw2; -- } -- else -- { -- backw2_stop = idx2cnt; -- -- while (idx2cnt < idx2max) -- { -- if ((rulesets[rule2arr[idx2cnt] * nrules + pass] -- & sort_backward) == 0) -- /* No more backward characters to push. */ -- break; -- ++idx2cnt; -- } -- -- if (backw2_stop == idx2cnt) -- { -- /* No sequence at all or just one. */ -- if (idx2cnt == idx2max) -- /* Note that seq2len is still zero. */ -- break; -- -- backw2_stop = ~0ul; -- idx2now = idx2cnt++; -- } -- else -- /* We pushed backward sequences. */ -- idx2now = backw2 = idx2cnt - 1; -- } -- } -- while ((seq2len = weights[idx2arr[idx2now]++]) == 0); -+ if (__glibc_unlikely (seq1.idxarr == NULL)) -+ { -+ get_next_seq_nocache (&seq1, nrules, rulesets, weights, table, -+ extra, indirect, pass); -+ get_next_seq_nocache (&seq2, nrules, rulesets, weights, table, -+ extra, indirect, pass); -+ } -+ else if (pass == 0) -+ { -+ get_next_seq (&seq1, nrules, rulesets, weights, table, extra, -+ indirect); -+ get_next_seq (&seq2, nrules, rulesets, weights, table, extra, -+ indirect); -+ } -+ else -+ { -+ get_next_seq_cached (&seq1, nrules, pass, rulesets, weights); -+ get_next_seq_cached (&seq2, nrules, pass, rulesets, weights); -+ } - - /* See whether any or both strings are empty. */ -- if (seq1len == 0 || seq2len == 0) -+ if (seq1.len == 0 || seq2.len == 0) - { -- if (seq1len == seq2len) -+ if (seq1.len == seq2.len) - /* Both ended. So far so good, both strings are equal - at this level. */ - break; - - /* This means one string is shorter than the other. Find out - which one and return an appropriate value. */ -- result = seq1len == 0 ? -1 : 1; -+ result = seq1.len == 0 ? -1 : 1; - goto free_and_return; - } - -- /* Test for position if necessary. */ -- if (position && val1 != val2) -- { -- result = val1 - val2; -- goto free_and_return; -- } -- -- /* Compare the two sequences. */ -- do -- { -- if (weights[idx1arr[idx1now]] != weights[idx2arr[idx2now]]) -- { -- /* The sequences differ. */ -- result = (weights[idx1arr[idx1now]] -- - weights[idx2arr[idx2now]]); -- goto free_and_return; -- } -- -- /* Increment the offsets. */ -- ++idx1arr[idx1now]; -- ++idx2arr[idx2now]; -- -- --seq1len; -- --seq2len; -- } -- while (seq1len > 0 && seq2len > 0); -- -- if (position && seq1len != seq2len) -- { -- result = seq1len - seq2len; -- goto free_and_return; -- } -+ if (__glibc_unlikely (seq1.idxarr == NULL)) -+ result = do_compare_nocache (&seq1, &seq2, position, weights); -+ else -+ result = do_compare (&seq1, &seq2, position, weights); -+ if (result != 0) -+ goto free_and_return; - } -+ -+ if (__glibc_likely (seq1.rulearr != NULL)) -+ rule = seq1.rulearr[0]; -+ else -+ rule = seq1.rule; - } - - /* Free the memory if needed. */ - free_and_return: - if (use_malloc) -- free (idx1arr); -+ free (seq1.idxarr); - - return result; - } -Index: glibc-2.18/string/tst-strcoll-overflow.c -=================================================================== ---- /dev/null -+++ glibc-2.18/string/tst-strcoll-overflow.c -@@ -0,0 +1,61 @@ -+/* 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 -+ . */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+/* Verify that strcoll does not crash for large strings for which it cannot -+ cache weight lookup results. The size is large enough to cause integer -+ overflows on 32-bit as well as buffer overflows on 64-bit. The test should -+ work reasonably reliably when overcommit is disabled, but it obviously -+ depends on how much memory the system has. There's a limitation to this -+ test in that it does not run to completion. Actually collating such a -+ large string can take days and we can't have xcheck running that long. For -+ that reason, we run the test for about 5 minutes and then assume that -+ everything is fine if there are no crashes. */ -+#define SIZE 0x40000000ul -+ -+int -+do_test (void) -+{ -+ if (setlocale (LC_COLLATE, "en_GB.UTF-8") == NULL) -+ { -+ puts ("setlocale failed, cannot test for overflow"); -+ return 0; -+ } -+ -+ char *p = malloc (SIZE); -+ -+ if (p == NULL) -+ { -+ puts ("could not allocate memory"); -+ return 1; -+ } -+ -+ memset (p, 'x', SIZE - 1); -+ p[SIZE - 1] = 0; -+ printf ("%d\n", strcoll (p, p)); -+ return 0; -+} -+ -+#define TIMEOUT 300 -+#define EXPECTED_SIGNAL SIGALRM -+#define TEST_FUNCTION do_test () -+#include "../test-skeleton.c"