platform/upstream/linaro-glibc.git
7 years agoIncrease the number of DTV_SURPLUS slots. (14->28) 41/104541/1
Dongkyun, Son [Tue, 13 Dec 2016 12:09:58 +0000 (21:09 +0900)]
Increase the number of DTV_SURPLUS slots. (14->28)

This change can fix dlopen failure.
"dlopen: cannot load any more object with static TLS"

Change-Id: I159aab6561ba817430673149090d92ea6879c4a7
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: Enable memcpy in sysdeps/arm/memcpy.S for ARM 70/78970/4 tizen_3.0 accepted/tizen/3.0/base/20161028.103022 accepted/tizen/base/20161004.080441 submit/tizen_3.0_base/20161028.062323 submit/tizen_base/20160930.082827
Dongkyun, Son [Fri, 17 Jun 2016 06:43:59 +0000 (15:43 +0900)]
packaging: Enable memcpy in sysdeps/arm/memcpy.S for ARM

Enable memcpy in sysdeps/arm/memcpy.S for ARM
instead of memcpy in sysdeps/arm/armv7/multiarch/

Turn on --disable-multi-arch option for configure except %{ix86} x86_64 arch.

Change-Id: Ifa2fc30e8bfa7d887ab58f41defdfae32ed16f41
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoMerge "Nss configuration update" into tizen_base accepted/tizen/base/20160902.074344 submit/tizen_base/20160831.021716
Dongkyun Son [Wed, 31 Aug 2016 01:52:30 +0000 (18:52 -0700)]
Merge "Nss configuration update" into tizen_base

8 years agopackaging: fix glibc_major_version to 2014.11 98/80398/1 accepted/tizen/base/20160805.171145 submit/tizen_base/20160805.015701
Chan Lee [Mon, 18 Jul 2016 01:44:55 +0000 (10:44 +0900)]
packaging: fix glibc_major_version to 2014.11

Change-Id: I8bdf479041b49c8dac39cb099c072adeabb2ac29
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agoNss configuration update 96/80296/1
Bartlomiej Grzelewski [Fri, 8 Jul 2016 13:13:30 +0000 (15:13 +0200)]
Nss configuration update

During user switch we must set up groups related with privileges
owned by user. The list of groups is taken from security-manager
service.

Change-Id: I3b01aad84880328e51eccf6ed12f4082f5b639cc

8 years agopackaging: fix glibc_major_version devel
Dongkyun, Son [Mon, 23 May 2016 08:10:22 +0000 (17:10 +0900)]
packaging: fix glibc_major_version

Change-Id: Iab6fffc4e237e248c1019a7010c161955e3b71fe
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: move libBrokenLocale.so
Dongkyun, Son [Fri, 13 May 2016 05:13:27 +0000 (14:13 +0900)]
packaging: move libBrokenLocale.so

'devel-utils' is not included to target image.
So, this can cause "dlopen failed(libBrokenLocale.so.1...)." issue.

Change-Id: I41667c1223df76a53de0bdb5eab592fed06475a0
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: Disabling nscd entirely
Dongkyun, Son [Thu, 7 Apr 2016 16:07:41 +0000 (01:07 +0900)]
packaging: Disabling nscd entirely

configure --disable-nscd

Change-Id: Ia36c10bad5bd2eb75a64d97c7b618df672228864
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: added libthread_db.so.1 to %file list
Hyeongsik Min [Thu, 31 Mar 2016 07:57:40 +0000 (16:57 +0900)]
packaging: added libthread_db.so.1 to %file list

Change-Id: I40c685ceaa3b98207fb9eba9d63ffb94c76bdc8b
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
8 years agopackaging: filter -mthumb, -mimplicit-it=thumb option
Chan Lee [Thu, 25 Feb 2016 07:42:10 +0000 (16:42 +0900)]
packaging: filter -mthumb, -mimplicit-it=thumb option

Change-Id: I5e68a2cc1c6232214d37a7e1f750842b69c043ba
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agoCVE-2015-8779: catopen() Multiple unbounded stack allocations (2 of 2)
Paul Pluzhnikov [Sat, 8 Aug 2015 22:54:40 +0000 (15:54 -0700)]
CVE-2015-8779: catopen() Multiple unbounded stack allocations (2 of 2)

 https://msisac.cisecurity.org/advisories/2016/2016-021.cfm
 https://sourceware.org/bugzilla/show_bug.cgi?id=17905

Fix trailing space.

Change-Id: I55ec41be7b76784588c5f6ea6528911fb33d31b3
Signed-off-by: Jaehun Jeong <jh4u.jeong@samsung.com>
8 years agoCVE-2015-8779: catopen() Multiple unbounded stack allocations (1 of 2)
Paul Pluzhnikov [Sat, 8 Aug 2015 22:53:03 +0000 (15:53 -0700)]
CVE-2015-8779: catopen() Multiple unbounded stack allocations (1 of 2)

 https://msisac.cisecurity.org/advisories/2016/2016-021.cfm
 https://sourceware.org/bugzilla/show_bug.cgi?id=17905

Fix BZ #17905

Change-Id: I6d7e5c49b7e0af3adccc4f3ad68fca42c1e92c6d
Signed-off-by: Jaehun Jeong <jh4u.jeong@samsung.com>
8 years agoRevert "CVE-2015-8779: catopen() Multiple unbounded stack allocations (1 of 3) https...
Jaehun Jeong [Tue, 23 Feb 2016 05:25:02 +0000 (21:25 -0800)]
Revert "CVE-2015-8779: catopen() Multiple unbounded stack allocations (1 of 3) https://msisac.cisecurity.org/advisories/2016/2016-021.cfm https://sourceware.org/bugzilla/show_bug.cgi?id=17905"

This reverts commit 7ce4c382c494405a43e20889f4e2a6a052963fab.
Due to wrong commit message

Change-Id: I454e15624ea45e38f06aee96d0c3987a612bd92b

