]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
9 years agoMerge branch 'release/2.19/master' into ibm/2.19/master ibm/2.19/master
Tulio Magno Quites Machado Filho [Mon, 11 Jul 2016 17:16:01 +0000 (14:16 -0300)] 
Merge branch 'release/2.19/master' into ibm/2.19/master

Conflicts:
NEWS

9 years agoHarden tls_dtor_list with pointer mangling [BZ #19018]
Florian Weimer [Tue, 6 Oct 2015 11:12:36 +0000 (13:12 +0200)] 
Harden tls_dtor_list with pointer mangling [BZ #19018]

(cherry picked from commit f586e1328681b400078c995a0bb6ad301ef73549)

Conflicts:
NEWS
stdlib/cxa_thread_atexit_impl.c

9 years agoAlways enable pointer guard [BZ #18928]
Florian Weimer [Thu, 15 Oct 2015 07:23:07 +0000 (09:23 +0200)] 
Always enable pointer guard [BZ #18928]

Honoring the LD_POINTER_GUARD environment variable in AT_SECURE mode
has security implications.  This commit enables pointer guard
unconditionally, and the environment variable is now ignored.

        [BZ #18928]
        * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
        _dl_pointer_guard member.
        * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
        initializer.
        (security_init): Always set up pointer guard.
        (process_envvars): Do not process LD_POINTER_GUARD.

(cherry picked from commit a014cecd82b71b70a6a843e250e06b541ad524f7)

Conflicts:
NEWS

9 years agoFix memory handling in strxfrm_l [BZ #16009]
Leonhard Holz [Tue, 13 Jan 2015 06:03:56 +0000 (11:33 +0530)] 
Fix memory handling in strxfrm_l [BZ #16009]

[Modified from the original email by Siddhesh Poyarekar]

This patch solves bug #16009 by implementing an additional path in
strxfrm that does not depend on caching the weight and rule indices.

In detail the following changed:

* The old main loop was factored out of strxfrm_l into the function
do_xfrm_cached to be able to alternativly use the non-caching version
do_xfrm.

* strxfrm_l allocates a a fixed size array on the stack. If this is not
sufficiant to store the weight and rule indices, the non-caching path is
taken. As the cache size is not dependent on the input there can be no
problems with integer overflows or stack allocations greater than
__MAX_ALLOCA_CUTOFF. Note that malloc-ing is not possible because the
definition of strxfrm does not allow an oom errorhandling.

* The uncached path determines the weight and rule index for every char
and for every pass again.

* Passing all the locale data array by array resulted in very long
parameter lists, so I introduced a structure that holds them.

* Checking for zero src string has been moved a bit upwards, it is
before the locale data initialization now.

* To verify that the non-caching path works correct I added a test run
to localedata/sort-test.sh & localedata/xfrm-test.c where all strings
are patched up with spaces so that they are too large for the caching path.

(cherry picked from commit 0f9e585480edcdf1e30dc3d79e24b84aeee516fa)

Conflicts:
NEWS
string/strxfrm_l.c

9 years agoCVE-2016-4429: sunrpc: Do not use alloca in clntudp_call [BZ #20112]
Florian Weimer [Mon, 23 May 2016 18:18:34 +0000 (20:18 +0200)] 
CVE-2016-4429: sunrpc: Do not use alloca in clntudp_call [BZ #20112]

The call is technically in a loop, and under certain circumstances
(which are quite difficult to reproduce in a test case), alloca
can be invoked repeatedly during a single call to clntudp_call.
As a result, the available stack space can be exhausted (even
though individual alloca sizes are bounded implicitly by what
can fit into a UDP packet, as a side effect of the earlier
successful send operation).

(cherry picked from commit bc779a1a5b3035133024b21e2f339fe4219fb11c)

9 years agoresolv: Always set *resplen2 out parameter in send_dg [BZ #19791]
Florian Weimer [Fri, 25 Mar 2016 10:49:51 +0000 (11:49 +0100)] 
resolv: Always set *resplen2 out parameter in send_dg [BZ #19791]

Since commit 44d20bca52ace85850012b0ead37b360e3ecd96e (Implement
second fallback mode for DNS requests), there is a code path which
returns early, before *resplen2 is initialized.  This happens if the
name server address is immediately recognized as invalid (because of
lack of protocol support, or if it is a broadcast address such
255.255.255.255, or another invalid address).

If this happens and *resplen2 was non-zero (which is the case if a
previous query resulted in a failure), __libc_res_nquery would reuse
an existing second answer buffer.  This answer has been previously
identified as unusable (for example, it could be an NXDOMAIN
response).  Due to the presence of a second answer, no name server
switching will occur.  The result is a name resolution failure,
although a successful resolution would have been possible if name
servers have been switched and queries had proceeded along the search
path.

The above paragraph still simplifies the situation.  Before glibc
2.23, if the second answer needed malloc, the stub resolver would
still attempt to reuse the second answer, but this is not possible
because __libc_res_nsearch has freed it, after the unsuccessful call
to __libc_res_nquerydomain, and set the buffer pointer to NULL.  This
eventually leads to an assertion failure in __libc_res_nquery:

/* Make sure both hp and hp2 are defined */
assert((hp != NULL) && (hp2 != NULL));

If assertions are disabled, the consequence is a NULL pointer
dereference on the next line.

Starting with glibc 2.23, as a result of commit
e9db92d3acfe1822d56d11abcea5bfc4c41cf6ca (CVE-2015-7547: getaddrinfo()
stack-based buffer overflow (Bug 18665)), the second answer is always
allocated with malloc.  This means that the assertion failure happens
with small responses as well because there is no buffer to reuse, as
soon as there is a name resolution failure which triggers a search for
an answer along the search path.

This commit addresses the issue by ensuring that *resplen2 is
initialized before the send_dg function returns.

This commit also addresses a bug where an invalid second reply is
incorrectly returned as a valid to the caller.

(cherry picked from commit b66d837bb5398795c6b0f651bd5a5d66091d8577)

9 years agoCVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).
Carlos O'Donell [Wed, 17 Feb 2016 02:26:37 +0000 (21:26 -0500)] 
CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug 18665).

* A stack-based buffer overflow was found in libresolv when invoked from
  libnss_dns, allowing specially crafted DNS responses to seize control
  of execution flow in the DNS client.  The buffer overflow occurs in
  the functions send_dg (send datagram) and send_vc (send TCP) for the
  NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC
  family.  The use of AF_UNSPEC triggers the low-level resolver code to
  send out two parallel queries for A and AAAA.  A mismanagement of the
  buffers used for those queries could result in the response of a query
  writing beyond the alloca allocated buffer created by
  _nss_dns_gethostbyname4_r.  Buffer management is simplified to remove
  the overflow.  Thanks to the Google Security Team and Red Hat for
  reporting the security impact of this issue, and Robert Holiday of
  Ciena for reporting the related bug 18665. (CVE-2015-7547)

See also:
https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html
https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html

(cherry picked from commit e9db92d3acfe1822d56d11abcea5bfc4c41cf6ca)

9 years agoCVE-2016-3706: getaddrinfo: stack overflow in hostent conversion [BZ #20010]
Florian Weimer [Fri, 29 Apr 2016 08:35:34 +0000 (10:35 +0200)] 
CVE-2016-3706: getaddrinfo: stack overflow in hostent conversion [BZ #20010]

When converting a struct hostent response to struct gaih_addrtuple, the
gethosts macro (which is called from gaih_inet) used alloca, without
malloc fallback for large responses.  This commit changes this code to
use calloc unconditionally.

This commit also consolidated a second hostent-to-gaih_addrtuple
conversion loop (in gaih_inet) to use the new conversion function.

(cherry picked from commit 4ab2ab03d4351914ee53248dc5aef4a8c88ff8b9)

9 years agoCVE-2016-1234: glob: Do not copy d_name field of struct dirent [BZ #19779]
Florian Weimer [Wed, 4 May 2016 10:09:35 +0000 (12:09 +0200)] 
CVE-2016-1234: glob: Do not copy d_name field of struct dirent [BZ #19779]

Instead, we store the data we need from the return value of
readdir in an object of the new type struct readdir_result.
This type is independent of the layout of struct dirent.

(cherry picked from commit 5171f3079f2cc53e0548fc4967361f4d1ce9d7ea)

9 years agoglob: Simplify the interface for the GLOB_ALTDIRFUNC callback gl_readdir
Florian Weimer [Fri, 29 Apr 2016 07:33:07 +0000 (09:33 +0200)] 
glob: Simplify the interface for the GLOB_ALTDIRFUNC callback gl_readdir

Previously, application code had to set up the d_namlen member if
the target supported it, involving conditional compilation.  After
this change, glob will use the length of the string in d_name instead
of d_namlen to determine the file name length.  All glibc targets
provide the d_type and d_ino members, and setting them as needed for
gl_readdir is straightforward.

Changing the behavior with regards to d_ino is left to a future
cleanup.

(cherry picked from commit 137fe72eca6923a00381a3ca9f0e7672c1f85e3f)

9 years agoS390: Fix "backtrace() returns infinitely deep stack frames with makecontext()" ...
Stefan Liebler [Thu, 28 Apr 2016 08:21:58 +0000 (10:21 +0200)] 
S390: Fix "backtrace() returns infinitely deep stack frames with makecontext()" [BZ #18508].

On s390/s390x backtrace(buffer, size) returns the series of called functions until
"makecontext_ret" and additional entries (up to "size") with "makecontext_ret".
GDB-backtrace is also warning:
"Backtrace stopped: previous frame identical to this frame (corrupt stack?)"

To reproduce this scenario you have to setup a new context with makecontext()
and activate it with setcontext(). See e.g. cf() function in testcase stdlib/tst-makecontext.c.
Or see bug in libgo "Bug 66303 - runtime.Caller() returns infinitely deep stack frames
on s390x " (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66303).

This patch omits the cfi_startproc/cfi_endproc directives in ENTRY/END macro of
__makecontext_ret. Thus no frame information is generated in .eh_frame and backtrace
stops after __makecontext_ret. There is also no .eh_frame info for _start or
thread_start functions.

ChangeLog:

[BZ #18508]
* stdlib/Makefile ($(objpfx)tst-makecontext3):
Depend on $(libdl).
* stdlib/tst-makecontext.c (cf): Test if _Unwind_Backtrace
is not called infinitely times.
(backtrace_helper): New function.
(trace_arg): New struct.
(st1): Enlarge stack size.
* sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S:
(__makecontext_ret): Omit cfi_startproc and cfi_endproc.
* sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S:
Likewise.

(cherry picked from commit 890b7a4b33d482b5c768ab47d70758b80227e9bc)

9 years agoS/390: Fix setcontext/swapcontext which are not restoring sigmask. [BZ #18080]
Stefan Liebler [Thu, 28 Apr 2016 08:12:05 +0000 (10:12 +0200)] 
S/390: Fix setcontext/swapcontext which are not restoring sigmask. [BZ #18080]

This patch uses sigprocmask(SIG_SETMASK) instead of SIG_BLOCK
in setcontext, swapcontext.

(cherry picked from commit 2e807f29595eb5b1e5d0decc6e356a3562ecc58e)

9 years agoCVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]
Florian Weimer [Tue, 29 Mar 2016 10:57:56 +0000 (12:57 +0200)] 
CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]

The defensive copy is not needed because the name may not alias the
output buffer.

(cherry picked from commit 317b199b4aff8cfa27f2302ab404d2bb5032b9a4)

9 years agohsearch_r: Apply VM size limit in test case
Florian Weimer [Fri, 12 Feb 2016 11:57:40 +0000 (12:57 +0100)] 
hsearch_r: Apply VM size limit in test case

(cherry picked from commit f34f146e682d8d529dcf64b3c2781bf3f2f05f6c)

9 years agoImprove check against integer wraparound in hcreate_r [BZ #18240]
Florian Weimer [Thu, 28 Jan 2016 12:59:11 +0000 (13:59 +0100)] 
Improve check against integer wraparound in hcreate_r [BZ #18240]

(cherry picked from commit bae7c7c764413b23e61cb099ce33be4c4ee259bb)

9 years agoHandle overflow in __hcreate_r
Ondřej Bílka [Sat, 11 Jul 2015 15:44:10 +0000 (17:44 +0200)] 
Handle overflow in __hcreate_r

Hi,

As in bugzilla entry there is overflow in hsearch when looking for prime
number as SIZE_MAX - 1 is divisible by 5. We fix that by rejecting large
inputs before looking for prime.

* misc/hsearch_r.c (__hcreate_r): Handle overflow.

(cherry picked from commit 2f5c1750558fe64bac361f52d6827ab1bcfe52bc)

9 years agoFix BZ #18985 -- out of range data to strftime() causes a segfault
Paul Pluzhnikov [Sat, 26 Sep 2015 20:27:48 +0000 (13:27 -0700)] 
Fix BZ #18985 -- out of range data to strftime() causes a segfault

(cherry picked from commit d36c75fc0d44deec29635dd239b0fbd206ca49b7)

9 years agoFix trailing space.
Paul Pluzhnikov [Sat, 8 Aug 2015 22:54:40 +0000 (15:54 -0700)] 
Fix trailing space.

(cherry picked from commit 7565d2a862683a3c26ffb1f32351b8c5ab9f7b31)

9 years agoFix BZ #17905
Paul Pluzhnikov [Sat, 8 Aug 2015 22:53:03 +0000 (15:53 -0700)] 
Fix BZ #17905

(cherry picked from commit 0f58539030e436449f79189b6edab17d7479796e)

9 years agoAvoid overlapping addresses to stpcpy calls in nscd (BZ #16760)
Siddhesh Poyarekar [Thu, 27 Mar 2014 14:18:15 +0000 (19:48 +0530)] 
Avoid overlapping addresses to stpcpy calls in nscd (BZ #16760)

Calls to stpcpy from nscd netgroups code will have overlapping source
and destination when all three values in the returned triplet are
non-NULL and in the expected (host,user,domain) order.  This is seen
in valgrind as:

==3181== Source and destination overlap in stpcpy(0x19973b48, 0x19973b48)
==3181==    at 0x4C2F30A: stpcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3181==    by 0x12567A: addgetnetgrentX (string3.h:111)
==3181==    by 0x12722D: addgetnetgrent (netgroupcache.c:665)
==3181==    by 0x11114C: nscd_run_worker (connections.c:1338)
==3181==    by 0x4E3C102: start_thread (pthread_create.c:309)
==3181==    by 0x59B81AC: clone (clone.S:111)
==3181==

Fix this by using memmove instead of stpcpy.

(cherry picked from commit ea7d8b95e2fcb81f68b04ed7787a3dbda023991a)

9 years agoReturn NULL for wildcard values in getnetgrent from nscd (BZ #16759)
Siddhesh Poyarekar [Thu, 27 Mar 2014 14:19:51 +0000 (19:49 +0530)] 
Return NULL for wildcard values in getnetgrent from nscd (BZ #16759)

getnetgrent is supposed to return NULL for values that are wildcards
in the (host, user, domain) triplet.  This works correctly with nscd
disabled, but with it enabled, it returns a blank ("") instead of a
NULL.  This is easily seen with the output of `getent netgroup foonet`
for a netgroup foonet defined as follows in /etc/netgroup:

    foonet (,foo,)

The output with nscd disabled is:

    foonet ( ,foo,)

while with nscd enabled, it is:

    foonet (,foo,)

The extra space with nscd disabled is due to the fact that `getent
netgroup` adds it if the return value from getnetgrent is NULL for
either host or user.

(cherry picked from commit dd3022d75e6fb8957843d6d84257a5d8457822d5)

9 years agoFix nscd lookup for innetgr when netgroup has wildcards (BZ #16758)
Siddhesh Poyarekar [Thu, 27 Mar 2014 01:45:22 +0000 (07:15 +0530)] 
Fix nscd lookup for innetgr when netgroup has wildcards (BZ #16758)

nscd works correctly when the request in innetgr is a wildcard,
i.e. when one or more of host, user or domain parameters is NULL.
However, it does not work when the the triplet in the netgroup
definition has a wildcard.  This is easy to reproduce for a triplet
defined as follows:

    foonet (,foo,)

Here, an innetgr call that looks like this:

    innetgr ("foonet", "foohost", "foo", NULL);

should succeed and so should:

    innetgr ("foonet", NULL, "foo", "foodomain");

It does succeed with nscd disabled, but not with nscd enabled.  This
fix adds this additional check for all three parts of the triplet so
that it gives the correct result.

[BZ #16758]
* nscd/netgroupcache.c (addinnetgrX): Succeed if triplet has
blank values.

(cherry picked from commit fbd6b5a4052316f7eb03c4617eebfaafc59dcc06)

9 years agoRe-sort the list of bugs fixed
Tulio Magno Quites Machado Filho [Thu, 26 Nov 2015 18:53:24 +0000 (16:53 -0200)] 
Re-sort the list of bugs fixed

Fix a bug number that was out of order.

9 years agoMerge branch 'release/2.19/master' into ibm/2.19/master
Tulio Magno Quites Machado Filho [Tue, 24 Nov 2015 14:07:51 +0000 (12:07 -0200)] 
Merge branch 'release/2.19/master' into ibm/2.19/master

Conflicts:
NEWS
nss/nss_files/files-XXX.c

9 years agoDon't read past end of pattern in fnmatch (BZ #17062)
Andreas Schwab [Wed, 18 Jun 2014 09:58:45 +0000 (11:58 +0200)] 
Don't read past end of pattern in fnmatch (BZ #17062)

(cherry picked from commit b3a9f56ba59c3d8eadd3135a1c25c37a63151450)

Conflicts:
NEWS
posix/Makefile

9 years agoCVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]
Florian Weimer [Wed, 29 Apr 2015 12:41:25 +0000 (14:41 +0200)] 
CVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]

Robin Hack discovered Samba would enter an infinite loop processing
certain quota-related requests.  We eventually tracked this down to a
glibc issue.

Running a (simplified) test case under strace shows that /etc/passwd
is continuously opened and closed:


open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0


The lookup function implementation in
nss/nss_files/files-XXX.c:DB_LOOKUP has code to prevent that.  It is
supposed skip closing the input file if it was already open.

  /* Reset file pointer to beginning or open file.  */       \
  status = internal_setent (keep_stream);       \
      \
  if (status == NSS_STATUS_SUCCESS)       \
    {       \
      /* Tell getent function that we have repositioned the file pointer.  */ \
      last_use = getby;       \
      \
      while ((status = internal_getent (result, buffer, buflen, errnop       \
H_ERRNO_ARG EXTRA_ARGS_VALUE))       \
     == NSS_STATUS_SUCCESS)       \
{ break_if_match }       \
      \
      if (! keep_stream)       \
internal_endent ();       \
    }       \

keep_stream is initialized from the stayopen flag in internal_setent.
internal_setent is called from the set*ent implementation as:

  status = internal_setent (stayopen);

However, for non-host database, this flag is always 0, per the
STAYOPEN magic in nss/getXXent_r.c.

Thus, the fix is this:

-  status = internal_setent (stayopen);
+  status = internal_setent (1);

This is not a behavioral change even for the hosts database (where the
application can specify the stayopen flag) because with a call to
sethostent(0), the file handle is still not closed in the
implementation of gethostent.

(cherry picked from commit 03d2730b44cc2236318fd978afa2651753666c55)

Conflicts:
ChangeLog
NEWS

9 years agoFix BZ #17269 -- _IO_wstr_overflow integer overflow
Paul Pluzhnikov [Sun, 22 Feb 2015 20:01:47 +0000 (12:01 -0800)] 
Fix BZ #17269 -- _IO_wstr_overflow integer overflow

(cherry picked from commit bdf1ff052a8e23d637f2c838fa5642d78fcedc33)

Conflicts:
ChangeLog
NEWS

9 years agoFix read past end of pattern in fnmatch (bug 18032)
Andreas Schwab [Thu, 26 Feb 2015 13:55:24 +0000 (14:55 +0100)] 
Fix read past end of pattern in fnmatch (bug 18032)

(cherry picked from commit 4a28f4d55a6cc33474c0792fe93b5942d81bf185)

Conflicts:
ChangeLog
NEWS

9 years agoDon't ignore too long lines in nss_files (BZ #17079)
Andreas Schwab [Mon, 23 Jun 2014 08:24:45 +0000 (10:24 +0200)] 
Don't ignore too long lines in nss_files (BZ #17079)

(cherry picked from commit ac60763eac3d43b7234dd21286ad3ec3f17957fc)

Conflicts:
ChangeLog
NEWS

9 years agoFix parsing of getai result from nscd for IPv6-only request
Andreas Schwab [Wed, 7 May 2014 09:47:20 +0000 (11:47 +0200)] 
Fix parsing of getai result from nscd for IPv6-only request

(cherry picked from commit 8dc9751764eb1bedf06d19695524b31a16773413)

9 years agoCorrect DT_PPC64_NUM
Alan Modra [Mon, 14 Jul 2014 11:44:50 +0000 (21:14 +0930)] 
Correct DT_PPC64_NUM

[BZ #17153]
* elf/elf.h (DT_PPC64_NUM): Correct value.
* NEWS: Add to fixed bug list.

(cherry picked from commit f6c44d475104e931bab2b4ffa499961088de673c)

Conflicts:
NEWS

9 years agoFix use of half-initialized result in getaddrinfo when using nscd (bug 16743)
Andreas Schwab [Thu, 20 Mar 2014 14:05:25 +0000 (15:05 +0100)] 
Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743)

This fixes a bug in the way the results from __nscd_getai are collected:
for every returned result a new entry is first added to the
gaih_addrtuple list, but if that result doesn't match the request this
entry remains uninitialized.  So for this non-matching result an extra
result with uninitialized content is returned.

To reproduce (with nscd running):

$ getent ahostsv4 localhost
127.0.0.1       STREAM localhost
127.0.0.1       DGRAM
127.0.0.1       RAW
(null)          STREAM
(null)          DGRAM
(null)          RAW

(cherry picked from commit a071766ebfd853179ac39f9773f894029bf86d36)

Conflicts:
ChangeLog
NEWS

9 years agoCVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]
Arjun Shankar [Tue, 21 Apr 2015 12:06:31 +0000 (14:06 +0200)] 
CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]

(cherry picked from commit 2959eda9272a033863c271aff62095abd01bd4e3)

9 years agoProperly handle forced elision in pthread_mutex_trylock (bug 16657)
Andreas Schwab [Tue, 4 Mar 2014 12:00:26 +0000 (13:00 +0100)] 
Properly handle forced elision in pthread_mutex_trylock (bug 16657)

(cherry picked from commit b0a3c1640ab2fb7d16d9b9a8d9c0e524e9cb0001)

9 years agoPowerPC: Fix gprof entry point for LE
Adhemerval Zanella [Tue, 29 Jul 2014 18:56:44 +0000 (13:56 -0500)] 
PowerPC: Fix gprof entry point for LE

This patch fixes the ELFv2 gprof entry point since the ABI
does not define function descriptors.  It fixes BZ#17213.

Conflicts:
NEWS

10 years agoSeparate internal state between getXXent and getXXbyYY NSS calls (bug 18007)
Andreas Schwab [Wed, 25 Mar 2015 15:35:46 +0000 (16:35 +0100)] 
Separate internal state between getXXent and getXXbyYY NSS calls (bug 18007)

Conflicts:
NEWS

10 years agoCVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]
Florian Weimer [Wed, 29 Apr 2015 12:41:25 +0000 (14:41 +0200)] 
CVE-2014-8121: Do not close NSS files database during iteration [BZ #18007]

Robin Hack discovered Samba would enter an infinite loop processing
certain quota-related requests.  We eventually tracked this down to a
glibc issue.

Running a (simplified) test case under strace shows that /etc/passwd
is continuously opened and closed:


open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0
lseek(3, 0, SEEK_SET)                   = 0
read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2717
lseek(3, 2717, SEEK_SET)                = 2717
close(3)                                = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
lseek(3, 0, SEEK_CUR)                   = 0


The lookup function implementation in
nss/nss_files/files-XXX.c:DB_LOOKUP has code to prevent that.  It is
supposed skip closing the input file if it was already open.

  /* Reset file pointer to beginning or open file.  */       \
  status = internal_setent (keep_stream);       \
      \
  if (status == NSS_STATUS_SUCCESS)       \
    {       \
      /* Tell getent function that we have repositioned the file pointer.  */ \
      last_use = getby;       \
      \
      while ((status = internal_getent (result, buffer, buflen, errnop       \
H_ERRNO_ARG EXTRA_ARGS_VALUE))       \
     == NSS_STATUS_SUCCESS)       \
{ break_if_match }       \
      \
      if (! keep_stream)       \
internal_endent ();       \
    }       \

keep_stream is initialized from the stayopen flag in internal_setent.
internal_setent is called from the set*ent implementation as:

  status = internal_setent (stayopen);

However, for non-host database, this flag is always 0, per the
STAYOPEN magic in nss/getXXent_r.c.

Thus, the fix is this:

-  status = internal_setent (stayopen);
+  status = internal_setent (1);

This is not a behavioral change even for the hosts database (where the
application can specify the stayopen flag) because with a call to
sethostent(0), the file handle is still not closed in the
implementation of gethostent.

Conflicts:
NEWS

10 years agoCVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]
Arjun Shankar [Tue, 21 Apr 2015 12:06:31 +0000 (14:06 +0200)] 
CVE-2015-1781: resolv/nss_dns/dns-host.c buffer overflow [BZ#18287]

Conflicts:
NEWS
resolv/nss_dns/dns-host.c

10 years agoMerge branch 'release/2.19/master' into ibm/2.19/master
Tulio Magno Quites Machado Filho [Fri, 13 Mar 2015 15:13:50 +0000 (12:13 -0300)] 
Merge branch 'release/2.19/master' into ibm/2.19/master

10 years agopowerpc: Fix incorrect results for pow when using FMA
Adhemerval Zanella [Tue, 10 Mar 2015 13:38:54 +0000 (09:38 -0400)] 
powerpc: Fix incorrect results for pow when using FMA

This patch adds no FMA generation for e_pow to avoid precision issues
for powerpc.  This fixes BZ#18104.

10 years agoCVE-2015-1472: wscanf allocates too little memory
Paul Pluzhnikov [Fri, 6 Feb 2015 05:30:42 +0000 (00:30 -0500)] 
CVE-2015-1472: wscanf allocates too little memory

BZ #16618

Under certain conditions wscanf can allocate too little memory for the
to-be-scanned arguments and overflow the allocated buffer.  The
implementation now correctly computes the required buffer size when
using malloc.

A regression test was added to tst-sscanf.

Conflicts:
ChangeLog
NEWS

10 years agoCVE-2014-7817: wordexp fails to honour WRDE_NOCMD.
Carlos O'Donell [Wed, 19 Nov 2014 16:44:12 +0000 (11:44 -0500)] 
CVE-2014-7817: wordexp fails to honour WRDE_NOCMD.

The function wordexp() fails to properly handle the WRDE_NOCMD
flag when processing arithmetic inputs in the form of "$((... ``))"
where "..." can be anything valid. The backticks in the arithmetic
epxression are evaluated by in a shell even if WRDE_NOCMD forbade
command substitution. This allows an attacker to attempt to pass
dangerous commands via constructs of the above form, and bypass
the WRDE_NOCMD flag. This patch fixes this by checking for WRDE_NOCMD
in exec_comm(), the only place that can execute a shell. All other
checks for WRDE_NOCMD are superfluous and removed.

We expand the testsuite and add 3 new regression tests of roughly
the same form but with a couple of nested levels.

On top of the 3 new tests we add fork validation to the WRDE_NOCMD
testing. If any forks are detected during the execution of a wordexp()
call with WRDE_NOCMD, the test is marked as failed. This is slightly
heuristic since vfork might be used in the future, but it provides a
higher level of assurance that no shells were executed as part of
command substitution with WRDE_NOCMD in effect. In addition it doesn't
require libpthread or libdl, instead we use the public implementation
namespace function __register_atfork (already part of the public ABI
for libpthread).

Tested on x86_64 with no regressions.

10 years agoLabel CVE-2014-9402 in NEWS
Allan McRae [Thu, 18 Dec 2014 01:01:43 +0000 (11:01 +1000)] 
Label CVE-2014-9402 in NEWS

10 years agoAvoid infinite loop in nss_dns getnetbyname [BZ #17630]
Florian Weimer [Mon, 15 Dec 2014 16:41:13 +0000 (17:41 +0100)] 
Avoid infinite loop in nss_dns getnetbyname [BZ #17630]

10 years agoCVE-2012-3406: Stack overflow in vfprintf [BZ #16617]
Jeff Law [Mon, 15 Dec 2014 09:09:32 +0000 (10:09 +0100)] 
CVE-2012-3406: Stack overflow in vfprintf [BZ #16617]

A larger number of format specifiers coudld cause a stack overflow,
potentially allowing to bypass _FORTIFY_SOURCE format string
protection.

10 years agoMention CVE-2014-4043 in NEWS
Allan McRae [Sat, 21 Jun 2014 07:23:55 +0000 (17:23 +1000)] 
Mention CVE-2014-4043 in NEWS

10 years agoposix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
Florian Weimer [Wed, 11 Jun 2014 21:12:52 +0000 (23:12 +0200)] 
posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)

POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.

10 years ago_nl_find_locale: Improve handling of crafted locale names [BZ #17137]
Florian Weimer [Mon, 12 May 2014 13:24:12 +0000 (15:24 +0200)] 
_nl_find_locale: Improve handling of crafted locale names [BZ #17137]

Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).

10 years ago__gconv_translit_find: Disable function [BZ #17187]
Florian Weimer [Tue, 26 Aug 2014 17:38:59 +0000 (19:38 +0200)] 
__gconv_translit_find: Disable function [BZ #17187]

This functionality has never worked correctly, and the implementation
contained a security vulnerability (CVE-2014-5119).

10 years agoCVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]
Florian Weimer [Wed, 3 Sep 2014 17:45:43 +0000 (19:45 +0200)] 
CVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]

These changes are based on the fix for BZ #14134 in commit
6e230d11837f3ae7b375ea69d7905f0d18eb79e5.

10 years ago[AArch64] End frame record chain correctly.
Renlin Li [Tue, 11 Nov 2014 15:50:07 +0000 (15:50 +0000)] 
[AArch64] End frame record chain correctly.

10 years agoCVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]
Florian Weimer [Wed, 3 Sep 2014 17:45:43 +0000 (19:45 +0200)] 
CVE-2014-6040: Crashes on invalid input in IBM gconv modules [BZ #17325]

These changes are based on the fix for BZ #14134 in commit
6e230d11837f3ae7b375ea69d7905f0d18eb79e5.

(cherry picked from commit 41488498b6d9440ee66ab033808cce8323bba7ac)

Conflicts:
NEWS
iconvdata/Makefile

10 years ago__gconv_translit_find: Disable function [BZ #17187]
Florian Weimer [Tue, 26 Aug 2014 17:38:59 +0000 (19:38 +0200)] 
__gconv_translit_find: Disable function [BZ #17187]

This functionality has never worked correctly, and the implementation
contained a security vulnerability (CVE-2014-5119).

(cherry picked from commit a1a6a401ab0a3c9f15fb7eaebbdcee24192254e8)
(cherry picked from commit f9df71e895d3552d557e783fdb9d133328195645)

Conflicts:
NEWS

10 years agoNEWS: Explain the s390 jmp_buf / ucontext_t ABI change reversal.
Stefan Liebler [Fri, 1 Aug 2014 07:48:17 +0000 (09:48 +0200)] 
NEWS: Explain the s390 jmp_buf / ucontext_t ABI change reversal.

(cherry picked from commit 95ee7fb13ba99ba265b49531c57e1cb8db629bc6)

Typo fix as in commit 45ef66289acbab17278a73512f9b2a9d8a7ca79d and
NEW enty adjusted to reflect revert occuring in 2.19.1 and 2.20.

Conflicts:
NEWS

10 years agoS/390: Revert the jmp_buf/ucontext_t ABI change
Stefan Liebler [Thu, 28 Aug 2014 06:53:13 +0000 (16:53 +1000)] 
S/390: Revert the jmp_buf/ucontext_t ABI change

Backport of commit 2f438e20ab591641760e97458d5d1569942eced5

10 years agomanual: Update the locale documentation
Florian Weimer [Wed, 28 May 2014 12:05:03 +0000 (14:05 +0200)] 
manual: Update the locale documentation

(cherry picked from commit 585367266923156ac6fb789939a923641ba5aaf4)

Conflicts:
manual/locale.texi

10 years ago_nl_find_locale: Improve handling of crafted locale names [BZ #17137]
Florian Weimer [Mon, 12 May 2014 13:24:12 +0000 (15:24 +0200)] 
_nl_find_locale: Improve handling of crafted locale names [BZ #17137]

Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).

(cherry picked from commit 4e8f95a0df7c2300b830ec12c0ae1e161bc8a8a3)

Addiational backporting fixes:
  Added tst-setlocale3-ENV to localedata/Makefile

Conflicts:
NEWS
localedata/Makefile

10 years agosetlocale: Use the heap for the copy of the locale argument
Florian Weimer [Wed, 28 May 2014 12:41:52 +0000 (14:41 +0200)] 
setlocale: Use the heap for the copy of the locale argument

This avoids alloca calls with potentially large arguments.

(cherry picked from commit d183645616b0533b3acee28f1a95570bffbdf50f)

10 years agoUse NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)
Siddhesh Poyarekar [Mon, 26 May 2014 06:10:08 +0000 (11:40 +0530)] 
Use NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)

The netgroups nss modules in the glibc tree use NSS_STATUS_UNAVAIL
(with errno as ERANGE) when the supplied buffer does not have
sufficient space for the result.  This is wrong, because the canonical
way to indicate insufficient buffer is to set the errno to ERANGE and
the status to NSS_STATUS_TRYAGAIN, as is used by all other modules.

This fixes nscd behaviour when the nss_ldap module returns
NSS_STATUS_TRYAGAIN to indicate that a netgroup entry is too long to
fit into the supplied buffer.

(cherry picked from commit c3ec475c5dd16499aa040908e11d382c3ded9692)

Conflicts:
NEWS

10 years agoProvide correct buffer length to netgroup queries in nscd (BZ #16695)
Siddhesh Poyarekar [Wed, 12 Mar 2014 11:57:22 +0000 (17:27 +0530)] 
Provide correct buffer length to netgroup queries in nscd (BZ #16695)

The buffer to query netgroup entries is allocated sufficient space for
the netgroup entries and the key to be appended at the end, but it
sends in an incorrect available length to the NSS netgroup query
functions, resulting in overflow of the buffer in some special cases.
The fix here is to factor in the key length when sending the available
buffer and buffer length to the query functions.

(cherry picked from commit c44496df2f090a56d3bf75df930592dac6bba46f)

Conflicts:
NEWS

10 years ago[BZ #16046] dl_iterate_phdr static executable test
Maciej W. Rozycki [Fri, 20 Jun 2014 20:52:53 +0000 (21:52 +0100)] 
[BZ #16046] dl_iterate_phdr static executable test

(cherry picked from commit 257ce7127e2f64a6a959b146786cd43de0e42b5f)

10 years agoFix another memory leak in regexp compiler (BZ #17069)
Andreas Schwab [Fri, 20 Jun 2014 10:41:27 +0000 (12:41 +0200)] 
Fix another memory leak in regexp compiler (BZ #17069)

(cherry picked from commit aa6ec754f3b4b1df81d186480c534b6486a1e6ee)

Conflicts:
NEWS

10 years agoFix memory leak in regexp compiler (BZ #17069)
Andreas Schwab [Thu, 19 Jun 2014 13:38:03 +0000 (15:38 +0200)] 
Fix memory leak in regexp compiler (BZ #17069)

(cherry picked from commit 4d43ef1e7434d7d419afbcd754931cb0c794763c)

Conflicts:
posix/Makefile

10 years agoFix invalid file descriptor reuse while sending DNS query (BZ #15946)
Andreas Schwab [Mon, 26 May 2014 16:01:31 +0000 (18:01 +0200)] 
Fix invalid file descriptor reuse while sending DNS query (BZ #15946)

(cherry picked from commit f9d2d03254a58d92635a311a42253eeed5a40a47)

Conflicts:
NEWS

10 years agoProperly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer
Andreas Schwab [Tue, 18 Feb 2014 09:57:25 +0000 (10:57 +0100)] 
Properly fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer

Instead of trying to guess whether the second buffer needs to be freed
set a flag at the place it is allocated

(cherry picked from commit ab09bf616ad527b249aca5f2a4956fd526f0712f)

10 years agoDeduplicate resolv/nss_dns/dns-host.c
Ondřej Bílka [Sun, 16 Feb 2014 11:59:23 +0000 (12:59 +0100)] 
Deduplicate resolv/nss_dns/dns-host.c

In resolv/nss_dns/dns-host.c one of code path duplicated code after
that. We merge these paths.

(cherry picked from commit ab7ac0f2cf8731fe4c3f3aea6088a7c0127b5725)

10 years agoFix memory leak in _nss_dns_gethostbyname4_r with big DNS answer
Andreas Schwab [Thu, 13 Feb 2014 10:01:57 +0000 (11:01 +0100)] 
Fix memory leak in _nss_dns_gethostbyname4_r with big DNS answer

(cherry picked from commit d668061994a7486a3ba9c7d5e7882d85a2883707)

Conflicts:
NEWS

10 years agoFix unbound stack use in NIS NSS module
Andreas Schwab [Thu, 8 May 2014 14:53:01 +0000 (16:53 +0200)] 
Fix unbound stack use in NIS NSS module

(cherry picked from commit 315eb1d86aea489cd6325fd1c2521dcfb4fc0e1c)

Conflicts:
NEWS

10 years agoMention CVE-2014-4043 in NEWS
Allan McRae [Sat, 21 Jun 2014 07:23:55 +0000 (17:23 +1000)] 
Mention CVE-2014-4043 in NEWS

(cherry picked from commit d03efb2f979defd473955a455d66b949961d26b2)

Conflicts:
NEWS

10 years agoposix_spawn_faction_addopen: Add missing string.h include directive
Stefan Liebler [Thu, 12 Jun 2014 12:15:25 +0000 (14:15 +0200)] 
posix_spawn_faction_addopen: Add missing string.h include directive

This is needed to avoid a PLT call on s390.

(cherry picked from commit 35a5e3e338ae17f3d42c60a708763c5d498fb840)

10 years agoPowerPC: Fix gprof entry point for LE
Adhemerval Zanella [Tue, 29 Jul 2014 18:56:44 +0000 (13:56 -0500)] 
PowerPC: Fix gprof entry point for LE

This patch fixes the ELFv2 gprof entry point since the ABI
does not define function descriptors.  It fixes BZ#17213.

This is a backport of a53fbd8e6cd2f69bdfa3431d616a5f332aea6664.

10 years agoCorrect DT_PPC64_NUM
Alan Modra [Mon, 14 Jul 2014 11:44:50 +0000 (21:14 +0930)] 
Correct DT_PPC64_NUM

[BZ #17153]
* elf/elf.h (DT_PPC64_NUM): Correct value.
* NEWS: Add to fixed bug list.

This is a backport of f6c44d475104e931bab2b4ffa499961088de673c.

10 years agoPowerPC: Cleanup powerpc memmove
Adhemerval Zanella [Tue, 8 Jul 2014 13:54:09 +0000 (08:54 -0500)] 
PowerPC: Cleanup powerpc memmove

Now that MEMCPY_OK_FOR_FWD_MEMMOVE should be define on memcopy.h there
is no need to specialized powerpc memmove implementation.  This patch
moves the define set to powerpc memcopy and cleanup its definition on
powerpc code.

10 years agoPowerPC: Fix compiler warnings
Adhemerval Zanella [Tue, 8 Jul 2014 13:49:54 +0000 (08:49 -0500)] 
PowerPC: Fix compiler warnings

This patch fixes some compiler due trailing data in #undef directives
and due missing prototypes.

10 years agoPowerPC: Add ifunc tests for memmove
Adhemerval Zanella [Tue, 8 Jul 2014 13:35:44 +0000 (08:35 -0500)] 
PowerPC: Add ifunc tests for memmove

This patch add the missing ifunc tests definition for memmove ppc32
optimization patch (commit 07aedd7).

This is a backport of 91f4b564bd7bedcd93e7047cad570ce292d6330b.

10 years agoPowerPC: Align power7 memcpy using VSX to quadword
Adhemerval Zanella [Wed, 25 Jun 2014 16:54:31 +0000 (11:54 -0500)] 
PowerPC: Align power7 memcpy using VSX to quadword

This patch changes power7 memcpy to use VSX instructions only when
memory is aligned to quardword.  It is to avoid unaligned kernel traps
on non-cacheable memory (for instance, memory-mapped I/O).

10 years agoPowerPC: optimized memmove for POWER7/PPC32
Adhemerval Zanella [Tue, 24 Jun 2014 13:47:52 +0000 (08:47 -0500)] 
PowerPC: optimized memmove for POWER7/PPC32

This patch adds a optimized memmove for power7 by using the optimized
power7 memcpy for forward copying.

10 years agoPowerPC: optimized memmove for POWER7/PPC64
Adhemerval Zanella [Fri, 20 Jun 2014 17:55:16 +0000 (12:55 -0500)] 
PowerPC: optimized memmove for POWER7/PPC64

This patch adds an optimized memmove optimization for POWER7/powerpc64.
Basically the idea is to use the memcpy for POWER7 on non-overlapped
memory regions and a optimized backward memcpy for memory regions
that overlap (similar to the idea of string/memmove.c).

The backward memcpy algorithm used is similar the one use for memcpy for
POWER7, with adjustments done for alignment.  The difference is memory
is always aligned to 16 bytes before using VSX/altivec instructions.

10 years agoPowerPC: memmove default implementation cleanup
Adhemerval Zanella [Tue, 24 Jun 2014 11:42:31 +0000 (06:42 -0500)] 
PowerPC: memmove default implementation cleanup

This patch removes the powerpc specific logic in memmove and instead
include default implementation with MEMCPY_OK_FOR_FWD_MEMMOVE defined.
This lead in a increase performance, since the constraints to use
memcpy in powerpc code are too restrictive and memcpy can be used for
any forward memmove.

This is a backport of d6f68bbef4427850c2901728a1d13efc0e687297.

10 years agoPowerPC: strcat optimization for PPC64/POWER7
Vidya Ranganathan [Thu, 12 Jun 2014 03:21:20 +0000 (22:21 -0500)] 
PowerPC: strcat optimization for PPC64/POWER7

This patch adds an ifunc power7 strcat symbol that uses the logic on
sysdeps/powerpc/strcat.c but call power7 strlen/strcpy symbols instead
of default ones.

This is a backport of bc8ea38590070604006399e42469087e943fc8ec.

10 years agoPowerPC: sync hwcap.h capabilities
Adhemerval Zanella [Mon, 23 Jun 2014 14:38:47 +0000 (09:38 -0500)] 
PowerPC: sync hwcap.h capabilities

Linux commit dd58a092c4202f2bd490adab7285b3ff77f8e467 added the
PPC_FEATURE2_VEC_CRYPTO auvx capability to indicate whether to
hardware supports vector crypto hardware instructions.  This patch
adds its definition to powerpc hwcap bits.

This is a backport of db22400947e1c82153e5270d23fed53fc1e3a659.

10 years agoPowerPC: Fix nearbyintl failure for few inputs
Rajalakshmi Srinivasaraghavan [Tue, 17 Jun 2014 13:46:25 +0000 (08:46 -0500)] 
PowerPC: Fix nearbyintl failure for few inputs

This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i  The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.

Fixes #17031.

This is a backport of 754c5a08aacb44895d1ab97c553ce424eb43f761.

11 years agoposix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
Florian Weimer [Wed, 11 Jun 2014 21:12:52 +0000 (23:12 +0200)] 
posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)

POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.

(cherry picked from commit 89e435f3559c53084498e9baad22172b64429362)

Conflicts:
NEWS

11 years agoPowerPC: Optimized strcmp for PPC64/POWER7
Vidya Ranganathan [Fri, 6 Jun 2014 12:56:07 +0000 (07:56 -0500)] 
PowerPC: Optimized strcmp for PPC64/POWER7

Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.

It is a backport of e23d3d2690bf63207b1a47e83a94693daebbbfe5.

11 years agoPowerPC: Fix optimized strncat strlen call
Adhemerval Zanella [Fri, 6 Jun 2014 14:37:07 +0000 (09:37 -0500)] 
PowerPC: Fix optimized strncat strlen call

This patch fixes the optimized ppc64/power7 strncat strlen call for
static build without ifunc enabled.  The strlen symbol to call in such
situation is just strlen, instead of __GI_strlen (since the __GI_
alias is just created for shared objects).

It is a backport of ed36bfa18faf9be457575568e64b8409e46caa22.

11 years agoPowerPC: Fix --disable-multi-arch builds
Adhemerval Zanella [Tue, 8 Apr 2014 22:25:14 +0000 (17:25 -0500)] 
PowerPC: Fix --disable-multi-arch builds

This patch fixes some powerpc32 and powerpc64 builds with
--disable-multi-arch option along with different --with-cpu=powerN.
It cleanups the Implies directories by removing the multiarch
folder for non multiarch config and also fixing two assembly
implementations: powerpc64/power7/strncat.S that is calling the
wrong strlen; and power8/fpu/s_isnan.S that misses the hidden_def and
weak_alias directives.

It is a backport of de21c33c068c8e39afb5711613a7c083c11ce6a1.

11 years agoFixed pthread_spin_lock on sparc32/64 (bug 16882)
Guo Yixuan [Tue, 3 Jun 2014 23:19:11 +0000 (16:19 -0700)] 
Fixed pthread_spin_lock on sparc32/64 (bug 16882)

[BZ #16882]
* nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
(pthread_spin_lock): Branch out of spin loop to proper location.
* nptl/sysdeps/sparc/sparc64/pthread_spin_lock.S
(pthread_spin_lock): Likewise.

* nptl/tst-spin4.c: New test.
* nptl/Makefile (tests): Add tst-spin4.

11 years agoPowerPC: Remove 64 bits instructions in PPC32 code
Adhemerval Zanella [Thu, 22 May 2014 19:48:38 +0000 (14:48 -0500)] 
PowerPC: Remove 64 bits instructions in PPC32 code

This patch replaces the insrdi by insrwi in powerpc32 assembly.

It is a backport of d298c41635ce7f2dc7c3eccc842fe3aa754c0c8e.

11 years agoPowerPC: Fix memchr ifunc hidden symbol for PPC32
Adhemerval Zanella [Thu, 22 May 2014 12:53:44 +0000 (07:53 -0500)] 
PowerPC: Fix memchr ifunc hidden symbol for PPC32

This patch fixes a similar issue to
736c304a1ab4cee36a2f3343f1698bc0abae4608, where for PPC32 if the symbol
is defined as hidden (memchr) then compiler will create a local branc
(symbol@local) and the linker will not create a required PLT call to
make the ifunc work.  It changes the default hidden symbol (__GI_memchr)
to default memchr symbol for powerpc32 (__memchr_ppc32).

Backport of 3d2badacf185fac740a2992240a817fb2ca325af.

11 years agoaarch64: Merge __local_multiple_threads offset with memory reference
Richard Henderson [Wed, 21 May 2014 17:24:03 +0000 (13:24 -0400)] 
aarch64: Merge __local_multiple_threads offset with memory reference

This also highlights that we'd been loading 64-bits instead of
the proper 32-bits.  Caught by the linker as a relocation error,
since the variable happened to be unaligned for 64-bits.

Cherry-pick of a6b3657be6bc5067aeec98d990f60765361c6557.

11 years agoPowerPC: Fix multiarch hypotf PPC64 path
Adhemerval Zanella [Mon, 19 May 2014 22:56:55 +0000 (17:56 -0500)] 
PowerPC: Fix multiarch hypotf PPC64 path

This patch moves the hypotf multiarch implementation to correct path.

11 years agoFix sparc memcpy data corruption when using niagara2 optimized routines.
Jose E. Marchesi [Sat, 17 May 2014 18:20:27 +0000 (11:20 -0700)] 
Fix sparc memcpy data corruption when using niagara2 optimized routines.

* sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Add missing
membar to avoid block loads/stores to overlap previous stores.

11 years agotzselect: use zonedir instead of current working directory
Sami Kerola [Tue, 13 May 2014 17:38:32 +0000 (19:38 +0200)] 
tzselect: use zonedir instead of current working directory

(cherry picked from commit 893b4f375668c025cbd6828f82a8844edda276d1)
(cherry picked from commit c72399fbc5228580a560d8fe319ff98150928b05)

Conflicts:
timezone/Makefile

11 years agoUpdate Swedish translations
Allan McRae [Fri, 16 May 2014 04:21:12 +0000 (14:21 +1000)] 
Update Swedish translations

(cherry picked from commit d51d659d114e2edb0037b2af45d6ee36458e48d1)

11 years agoSPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)
Aurelien Jarno [Thu, 15 May 2014 22:04:41 +0000 (00:04 +0200)] 
SPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)

prlimit and prlimit64 have been added in the main <bits/resource.h>, but
not in the SPARC specific version. Fix that.

Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
<pochu@debian.org>

(cherry picked from commit d16e6ec7ca2c861ba681e3a2fbd431725774292e)

11 years agoSPARC: add EFD_SEMAPHORE in <bits/eventfd.h> (BZ #16916)
Aurelien Jarno [Tue, 6 May 2014 21:31:44 +0000 (23:31 +0200)] 
SPARC: add EFD_SEMAPHORE in <bits/eventfd.h> (BZ #16916)

EFD_SEMAPHORE has been added in the main <bits/eventfd.h>, but not in
the SPARC specific version. Fix that.

(cherry picked from commit 83df9ad0cc861ef24f08a88c5a4c055e2516d33c)

11 years agoPowerPC: strncpy/stpncpy optimization for PPC64/POWER7
Vidya Ranganathan [Tue, 6 May 2014 00:10:45 +0000 (19:10 -0500)] 
PowerPC: strncpy/stpncpy optimization for PPC64/POWER7

The optimization is achieved by following techniques:
  > data alignment [gain from aligned memory access on read/write]
  > POWER7 gains performance with loop unrolling/unwinding
    [gain by reduction of branch penalty].
  > zero padding done by calling optimized memset

11 years agoPowerPC: ifunc improvement for internal calls
Adhemerval Zanella [Fri, 2 May 2014 17:00:36 +0000 (12:00 -0500)] 
PowerPC: ifunc improvement for internal calls

This patch changes de default symbol redirection for internal call of
memcpy, memset, memchr, and strlen to the IFUNC resolved ones.  The
performance improvement is noticeable in algorithms that uses these
symbols extensible, like the regex functions.

This is a backport of 19c4bec0f43599eecc2f32de96ae179cd7d64053.

11 years agomisc/sys/xattr.h: guard against linux uapi header inclusion
Serge Hallyn [Tue, 11 Mar 2014 04:17:07 +0000 (23:17 -0500)] 
misc/sys/xattr.h: guard against linux uapi header inclusion

If the glibc xattr.h header is included after the uapi header,
compilation fails due to an enum re-using a #define from the
uapi header.  Protect against this by guarding the define and
enum inclusions against each other.

(A corresponding kernel patch has been sent here:
http://lkml.org/lkml/2014/3/7/331 )

(See https://lists.debian.org/debian-glibc/2014/03/msg00029.html
and https://sourceware.org/glibc/wiki/Synchronizing_Headers
for more information.)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
(cherry picked from commit fdbe8eae2b9aed74dabba1b0a189c5d7d61bf032)

11 years agoUpdate Esperanto translations
Allan McRae [Sun, 4 May 2014 03:35:16 +0000 (13:35 +1000)] 
Update Esperanto translations

(cherry picked from commit d69aeb123961252ddd2a23acc7dc9ce0ae2cfa5f)