8 years agoRevert "CVE-2015-8779: catopen() Multiple unbounded stack allocations (2 of 3) https...
Jaehun Jeong [Tue, 23 Feb 2016 05:24:02 +0000 (21:24 -0800)]
Revert "CVE-2015-8779: catopen() Multiple unbounded stack allocations (2 of 3) https://msisac.cisecurity.org/advisories/2016/2016-021.cfm https://sourceware.org/bugzilla/show_bug.cgi?id=17905"

This reverts commit 40e6dab6b97f6674549998ddf6a4f7882710de8f.
Due to wrong commit message

Change-Id: I96451f200c501c99952bd872c24f6a31cc14cb89

8 years agoRevert commit due to wrong commit message
Jaehun Jeong [Tue, 23 Feb 2016 05:21:26 +0000 (21:21 -0800)]
Revert commit due to wrong commit message

Revert "CVE-2015-8779: catopen() Multiple unbounded stack allocations (3 of 3) https://msisac.cisecurity.org/advisories/2016/2016-021.cfm https://sourceware.org/bugzilla/show_bug.cgi?id=17905"

This reverts commit a1a8668eb9d679a772506b8ce0dbc14478715bbe.

Change-Id: Ic2f30abb91768e134f75a724710f9dffbab0ba61

8 years agoCVE-2015-8779: catopen() Multiple unbounded stack allocations (3 of 3) https://msisac...
Paul Pluzhnikov [Sat, 26 Sep 2015 20:27:48 +0000 (13:27 -0700)]
CVE-2015-8779: catopen() Multiple unbounded stack allocations (3 of 3) https://msisac.cisecurity.org/advisories/2016/2016-021.cfm https://sourceware.org/bugzilla/show_bug.cgi?id=17905

Fix BZ #18985 -- out of range data to strftime() causes a segfault

Change-Id: I6cb12bb92d0c0e55f721f71a2f06892c723981ef
Signed-off-by: Jaehun Jeong <jh4u.jeong@samsung.com>
8 years agoCVE-2015-8779: catopen() Multiple unbounded stack allocations (2 of 3) https://msisac...
Paul Pluzhnikov [Sat, 8 Aug 2015 22:54:40 +0000 (15:54 -0700)]
CVE-2015-8779: catopen() Multiple unbounded stack allocations (2 of 3) https://msisac.cisecurity.org/advisories/2016/2016-021.cfm https://sourceware.org/bugzilla/show_bug.cgi?id=17905

Fix trailing space.

Change-Id: I2e5fe8bc6adeaefef952ae82bf217a8acb08e490
Signed-off-by: Jaehun Jeong <jh4u.jeong@samsung.com>
8 years agoCVE-2015-8779: catopen() Multiple unbounded stack allocations (1 of 3) https://msisac...
Paul Pluzhnikov [Sat, 8 Aug 2015 22:53:03 +0000 (15:53 -0700)]
CVE-2015-8779: catopen() Multiple unbounded stack allocations (1 of 3) https://msisac.cisecurity.org/advisories/2016/2016-021.cfm https://sourceware.org/bugzilla/show_bug.cgi?id=17905

Fix BZ #17905

Change-Id: I615e916c407f142bd229fff79335f819b8b62ba9
Signed-off-by: Jaehun Jeong <jh4u.jeong@samsung.com>
8 years agoLie about futex_atomic_cmpxchg_inatomic kernel support.
Dongkyun, Son [Wed, 20 May 2015 01:01:33 +0000 (10:01 +0900)]
Lie about futex_atomic_cmpxchg_inatomic kernel support.

In past versions of glibc, we incorrectly assumed all ARM kernels
in all configurations supported futex_atomic_cmpxchg_inatomic. This
was clearly a lie, however it was a lie that we relied on, because
the fallback implementation appears to not play nicely with certain
applications like pulseaudio.  Restore the lie for kernels > 2.6.32
and plug our ears and scream "LA LA LA" about how wrong this is.

Author: Adam Conrad <adconrad@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/1436162
Last-Update: 2015-03-25

Change-Id: I45cd4a85dd5d5351633143d2cda7b12e624468b2
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: renamed glibc.spec -> linaro-glibc.spec
Dongkyun, Son [Tue, 19 Jan 2016 08:48:37 +0000 (17:48 +0900)]
packaging: renamed glibc.spec -> linaro-glibc.spec

Change-Id: If1a21d163107ffd19e845ed8c1fdf08253ff28fc
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: removed locale build
Dongkyun, Son [Sat, 9 Jan 2016 06:42:59 +0000 (15:42 +0900)]
packaging: removed locale build

Change-Id: If5c569cea5b0daa88f8e4af8101f565b730ba026
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 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]

Change-Id: I4104608d09d17826cd863877e1f0cdaffaecfe7f
Signed-off-by: Hyung-Kyu (HQ) Choi <hk0110.choi@samsung.com>
8 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)

Change-Id: I7cab82f45dcac7c59671bd0a89bc82fe916915cc
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
8 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.

Change-Id: I036022aee8c33895426c4baf383a499f11ff2ea0
Signed-off-by: UkJung Kim <ujkim@samsung.com>
8 years agoARM: Fix memcpy & memmove for [ARM_ALWAYS_BX]
Roland McGrath [Thu, 19 Mar 2015 19:45:24 +0000 (12:45 -0700)]
ARM: Fix memcpy & memmove for [ARM_ALWAYS_BX]

Backport from master: 298e5d56
2015-03-19  Roland McGrath  <roland@hack.frob.com>

* sysdeps/arm/memcpy.S [ARM_ALWAYS_BX]: Fix computed-jump calculations
to account for alignment padding.
* sysdeps/arm/memmove.S: Likewise.

Change-Id: I7e607914f826c416a30c944d25ed48008611d59f

8 years agoAdd unwind info to _start and _dl_start_user
Yury Usishchev [Fri, 26 Jun 2015 14:10:21 +0000 (17:10 +0300)]
Add unwind info to _start and _dl_start_user

This patch fixes segfault when ASan tries to unwind stack on
libraries initialization stage.

        * sysdeps/arm/dl-machine.h: add unwind info to inline assembly

Change-Id: I81fd4e35ac4bc6d20127fdf2ca6921d8e771c141
Signed-off-by: Yury Usishchev <y.usishchev@samsung.com>
8 years agoResize DTV if the current DTV isn't big enough
H.J. Lu [Fri, 28 Nov 2014 15:54:07 +0000 (07:54 -0800)]
Resize DTV if the current DTV isn't big enough

This patch changes _dl_allocate_tls_init to resize DTV if the current DTV
isn't big enough.  Tested on X86-64, x32 and ia32.

[BZ #13862]
* elf/dl-tls.c: Include <atomic.h>.
(oom): Remove #ifdef SHARED/#endif.
(_dl_static_dtv, _dl_initial_dtv): Moved before ...
(_dl_resize_dtv): This.  Extracted from _dl_update_slotinfo.
(_dl_allocate_tls_init): Resize DTV if the current DTV isn't
big enough.
(_dl_update_slotinfo): Call _dl_resize_dtv to resize DTV.
* nptl/Makefile (tests): Add tst-stack4.
(modules-names): Add tst-stack4mod.
($(objpfx)tst-stack4): New.
(tst-stack4mod.sos): Likewise.
($(objpfx)tst-stack4.out): Likewise.
($(tst-stack4mod.sos)): Likewise.
(clean): Likewise.
* nptl/tst-stack4.c: New file.
* nptl/tst-stack4mod.c: Likewise.

Change-Id: Ib4cc10ee737b74004c659b2d2393b601f75ab249

8 years agoAdd atomic operations similar to those provided by C11.
Torvald Riegel [Sun, 14 Sep 2014 18:04:54 +0000 (20:04 +0200)]
Add atomic operations similar to those provided by C11.

Change-Id: I4138c4d17bfa5f70e85530933aadd4fc7662fc84

8 years agoAdd arch-specific configuration for C11 atomics support.
Torvald Riegel [Fri, 17 Oct 2014 23:02:59 +0000 (01:02 +0200)]
Add arch-specific configuration for C11 atomics support.

This sets __HAVE_64B_ATOMICS if provided.  It also sets
USE_ATOMIC_COMPILER_BUILTINS to true if the existing atomic ops use the
__atomic* builtins (aarch64, mips partially) or if this has been
tested (x86_64); otherwise, this is set to false so that C11 atomics will
be based on the existing atomic operations.

Change-Id: Idb0f82007ca89b26bf330e63ddbc52ada6bfe5e0

8 years agoNew Bhilodi and Tulu locales (BZ #17475)
Tatiana Udalova [Wed, 12 Nov 2014 11:36:39 +0000 (17:06 +0530)]
New Bhilodi and Tulu locales (BZ #17475)

Change-Id: Id08824de571c2b70e5c76849fd2afa49c25eee05

8 years agoApply linaro-gcc-version.patch
Dongkyun, Son [Wed, 10 Jun 2015 02:11:14 +0000 (11:11 +0900)]
Apply linaro-gcc-version.patch

Change-Id: I58a06e487be977cc370d589a314fa1a528da5187
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoarm: Re-enable PI futex support for ARM kernels >= 3.14.3
Gratian Crisan [Mon, 27 Oct 2014 22:45:43 +0000 (22:45 +0000)]
arm: Re-enable PI futex support for ARM kernels >= 3.14.3

ARM linux kernels before 3.14.3 may or may not support
futex_atomic_cmpxchg_inatomic depending on the kernel configuration (e.g.
CONFIG_CPU_USE_DOMAINS && CONFIG_SMP configuration was not supported)

Starting with 3.14.3 the linux kernel unconditionally enables support for
ARM, and this re-enables the relevant __ASSUME_* macros.

Tested on ARM both with kernels >= 3.14.3 and older kernels.

* sysdeps/unix/sysv/linux/arm/kernel-features.h
[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_FUTEX_LOCK_PI): Do
not undefine.
[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_REQUEUE_PI):
Likewise.
[__LINUX_KERNEL_VERSION >= 0x030E03] (__ASSUME_SET_ROBUST_LIST):
Likewise.

Change-Id: I45cd4a85dd5d5351633143d2cda7b12e624468b2

8 years agoPackaging version change
Vyacheslav Barinov [Tue, 20 Oct 2015 07:50:42 +0000 (10:50 +0300)]
Packaging version change

Change-Id: I1b113d575918d95fb331c96a6489cb3d51b2d6f9

8 years agopackaging: add packaging (from tizen branch)
Dongkyun, Son [Tue, 20 Oct 2015 02:05:27 +0000 (11:05 +0900)]
packaging: add packaging (from tizen branch)

Change-Id: I24d27a18a96d6d8dd60e7876469efb8f21abd214
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoS390: Fix "backtrace() returns infinitely deep stack frames with makecontext()" ...
Stefan Liebler [Thu, 28 Apr 2016 08:26:35 +0000 (10:26 +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)

8 years agoS/390: Fix setcontext/swapcontext which are not restoring sigmask.
Stefan Liebler [Thu, 28 Apr 2016 08:25:49 +0000 (10:25 +0200)]
S/390: Fix setcontext/swapcontext which are not restoring sigmask.

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

(cherry picked from commit 2e807f29595eb5b1e5d0decc6e356a3562ecc58e)

8 years agoconfigure: fix `test ==` usage
Mike Frysinger [Sun, 10 Apr 2016 00:02:48 +0000 (20:02 -0400)]
configure: fix `test ==` usage

POSIX defines the = operator, but not ==.  Fix the few places where we
incorrectly used ==.

(cherry picked from commit b2d4456b333970ab4cb01ed8045b9a8d2c4832f3)

8 years agoS390: Extend structs La_s390_regs / La_s390_retval with vector-registers.
Stefan Liebler [Mon, 4 Apr 2016 11:20:27 +0000 (13:20 +0200)]
S390: Extend structs La_s390_regs / La_s390_retval with vector-registers.

Starting with z13, vector registers can also occur as argument registers.
Thus the passed input/output register structs for
la_s390_[32|64]_gnu_plt[enter|exit] functions should reflect those new
registers. This patch extends these structs La_s390_regs and La_s390_retval
and adjusts _dl_runtime_profile() to handle those fields in case of
running on a z13 machine.

ChangeLog:

* sysdeps/s390/bits/link.h: (La_s390_vr) New typedef.
(La_s390_32_regs): Append vector register lr_v24-lr_v31.
(La_s390_64_regs): Likewise.
(La_s390_32_retval): Append vector register lrv_v24.
(La_s390_64_retval): Likeweise.
* sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_profile):
Handle extended structs La_s390_32_regs and La_s390_32_retval.
* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_profile):
Handle extended structs La_s390_64_regs and La_s390_64_retval.

(cherry picked from commit 5cdd1989d1d2f135d02e66250f37ba8e767f9772)

8 years agoS390: Save and restore fprs/vrs while resolving symbols.
Stefan Liebler [Mon, 4 Apr 2016 11:20:27 +0000 (13:20 +0200)]
S390: Save and restore fprs/vrs while resolving symbols.

On s390, no fpr/vrs were saved while resolving a symbol
via _dl_runtime_resolve/_dl_runtime_profile.

According to the abi, the fpr-arguments are defined as call clobbered.
In leaf-functions, gcc 4.9 and newer can use fprs for saving/restoring gprs
instead of saving them to the stack.
If gcc do this in one of the resolver-functions, then the floating point
arguments of a library-function are invalid for the first library-function-call.
Thus, this patch saves/restores the fprs around the resolving code.

The same could occur for vector registers. Furthermore an ifunc-resolver
could also clobber the vector/floating point argument registers.
Thus this patch provides the further variants _dl_runtime_resolve_vx/
_dl_runtime_profile_vx, which are used if the kernel claims, that
we run on a machine with vector registers.

Furthermore, if _dl_runtime_profile calls _dl_call_pltexit,
the pointers to inregs-/outregs-structs were setup invalid.
Now they point to the correct location in the stack-frame.
Before branching back to the caller, the return values are now
restored instead of containing the return values of the
_dl_call_pltexit() call.
On s390-32, an endless loop occurs if _dl_call_pltexit() should be called.
Now, this code-path branches to this function instead of just after the
preceding basr-instruction.

ChangeLog:

* sysdeps/s390/s390-32/dl-trampoline.S: Include dl-trampoline.h twice
to create a non-vector/vector version for _dl_runtime_resolve and
_dl_runtime_profile. Move implementation to ...
* sysdeps/s390/s390-32/dl-trampoline.h: ... here.
(_dl_runtime_resolve) Save and restore fpr/vrs.
(_dl_runtime_profile) Save and restore vrs and fix some issues
if _dl_call_pltexit is called.
* sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup):
Choose the correct resolver function if running on a machine with vx.
* sysdeps/s390/s390-64/dl-trampoline.S: Include dl-trampoline.h twice
to create a non-vector/vector version for _dl_runtime_resolve and
_dl_runtime_profile. Move implementation to ...
* sysdeps/s390/s390-64/dl-trampoline.h: ... here.
(_dl_runtime_resolve) Save and restore fpr/vrs.
(_dl_runtime_profile) Save and restore vrs and fix some issues
* sysdeps/s390/s390-64/dl-machine.h: (elf_machine_runtime_setup):
Choose the correct resolver function if running on a machine with vx.

(cherry picked from commit 4603c51ef7989d7eb800cdd6f42aab206f891077
and commit d8a012c5c9e4bfc1b8db2bc6deacb85b44a2e1eb)

8 years agoS390: configure check for vector instruction support in assembler.
Stefan Liebler [Mon, 4 Apr 2016 11:20:26 +0000 (13:20 +0200)]
S390: configure check for vector instruction support in assembler.

The S390 specific test checks if the assembler has support for the new z13
vector instructions by compiling a vector instruction. The .machine and
.machinemode directives are needed to compile the vector instruction without
-march=z13 option on 31/64 bit.
On success the macro HAVE_S390_VX_ASM_SUPPORT is defined. This macro is used
to determine if the optimized functions can be build without compile errors.
If the used assembler lacks vector support, then a warning is dumped while
configuring and only the common code functions are build.

The z13 instruction support was introduced in
"[Committed] S/390: Add support for IBM z13."
(https://sourceware.org/ml/binutils/2015-01/msg00197.html)

ChangeLog:

* config.h.in (HAVE_S390_VX_ASM_SUPPORT): New macro undefine.
* sysdeps/s390/configure.ac: Add test for S390 vector instruction
assembler support.
* sysdeps/s390/configure: Regenerated.

(cherry picked from commit 4f0a1cea34c05fb2acc16f1a2d291f53230eb4fb)

8 years agoS390: Add new s390 platform.
Stefan Liebler [Mon, 4 Apr 2016 11:20:26 +0000 (13:20 +0200)]
S390: Add new s390 platform.

The new IBM z13 is added to platform string array.
The macro _DL_PLATFORMS_COUNT is incremented to 8,
because it was not incremented by commit
"S/390: Sync AUXV capabilities and archs with kernel".

ChangeLog:

* sysdeps/s390/dl-procinfo.c (_dl_s390_cap_flags): Add z13.
* sysdeps/s390/dl-procinfo.h (_DL_PLATFORMS_COUNT): Increased.

(cherry picked from commit a1b0488fc9df3d895a2e5eefbcd348d3f7fe0e52)

8 years agoS390: Add hwcaps value for vector facility.
Stefan Liebler [Mon, 4 Apr 2016 11:20:26 +0000 (13:20 +0200)]
S390: Add hwcaps value for vector facility.

The HWCAP_S390_VX flag in hwcap field of auxiliary vector indicates
if the vector facility is available and the kernel is aware of it.
This can be tested with LD_SHOW_AUXV=1 <prog>.
Currently it does not show te, because it was not incremented
by commit "S/390: Add hwcap value for transactional execution.".
Thus _DL_HWCAP_COUNT is incremented by two.

ChangeLog:

* sysdeps/s390/dl-procinfo.c (_dl_s390_platforms): Add vector flag.
* sysdeps/s390/dl-procinfo.h: Add vector capability.
* sysdeps/unix/sysv/linux/s390/bits/hwcap.h (HWCAP_S390_VX): Define.

(cherry picked from commit 4e28fa80886c71e6aaf85016b82ce981c0f12e6d)

8 years agoS390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682]
Stefan Liebler [Thu, 3 Mar 2016 07:24:18 +0000 (08:24 +0100)]
S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682]

Beginning with Linux 4.3, the kernel headers contain direct
system call numbers __NR_socket etc. on s390x. On older kernels,
the socket-multiplexer syscall __NR_socketcall was used.

To enable these new syscalls, the patch
"S390: Call direct system calls for socket operations."
(https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5)
was applied upstream.

If glibc 2.23 is configured with --enable-kernel=4.3 and newer,
the direct socket syscalls are used.
For older kernels, the socket-multiplexer syscall is used instead.

In glibc 2.22 and earlier, this patch is not applied.
If you build glibc on a kernel < 4.3, the socket-multiplexer
syscall is used. But if you build glibc on kernel >= 4.3, the
direct socket-syscalls are used. If you install this glibc on a
kernel < 4.3, all socket operations will fail.
See "Bug 19682 - s390x: Incorrect syscall definitions cause
breakage with Linux 4.3 headers"
(https://sourceware.org/bugzilla/show_bug.cgi?id=19682)
The configure switch --enable-kernel does not influence this
behaviour on older glibc-releases.

The solution is to remove the direct socket-syscalls in
sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(this patch) on older glibc-releases as it was done by the
upstream patch, too. These entries were never used on s390x,
but the c-files in sysdeps/unix/sysv/linux/.
After this removal, the behaviour of the socket functions are
not changed compared to the original glibc release version
and the socket-multiplexer-syscall is always used.

8 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 16d0a0ce7613552301786bf05d7eba8784b5732c)

Conflicts:
NEWS
resolv/res_send.c

8 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:
NEWS

8 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:
NEWS

8 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

8 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

8 years agosparc: fix sigaction for 32bit builds [BZ #18694]
Mike Frysinger [Mon, 20 Jul 2015 11:29:15 +0000 (07:29 -0400)]
sparc: fix sigaction for 32bit builds [BZ #18694]

Commit a059d359d86130b5fa74e04a978c8523a0293f77 changed the sigaction
struct to pass conform tests, but it ended up also changing the ABI for
32 bit builds.  For 64 bit builds, changing the long to two ints works,
but for 32 bit builds, it inserts 4 extra bytes.  This leads to many
packages randomly failing like bash that spews things like:
configure: line 471: wait_for: No record of process 0

Bracket the new member by a wordsize check to fix the ABI for 32bit.

(cherry picked from commit 7fde904c73c57faea48c9679bbdc0932d81b3a2f)

8 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.

(cherry picked from commit 5bd80bfe9ca0d955bfbbc002781bc7b01b6bcb06)

Conflicts:
ChangeLog
NEWS

8 years agoUse AVX unaligned memcpy only if AVX2 is available
H.J. Lu [Fri, 30 Jan 2015 14:50:20 +0000 (06:50 -0800)]
Use AVX unaligned memcpy only if AVX2 is available

memcpy with unaligned 256-bit AVX register loads/stores are slow on older
processorsl like Sandy Bridge.  This patch adds bit_AVX_Fast_Unaligned_Load
and sets it only when AVX2 is available.

[BZ #17801]
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
Set the bit_AVX_Fast_Unaligned_Load bit for AVX2.
* sysdeps/x86_64/multiarch/init-arch.h (bit_AVX_Fast_Unaligned_Load):
New.
(index_AVX_Fast_Unaligned_Load): Likewise.
(HAS_AVX_FAST_UNALIGNED_LOAD): Likewise.
* sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Check the
bit_AVX_Fast_Unaligned_Load bit instead of the bit_AVX_Usable bit.
* sysdeps/x86_64/multiarch/memcpy_chk.S (__memcpy_chk): Likewise.
* sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy): Likewise.
* sysdeps/x86_64/multiarch/mempcpy_chk.S (__mempcpy_chk): Likewise.
* sysdeps/x86_64/multiarch/memmove.c (__libc_memmove): Replace
HAS_AVX with HAS_AVX_FAST_UNALIGNED_LOAD.
* sysdeps/x86_64/multiarch/memmove_chk.c (__memmove_chk): Likewise.

(cherry picked from commit 5f3d0b78e011d2a72f9e88b0e9ef5bc081d18f97)

Conflicts:
ChangeLog
NEWS

8 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:
ChangeLog
NEWS

8 years agoMove findidx nested functions to top-level.
Roland McGrath [Thu, 11 Sep 2014 23:02:17 +0000 (16:02 -0700)]
Move findidx nested functions to top-level.

Needed in order to backport strxfrm_l security fix cleanly.

(cherry picked from commit 8c0ab919f63dc03a420751172602a52d2bea59a8)

Conflicts:
ChangeLog

8 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]

(cherry picked from commit 11e3417af6e354f1942c68a271ae51e892b2814d)
(cherry picked from commit e54db0ea6a49affac43fa305fd134f3020c41382)

Conflicts:
NEWS

8 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.

(cherry picked from commit a5357b7ce2a2982c5778435704bcdb55ce3667a0)
(cherry picked from commit ae61fc7b33d9d99d2763c16de8275227dc9748ba)

Conflicts:
NEWS

8 years agoMake __extern_always_inline usable on clang++ again
Siddhesh Poyarekar [Mon, 24 Nov 2014 11:55:56 +0000 (17:25 +0530)]
Make __extern_always_inline usable on clang++ again

The fix for BZ #17266 (884ddc5081278f488ef8cd49951f41cfdbb480ce)
removed changes that had gone into cdefs.h to make
__extern_always_inline usable with clang++.  This patch adds back
support for clang to detect if GNU inlining semantics are available,
this time without breaking the gcc use case.  The check put here is
based on the earlier patch and assertion[1] that checking if
__GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ is defined is sufficient
to determine that clang++ suports GNU inlining semantics.

Tested with a simple program that builds with __extern_always_inline
with the patch and fails compilation without it.

 #include <stdio.h>
 #include <sys/cdefs.h>

extern void foo_alias (void) __asm ("foo");

__extern_always_inline void
foo (void)
{
  puts ("hi oh world!");
  return foo_alias ();
}

void
foo_alias (void)
{
  puts ("hell oh world");
}

int
main ()
{
  foo ();
}

[1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html

[BZ #17266]
* misc/sys/cdefs.h: Define __extern_always_inline for clang
4.2 and newer.

(cherry picked from commit 602f80ec8b966cfad3b61914cbe14ee606cedf6e)

8 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.

(cherry picked from commit a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c)

8 years agoEnd frame record chain correctly.
Renlin Li [Tue, 11 Nov 2014 15:18:04 +0000 (15:18 +0000)]
End frame record chain correctly.

8 years agoMIPS: Avoid a dangling `vfork@GLIBC_2.0' reference
Maciej W. Rozycki [Wed, 22 Oct 2014 14:20:37 +0000 (15:20 +0100)]
MIPS: Avoid a dangling `vfork@GLIBC_2.0' reference

This satisfies a symbol reference created with:

.symver __libc_vfork, vfork@GLIBC_2.0

where `__libc_vfork' has not been defined or referenced.  In this case
the `vfork@GLIBC_2.0' reference is supposed to be discarded, however a
bug present in GAS since forever causes an undefined symbol table entry
to be created.  This in turn triggers a problem in the linker that can
manifest itself by link errors such as:

ld: libpthread.so: invalid string offset 2765592330 >= 5154 for section `.dynstr'

The GAS and linker bugs need to be resolved, but we can avoid them too
by providing a `__libc_vfork' definition just like our other platforms.

[BZ #17485]
* sysdeps/unix/sysv/linux/mips/vfork.S (__libc_vfork): Define.

(cherry picked from commit b5af9297d51a43f96c5be1bafab032184690dd6f)

Conflicts:
NEWS

8 years agoRevert "version.h: Update VERSION for 2014.11 release."
Dongkyun, Son [Sun, 22 May 2016 13:25:05 +0000 (22:25 +0900)]
Revert "version.h: Update VERSION for 2014.11 release."

This reverts commit 7d0d9f33dda0b4725f76fefa433dfdf4ffafdec7.

10 years agoversion.h: Update VERSION for 2014.11 release. upstream upstream/2.20
Will Newton [Wed, 22 Oct 2014 15:03:50 +0000 (16:03 +0100)]
version.h: Update VERSION for 2014.11 release.

10 years agoBZ#17460: Fix buffer overrun in nscd --help.
Roland McGrath [Wed, 8 Oct 2014 22:36:12 +0000 (15:36 -0700)]
BZ#17460: Fix buffer overrun in nscd --help.

(cherry picked from commit c763c5d27112be055920c46f3be8d05bc8b669da)

Conflicts:
NEWS

10 years agoUpdate French translation
Allan McRae [Thu, 9 Oct 2014 12:11:30 +0000 (22:11 +1000)]
Update French translation

(cherry picked from commit b6dcfe8c2408958be246dd61f1c5415ed7667a2a)

10 years agoFix memory leak in error path of do_ftell_wide (BZ #17370)
Siddhesh Poyarekar [Tue, 16 Sep 2014 08:50:45 +0000 (14:20 +0530)]
Fix memory leak in error path of do_ftell_wide (BZ #17370)

(cherry picked from commit 545583d664b64ff234b99aca0d85e99c8a55808f)

10 years agoFix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]
Tim Lammens [Thu, 11 Sep 2014 05:05:54 +0000 (10:35 +0530)]
Fix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]

(cherry picked from commit 984c0ea97f649c869130a1ff099098e2b6f70aad)

Conflicts:
NEWS

10 years agoRevert to defining __extern_inline only for gcc-4.3+ (BZ #17266)
Siddhesh Poyarekar [Tue, 16 Sep 2014 08:44:11 +0000 (14:14 +0530)]
Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266)

The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may
not be sufficient since those flags were added during initial support
for C99 inlining semantics.  There is also a problem with always
defining __extern_inline and __extern_always_inline, since it enables
inline wrapper functions even when GNU inlining semantics are not
guaranteed.  This, along with the possibility of such wrappers using
redirection (btowc for example) could result in compiler generating an
infinitely recusrive call to the function.

In fact it was such a recursion that led to this code being written
the way it was; see:

https://bugzilla.redhat.com/show_bug.cgi?id=186410

The initial change was to fix bugs 14530 and 13741, but they can be
resolved by checking if __fortify_function and/or
__extern_always_inline are defined, as it has been done in this patch.
In addition, I have audited uses of __extern_always_inline to make
sure that none of the uses result in compilation errors.

There is however a regression in this patch for llvm, since it reverts
the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__
definition imply proper extern inline semantics.

2014-09-16  Siddhesh Poyarekar  <siddhesh@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

[BZ #17266]
* libio/stdio.h: Check definition of __fortify_function
instead of __extern_always_inline to include bits/stdio2.h.
* math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also
check if __extern_always_inline is defined.
[__USE_MISC || __USE_XOPEN]: Likewise.
[__USE_ISOC99] Likewise.
* misc/sys/cdefs.h (__fortify_function): Define only if
__extern_always_inline is defined.
[!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining
__extern_always_inline and __extern_inline only for g++-4.3
and newer or a compatible gcc.

10 years agoHandle zero prefix length in getifaddrs (BZ #17371)
Andreas Schwab [Sat, 13 Sep 2014 08:10:29 +0000 (10:10 +0200)]
Handle zero prefix length in getifaddrs (BZ #17371)

(cherry picked from commit a7b872687073decdcc7effc2289877d69058aca9)

Conflicts:
NEWS

10 years agoAdd new Linux 3.16 constants to netinet/udp.h.
Joseph Myers [Fri, 12 Sep 2014 12:13:08 +0000 (12:13 +0000)]
Add new Linux 3.16 constants to netinet/udp.h.

This patch adds the new constants UDP_NO_CHECK6_TX and
UDP_NO_CHECK6_RX from Linux 3.16 to sysdeps/gnu/netinet/udp.h.  (I
believe the existing constants there are already Linux-specific,
possibly with the intention that other OSes should adopt the same
values if possible if adopting the features in question.)

Tested on x86_64.

* sysdeps/gnu/netinet/udp.h (UDP_NO_CHECK6_TX): New macro.
(UDP_NO_CHECK6_RX): Likewise.

(cherry picked from commit 0bd72468030947254e7de183cac1014dac884475)

10 years agoUpdate Russian translation
Allan McRae [Sat, 13 Sep 2014 05:41:54 +0000 (15:41 +1000)]
Update Russian translation

(cherry picked from commit d8f879ee3e4131542c2ac3d1d9db4cf12cb86729)

10 years agoUpdate version.h and include/features.h for 2.20 release
Allan McRae [Sun, 7 Sep 2014 08:09:09 +0000 (18:09 +1000)]
Update version.h and include/features.h for 2.20 release

10 years agoUpdate contrib.texi
Allan McRae [Sun, 7 Sep 2014 06:07:10 +0000 (16:07 +1000)]
Update contrib.texi

Add entries for Wilco Dijkstra and Stefan Liebler.

10 years agoUpdate Korean translation
Allan McRae [Sun, 7 Sep 2014 05:50:34 +0000 (15:50 +1000)]
Update Korean translation

10 years ago[BZ #17354] tile: Fix up corner cases with signed relocations
Chris Metcalf [Fri, 5 Sep 2014 18:40:23 +0000 (14:40 -0400)]
[BZ #17354] tile: Fix up corner cases with signed relocations

Some types of relocations technically need to be signed rather than
unsigned: in particular ones that are used with moveli or movei,
or for jump and branch.  This is almost never a problem.  Jump and
branch opcodes are pretty much uniformly resolved by the static linker
(unless you omit -fpic for a shared library, which is not recommended).
The moveli and movei opcodes that need to be sign-extended generally
are for positive displacements, like the construction of the address of
main() from _start().  However, tst-pie1 ends up with main below _start
(in a different module) and the test failed due to signedness issues in
relocation handling.

This commit treats the value as signed when shifting (to preserve the
high bit) and also sign-extends the value generated from the updated
bundle when comparing with the desired bundle, which we do to make sure
no overflow occurred.  As a result, the tst-pie1 test now passes.

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 agoDefine __GI_fegetenv for e500 libm
Khem Raj [Tue, 2 Sep 2014 21:39:04 +0000 (21:39 +0000)]
Define __GI_fegetenv for e500 libm

generic HAVE_RM_CTX implementation which is used for ppc/e500 as well
has introduced calls to fegetenv which should be resolved internally
with in libm

Signed-off-by: Khem Raj <raj.khem@gmail.com>
* sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c (fegetenv): Add
libm_hidden_ver.

10 years agoUpdate Esperanto translation
Allan McRae [Mon, 1 Sep 2014 00:48:22 +0000 (10:48 +1000)]
Update Esperanto translation

10 years agoUpdate Catalan translation
Allan McRae [Mon, 1 Sep 2014 00:47:30 +0000 (10:47 +1000)]
Update Catalan translation

10 years agoFix hang on fork
Samuel Thibault [Thu, 28 Aug 2014 20:08:39 +0000 (22:08 +0200)]
Fix hang on fork

If e.g. a signal is being received while we are running fork(), the signal
thread may be having our SS lock when we make the space copy, and thus in the
child we can not take the SS lock any more.

* sysdeps/mach/hurd/fork.c (__fork): Lock SS->lock around __proc_dostop call.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agoi386 TLS_INIT_TP might produce bogus asm changing stack pointer [BZ #17319]
Mark Wielaard [Wed, 27 Aug 2014 15:07:58 +0000 (17:07 +0200)]
i386 TLS_INIT_TP might produce bogus asm changing stack pointer [BZ #17319]

TLS_INIT_TP in sysdeps/i386/nptl/tls.h uses some hand written asm to
generate a set_thread_area that might result in exchanging ebx and esp
around the syscall causing introspection tools like valgrind to loose
track of the user stack. Just use INTERNAL_SYSCALL which makes sure
esp isn't changed arbitrarily.

Before the patch the code would generate:

mov    $0xf3,%eax
movl   $0xfffff,0x8(%esp)
movl   $0x51,0xc(%esp)
xchg   %esp,%ebx
int    $0x80
xchg   %esp,%ebx

Using INTERNAL_SYSCALL instead will generate:

movl   $0xfffff,0x8(%esp)
movl   $0x51,0xc(%esp)
xchg   %ecx,%ebx
mov    $0xf3,%eax
int    $0x80
xchg   %ecx,%ebx

Thanks to Florian Weimer for analysing why the original code generated
the bogus esp usage:

  _segdescr.desc happens to be at the top of the stack, so its address
  is in %esp.  The asm statement says that %3 is an input, so its value
  will not change, and GCC can use %esp as the input register for the
  expression &_segdescr.desc.  But the constraints do not fully describe
  the asm statement because the %3 register is actually modified, albeit
  only temporarily.

[BZ #17319]
* sysdeps/i386/nptl/tls.h (TLS_INIT_TP): Use INTERNAL_SYSCALL
to call set_thread_area instead of hand written asm.
(__NR_set_thread_area): Removed define.
(TLS_FLAG_WRITABLE): Likewise.
(__ASSUME_SET_THREAD_AREA): Remove check.
(TLS_EBX_ARG): Remove define.
(TLS_LOAD_EBX): Likewise.

10 years agoSimplify atomicity of socket creation in bind.
Samuel Thibault [Wed, 27 Aug 2014 22:11:54 +0000 (00:11 +0200)]
Simplify atomicity of socket creation in bind.

10 years agoNEWS: Typo fix: s/wil /will /g
Carlos O'Donell [Wed, 27 Aug 2014 15:53:25 +0000 (11:53 -0400)]
NEWS: Typo fix: s/wil /will /g

10 years agoUpdate x86 ULPs
Allan McRae [Wed, 27 Aug 2014 03:36:02 +0000 (13:36 +1000)]
Update x86 ULPs

Using gcc-4.9, i7-2620M, i686 Linux.

10 years agoFix typo in CVE ID
Florian Weimer [Tue, 26 Aug 2014 18:43:07 +0000 (20:43 +0200)]
Fix typo in CVE ID

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 agoUpdate Vietnamese translation
Allan McRae [Tue, 26 Aug 2014 12:44:23 +0000 (22:44 +1000)]
Update Vietnamese translation

10 years agoUpdate Ukrainian translation
Allan McRae [Tue, 26 Aug 2014 12:43:31 +0000 (22:43 +1000)]
Update Ukrainian translation

10 years agoUpdate French translation
Allan McRae [Tue, 26 Aug 2014 12:42:36 +0000 (22:42 +1000)]
Update French translation

10 years agoUpdate Russian translation
Allan McRae [Tue, 26 Aug 2014 12:41:48 +0000 (22:41 +1000)]
Update Russian translation

10 years agoUpdate Polish translation
Allan McRae [Tue, 26 Aug 2014 12:41:00 +0000 (22:41 +1000)]
Update Polish translation

10 years agoUpdate Czech translation
Allan McRae [Tue, 26 Aug 2014 12:39:33 +0000 (22:39 +1000)]
Update Czech translation

10 years agoUpdate German translation
Allan McRae [Tue, 26 Aug 2014 12:38:47 +0000 (22:38 +1000)]
Update German translation

10 years agoUpdate Bulgarian translation
Allan McRae [Tue, 26 Aug 2014 12:36:52 +0000 (22:36 +1000)]
Update Bulgarian translation

10 years agoUpdate Sweedish translation
Allan McRae [Tue, 26 Aug 2014 12:33:50 +0000 (22:33 +1000)]
Update Sweedish translation

10 years agoUpdate Dutch translation
Allan McRae [Tue, 26 Aug 2014 12:32:32 +0000 (22:32 +1000)]
Update Dutch translation

10 years agoUpdate Spanish translation
Allan McRae [Tue, 26 Aug 2014 12:31:31 +0000 (22:31 +1000)]
Update Spanish translation

10 years agoRemove NOT_IN_libc definition for pthread_atfork
Siddhesh Poyarekar [Thu, 21 Aug 2014 05:00:55 +0000 (10:30 +0530)]
Remove NOT_IN_libc definition for pthread_atfork

pthread_atfork is already built in an extra-libs context, which gives
it NOT_IN_libc in its CPPFLAGS.  Adding the same definition to CFLAGS
is pointless.

Verified that the code is unchanged on x86_64.

10 years agoRemove redundant CPPFLAGS for some programs
Siddhesh Poyarekar [Thu, 21 Aug 2014 04:57:13 +0000 (10:27 +0530)]
Remove redundant CPPFLAGS for some programs

These programs get the NOT_IN_libc twice, once through the 'other'
target and another explicitly.  Remove the explicitly added CPFLAG.

* catgets/Makefile (CPPFLAGS-gencat): Remove.
* iconv/Makefile (CPPFLAGS-iconv_prog): Likewise.
(CPPFLAGS-iconvconfig): Likewise.
* timezone/Makefile (CPPFLAGS-zic): Likewise.

10 years agoRemove unnecessary uses of NOT_IN_libc
Siddhesh Poyarekar [Thu, 21 Aug 2014 04:56:46 +0000 (10:26 +0530)]
Remove unnecessary uses of NOT_IN_libc

If a IS_IN_* macro is defined, then NOT_IN_libc is always defined,
except obviously for IS_IN_libc.  There's no need to check for both.
Verified on x86_64 and i686 that the source is unchanged.

       * include/libc-symbols.h: Remove unnecessary check for
       NOT_IN_libc.
       * nptl/pthreadP.h: Likewise.
       * sysdeps/aarch64/setjmp.S: Likewise.
       * sysdeps/alpha/setjmp.S: Likewise.
       * sysdeps/arm/sysdep.h: Likewise.
       * sysdeps/i386/setjmp.S: Likewise.
       * sysdeps/m68k/setjmp.c: Likewise.
       * sysdeps/posix/getcwd.c: Likewise.
       * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise.
       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
       * sysdeps/s390/s390-32/setjmp.S: Likewise.
       * sysdeps/s390/s390-64/setjmp.S: Likewise.
       * sysdeps/sh/sh3/setjmp.S: Likewise.
       * sysdeps/sh/sh4/setjmp.S: Likewise.
       * sysdeps/unix/alpha/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise.
       * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise.
       * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
       * sysdeps/x86_64/setjmp.S: Likewise.

10 years agoMention fixes for BZs 16194 and 16275 in NEWS
H.J. Lu [Wed, 13 Aug 2014 15:04:54 +0000 (08:04 -0700)]
Mention fixes for BZs 16194 and 16275 in NEWS

10 years agoFix powerpc32 __get_clockfreq for non-power4 (bug 17263).
Joseph Myers [Wed, 13 Aug 2014 16:06:18 +0000 (16:06 +0000)]
Fix powerpc32 __get_clockfreq for non-power4 (bug 17263).

In my powerpc32 testing I've observed misc/test-gettimebasefreq
failing.

This is a glibc build (soft-float, though that's not relevant here)
without any --with-cpu and without any special configuration of the
default CPU for GCC either.  In particular, it's one not using
sysdeps/powerpc/powerpc32/power4/hp-timing.h (although in fact the
processor I'm using for testing is POWER4-based), so hp_timing_t is
32-bit not 64-bit.  But the VDSO call being used by
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is generating a 64-bit result
(high part in r3, low part in r4).  The code extracting that result,
however, expects a result of the type hp_timing_t as passed to
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, meaning that only r3 (= 0) is
used and the value in r4 is ignored.  This patch fixes this by always
using uint64_t as the type in INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK -
reflecting the actual ABI (unconditional in the kernel) of that VDSO
call.  This is the minimal change for this issue - no check for
overflow, no change of the type of the timebase_freq variable or the
return type of __get_clockfreq to something other than hp_timing_t
(such a change would simply move the implicit conversions to the over
callers of that function), no change to hp_timing_t itself.

Tested for powerpc32 soft float.

[BZ #17263]
* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Include
<stdint.h>.
(__get_clockfreq): Use uint64_t instead of hp_timing_t in
INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK call.